/* ============================================
   WIDGET ЧАТ ПОДДЕРЖКИ
   ============================================ */
.support-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9000;
    font-family: 'YFFRareHyperMedium', 'Montserrat', sans-serif;
}

.support-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f39c12, #f1c40f);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(241, 196, 15, 0.35);
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.support-toggle:hover {
    transform: scale(1.08) translateY(-4px);
    box-shadow: 0 15px 40px rgba(241, 196, 15, 0.5);
}

.support-toggle svg {
    width: 26px;
    height: 26px;
    stroke: #000;
    position: absolute;
    transition: 0.3s;
}

.support-toggle .icon-close {
    opacity: 0;
    transform: rotate(-90deg);
}

.support-widget.open .support-toggle .icon-open {
    opacity: 0;
    transform: rotate(90deg);
}

.support-widget.open .support-toggle .icon-close {
    opacity: 1;
    transform: rotate(0);
}

.support-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #e74c3c;
    color: #fff;
    font-size: 11px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #0d0e12;
    padding: 0 5px;
    animation: pulseBadge 2s infinite;
}

@keyframes pulseBadge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.support-panel {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 48px);
    height: 600px;
    max-height: calc(100vh - 120px);
    background: rgba(26, 28, 36, 0.95);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transform-origin: bottom right;
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.support-widget.open .support-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.support-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(241, 196, 15, 0.08), transparent);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.support-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 15px;
    font-weight: 900;
}

.support-title svg {
    width: 20px;
    height: 20px;
    stroke: #f1c40f;
}

.support-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

.support-close:hover {
    background: rgba(231, 76, 60, 0.15);
}

.support-close svg {
    width: 16px;
    height: 16px;
    stroke: #8a8d9b;
}

.support-close:hover svg {
    stroke: #e74c3c;
}

.support-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.support-body::-webkit-scrollbar {
    width: 4px;
}
.support-body::-webkit-scrollbar-thumb {
    background: #f39c12;
    border-radius: 10px;
}

.support-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px;
    color: #5b6285;
    font-size: 13px;
}

.support-loading .spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #2a2c38;
    border-top-color: #f1c40f;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.support-empty {
    text-align: center;
    padding: 40px 20px;
    color: #5b6285;
}

.support-empty svg {
    width: 60px;
    height: 60px;
    stroke: #5b6285;
    fill: none;
    stroke-width: 1.5;
    opacity: 0.3;
    margin-bottom: 12px;
}

.support-empty h3 {
    font-size: 15px;
    font-weight: 900;
    margin-bottom: 6px;
    color: #8a8d9b;
}

.support-empty p {
    font-size: 12px;
    line-height: 1.5;
}

.support-msg {
    display: flex;
    gap: 10px;
    max-width: 85%;
    animation: msgIn 0.3s ease;
}

@keyframes msgIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.support-msg.self {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.support-msg .msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.06);
}

.support-msg .msg-content {
    background: #0d0e12;
    border: 1px solid #2a2c38;
    border-radius: 14px;
    padding: 10px 14px;
    position: relative;
}

.support-msg.self .msg-content {
    background: linear-gradient(135deg, rgba(241, 196, 15, 0.12), rgba(243, 156, 18, 0.08));
    border-color: rgba(241, 196, 15, 0.25);
}

.support-msg.staff .msg-content {
    background: rgba(52, 152, 219, 0.08);
    border-color: rgba(52, 152, 219, 0.25);
}

.support-msg .msg-author {
    font-size: 11px;
    font-weight: 900;
    color: #f1c40f;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.support-msg.staff .msg-author {
    color: #3498db;
}

.support-msg .msg-badge {
    font-size: 9px;
    padding: 1px 6px;
    border-radius: 6px;
    background: rgba(52, 152, 219, 0.15);
    color: #3498db;
    font-weight: 900;
    text-transform: uppercase;
}

.support-msg .msg-text {
    font-size: 13px;
    color: #e8e8e8;
    line-height: 1.5;
    word-break: break-word;
    white-space: pre-wrap;
}

.support-msg .msg-time {
    font-size: 10px;
    color: #5b6285;
    margin-top: 4px;
    text-align: right;
}

.support-input-area {
    padding: 12px 16px;
    background: rgba(13, 14, 18, 0.5);
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.support-input-area textarea {
    flex: 1;
    background: #0d0e12;
    border: 1px solid #2a2c38;
    border-radius: 12px;
    padding: 10px 14px;
    color: #fff;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    resize: none;
    min-height: 42px;
    max-height: 100px;
    transition: 0.3s;
}

.support-input-area textarea:focus {
    border-color: #f1c40f;
}

.support-send {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f39c12, #f1c40f);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
    flex-shrink: 0;
}

.support-send:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(241, 196, 15, 0.4);
}

.support-send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.support-send svg {
    width: 18px;
    height: 18px;
    stroke: #000;
}

.support-ban-notice {
    padding: 12px 16px;
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.25);
    border-radius: 12px;
    font-size: 12px;
    color: #e74c3c;
    font-weight: 700;
    text-align: center;
    line-height: 1.5;
}

.support-ban-notice .reason {
    color: #ff8b7d;
    margin-top: 4px;
}

/* ============================================
   ПАНЕЛЬ ПОДДЕРЖКИ (админ)
   ============================================ */
.support-admin-wrapper {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
    height: calc(100vh - 80px);
}

.support-admin-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 20px;
    height: 100%;
}

.support-tickets-list {
    background: #1a1c24;
    border: 1px solid #2a2c38;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tickets-header {
    padding: 20px;
    border-bottom: 1px solid #2a2c38;
}

.tickets-header h3 {
    font-size: 18px;
    font-weight: 900;
    margin-bottom: 14px;
    color: #fff;
}

.tickets-filters {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    background: #0d0e12;
    padding: 4px;
    border-radius: 10px;
    border: 1px solid #2a2c38;
}

.filter-btn {
    flex: 1;
    padding: 8px 8px;
    border: none;
    background: transparent;
    color: #8a8d9b;
    font-size: 11px;
    font-weight: 800;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.3s;
    text-transform: uppercase;
}

.filter-btn:hover {
    color: #fff;
}

.filter-btn.active {
    background: #2a2c38;
    color: #f1c40f;
}

.search-wrap input {
    width: 100%;
    padding: 10px 14px;
    background: #0d0e12;
    border: 1px solid #2a2c38;
    border-radius: 10px;
    color: #fff;
    font-size: 13px;
    outline: none;
    transition: 0.3s;
}

.search-wrap input:focus {
    border-color: #f1c40f;
}

.tickets-container {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.tickets-container::-webkit-scrollbar {
    width: 5px;
}
.tickets-container::-webkit-scrollbar-thumb {
    background: #f39c12;
    border-radius: 10px;
}

.ticket-card {
    background: #0d0e12;
    border: 1px solid #2a2c38;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: 0.3s;
    position: relative;
}

.ticket-card:hover {
    border-color: #383b4d;
    transform: translateX(3px);
}

.ticket-card.active {
    border-color: #f1c40f;
    background: rgba(241, 196, 15, 0.04);
    box-shadow: 0 0 25px rgba(241, 196, 15, 0.05);
}

.ticket-card.priority-high {
    border-left: 3px solid #e74c3c;
}

.ticket-card .ticket-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.ticket-card .ticket-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #2a2c38;
    flex-shrink: 0;
}

.ticket-card .ticket-info {
    flex: 1;
    min-width: 0;
}

.ticket-card .ticket-user {
    font-size: 13px;
    font-weight: 900;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ticket-card .ticket-user .role-badge {
    font-size: 9px;
    padding: 1px 6px;
    border-radius: 6px;
    font-weight: 900;
    text-transform: uppercase;
}

.ticket-card .ticket-user .role-badge.partner { background: rgba(243, 156, 18, 0.15); color: #f39c12; }
.ticket-card .ticket-user .role-badge.admin { background: rgba(142, 68, 173, 0.15); color: #9b59b6; }
.ticket-card .ticket-user .role-badge.support { background: rgba(52, 152, 219, 0.15); color: #3498db; }

.ticket-card .ticket-time {
    font-size: 10px;
    color: #5b6285;
}

.ticket-card .ticket-preview {
    font-size: 12px;
    color: #8a8d9b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 8px;
}

.ticket-card .ticket-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.ticket-card .ticket-status {
    font-size: 9px;
    padding: 3px 10px;
    border-radius: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ticket-status.open { background: rgba(46, 204, 113, 0.15); color: #2ecc71; border: 1px solid rgba(46, 204, 113, 0.2); }
.ticket-status.pending { background: rgba(241, 196, 15, 0.15); color: #f1c40f; border: 1px solid rgba(241, 196, 15, 0.2); }
.ticket-status.closed { background: rgba(91, 98, 133, 0.15); color: #5b6285; border: 1px solid rgba(91, 98, 133, 0.2); }

.ticket-card .ticket-unread {
    min-width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #e74c3c;
    color: #fff;
    font-size: 10px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

.ticket-card .ticket-priority {
    font-size: 12px;
    color: #e74c3c;
}

.support-chat-area {
    background: #1a1c24;
    border: 1px solid #2a2c38;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #5b6285;
    padding: 40px;
}

.chat-empty svg {
    width: 80px;
    height: 80px;
    stroke: #5b6285;
    opacity: 0.3;
}

.chat-empty h3 {
    font-size: 20px;
    font-weight: 900;
    color: #8a8d9b;
}

.chat-empty p {
    font-size: 14px;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: rgba(13, 14, 18, 0.5);
    border-bottom: 1px solid #2a2c38;
    gap: 15px;
    flex-wrap: wrap;
}

.chat-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 200px;
}

.chat-user-info img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid #2a2c38;
}

.chat-user-info .user-details .username {
    font-size: 16px;
    font-weight: 900;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-user-info .user-details .meta {
    font-size: 11px;
    color: #5b6285;
    margin-top: 2px;
}

.chat-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.chat-action-btn {
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
    transition: 0.3s;
    border: 1px solid;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-action-btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.5;
}

.chat-action-btn.close { background: rgba(231, 76, 60, 0.08); color: #e74c3c; border-color: rgba(231, 76, 60, 0.25); }
.chat-action-btn.close:hover { background: #e74c3c; color: #fff; }

.chat-action-btn.escalate { background: rgba(241, 196, 15, 0.08); color: #f1c40f; border-color: rgba(241, 196, 15, 0.25); }
.chat-action-btn.escalate:hover { background: #f1c40f; color: #000; }

.chat-action-btn.ban { background: rgba(231, 76, 60, 0.08); color: #e74c3c; border-color: rgba(231, 76, 60, 0.25); }
.chat-action-btn.ban:hover { background: #e74c3c; color: #fff; }

.chat-action-btn.unban { background: rgba(46, 204, 113, 0.08); color: #2ecc71; border-color: rgba(46, 204, 113, 0.25); }
.chat-action-btn.unban:hover { background: #2ecc71; color: #000; }

.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-body::-webkit-scrollbar {
    width: 6px;
}
.chat-body::-webkit-scrollbar-thumb {
    background: #f39c12;
    border-radius: 10px;
}

.chat-message {
    display: flex;
    gap: 10px;
    max-width: 75%;
    animation: msgIn 0.3s ease;
}

.chat-message.self {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-message .msg-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid #2a2c38;
}

.chat-message .msg-body {
    background: #0d0e12;
    border: 1px solid #2a2c38;
    border-radius: 14px;
    padding: 10px 14px;
}

.chat-message.self .msg-body {
    background: linear-gradient(135deg, rgba(241, 196, 15, 0.12), rgba(243, 156, 18, 0.08));
    border-color: rgba(241, 196, 15, 0.25);
}

.chat-message.staff .msg-body {
    background: rgba(52, 152, 219, 0.08);
    border-color: rgba(52, 152, 219, 0.25);
}

.chat-message .msg-author {
    font-size: 11px;
    font-weight: 900;
    color: #f1c40f;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-message.staff .msg-author { color: #3498db; }

.chat-message .msg-text {
    font-size: 13px;
    color: #e8e8e8;
    line-height: 1.5;
    word-break: break-word;
    white-space: pre-wrap;
}

.chat-message .msg-time {
    font-size: 10px;
    color: #5b6285;
    margin-top: 4px;
    text-align: right;
}

.chat-input-area {
    padding: 15px 20px;
    background: rgba(13, 14, 18, 0.5);
    border-top: 1px solid #2a2c38;
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.chat-input-area textarea {
    flex: 1;
    background: #0d0e12;
    border: 1px solid #2a2c38;
    border-radius: 12px;
    padding: 12px 16px;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    resize: none;
    min-height: 48px;
    max-height: 150px;
    transition: 0.3s;
}

.chat-input-area textarea:focus {
    border-color: #f1c40f;
}

.chat-send-btn {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f39c12, #f1c40f);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
    flex-shrink: 0;
}

.chat-send-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(241, 196, 15, 0.4);
}

.chat-send-btn svg {
    width: 20px;
    height: 20px;
    stroke: #000;
}

/* Ban modal */
.ban-duration-btns {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 10px;
}

.ban-duration-btn {
    padding: 10px 6px;
    border-radius: 8px;
    background: #0d0e12;
    border: 1px solid #2a2c38;
    color: #8a8d9b;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    transition: 0.3s;
}

.ban-duration-btn:hover {
    border-color: #f1c40f;
    color: #f1c40f;
}

.ban-duration-btn.active {
    background: rgba(241, 196, 15, 0.1);
    border-color: #f1c40f;
    color: #f1c40f;
}

#banCustomMinutes {
    width: 100%;
    padding: 10px 14px;
    background: #0d0e12;
    border: 1px solid #2a2c38;
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    outline: none;
    text-align: center;
    font-weight: 700;
}

#banCustomMinutes:focus {
    border-color: #f1c40f;
}

#banReason {
    width: 100%;
    min-height: 80px;
    padding: 12px 14px;
    background: #0d0e12;
    border: 1px solid #2a2c38;
    border-radius: 10px;
    color: #fff;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    resize: vertical;
}

#banReason:focus {
    border-color: #f1c40f;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 10000;
    transition: 0.3s;
    padding: 15px;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.modal-box {
    background: #1a1c24;
    border: 1px solid #2a2c38;
    border-radius: 20px;
    padding: 28px 24px;
    width: 100%;
    max-width: 440px;
    transform: translateY(-20px) scale(0.95);
    transition: 0.3s;
}

.modal-overlay.active .modal-box {
    transform: translateY(0) scale(1);
}

.modal-title {
    font-size: 20px;
    font-weight: 900;
    color: #fff;
    margin-bottom: 6px;
}

.modal-subtitle {
    font-size: 13px;
    color: #8a8d9b;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 800;
    color: #8a8d9b;
    text-transform: uppercase;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-buttons .btn-cancel,
.modal-buttons .btn-confirm {
    flex: 1;
    padding: 12px;
    border-radius: 10px;
    font-weight: 900;
    font-size: 14px;
    cursor: pointer;
    transition: 0.3s;
    border: none;
}

.modal-buttons .btn-cancel {
    background: #2a2c38;
    color: #8a8d9b;
    border: 1px solid #383b4d;
}

.modal-buttons .btn-cancel:hover {
    background: #383b4d;
}

.modal-buttons .btn-confirm {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
}

.modal-buttons .btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(231, 76, 60, 0.3);
}

@media (max-width: 1024px) {
    .support-admin-layout {
        grid-template-columns: 1fr;
    }
    .support-tickets-list {
        max-height: 300px;
    }
}

@media (max-width: 600px) {
    .support-panel {
        bottom: 75px;
        right: -12px;
        width: calc(100vw - 24px);
        height: 70vh;
    }
    .support-toggle {
        width: 54px;
        height: 54px;
    }
    .chat-actions {
        width: 100%;
    }
    .chat-action-btn {
        flex: 1;
        justify-content: center;
        font-size: 10px;
        padding: 8px 10px;
    }
}