/* Стили для чата поддержки */

.support-chat-container {
    display: flex;
    height: calc(100vh - 70px);
    gap: 0;
    margin-right: -20px;
}

/* Левая панель со списком чатов */
.chat-list-panel {
    width: 350px;
    backdrop-filter: blur(2px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
}

.chat-list-header {
    padding: 22.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-list-header h2 {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.new-chat-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(234, 234, 345, 0%);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.new-chat-btn:hover {
    transform: scale(1.1);
}

.new-chat-btn svg {
    width: 20px;
    height: 20px;
    color: white;
}

.chat-list {
    flex: 1;
    overflow-y: auto;
}

.empty-chat-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px;
    text-align: center;
}

.empty-chat-list svg {
    width: 80px;
    height: 80px;
    color: var(--text-secondary);
    opacity: 0.3;
    margin-bottom: 20px;
}

.empty-chat-list p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.start-chat-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.start-chat-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.chat-item {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    gap: 12px;
    position: relative;
}

.chat-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.chat-item:hover {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
}

.chat-item.active {
    background: rgba(102, 126, 234, 0.15);
    backdrop-filter: blur(12px);
}

.chat-item.active::before {
    opacity: 1;
}

.chat-item-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    flex-shrink: 0;
}

.chat-item-content {
    flex: 1;
    min-width: 0;
}

.chat-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.chat-item-title {
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-item-time {
    font-size: 12px;
    color: var(--text-secondary);
    opacity: 0.6;
}

.chat-item-preview {
    font-size: 14px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Правая панель с чатом */
.chat-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(1.5px);
}

.chat-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
}

.chat-empty-state svg {
    width: 120px;
    height: 120px;
    color: var(--text-secondary);
    opacity: 0.2;
    margin-bottom: 24px;
}

.chat-empty-state h3 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.chat-empty-state p {
    color: var(--text-secondary);
    opacity: 0.7;
}

/* Активный чат */
.active-chat {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.chat-avatar-initials {
    font-size: 18px;
}

.chat-header-text h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.chat-status {
    font-size: 13px;
    color: #4ade80;
    transition: color 0.3s ease;
}

.chat-status.waiting {
    color: #fbbf24;
}

.chat-status.online {
    color: #4ade80;
}

/* Сообщения */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    display: flex;
    flex-direction: column;
    max-width: fit-content;
    gap: 6px;
}

.message.own {
    align-self: flex-end;
    margin-left: auto;
}

.message-top {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.message.own .message-top {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}



.message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.message.own .message-header {
    flex-direction: row-reverse;
}

.message-author {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
}

.message-time {
    font-size: 11px;
    color: var(--text-secondary);
    opacity: 0.6;
    margin-left: auto;
    white-space: nowrap;
}

.message.own .message-time {
    margin-left: 0;
    margin-right: auto;
}

.message-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
    width: 100%;
}

.admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(120, 53, 15, 0.4);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(251, 146, 60, 0.2);
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    color: #fb923c;
    text-transform: none;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(251, 146, 60, 0.1);
}

.light-theme .admin-badge {
    background: rgba(251, 146, 60, 0.15);
    border-color: rgba(234, 88, 12, 0.3);
    color: #ea580c;
}

.light-theme .new-chat-btn svg {
    color: black;
}

.message-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    background: rgba(28, 30, 36, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    line-height: 1.5;
    word-wrap: break-word;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    max-width: 500px;
    width: fit-content;
}

.message-bubble:hover {
    background: rgba(28, 30, 36, 0.9);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.message.own .message-bubble {
    background: rgba(40, 42, 48, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.message.own .message-bubble:hover {
    background: rgba(45, 47, 53, 1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

/* Поле ввода */
.chat-input-container {
    padding: 20px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
}

#message-input,
#new-chat-input {
    flex: 1;
    padding: 12px 16px;
    background: rgba(28, 30, 36, 0.6);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 15px;
    resize: none;
    max-height: 120px;
    transition: all 0.3s ease;
    line-height: 1.5;
}

#message-input:focus,
#new-chat-input:focus {
    outline: none;
    border-color: rgba(102, 126, 234, 0.5);
    background: rgba(28, 30, 36, 0.7);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(135, 789, 674, 0%);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.send-btn:hover {
    transform: scale(1.1);
}

.send-btn svg {
    width: 20px;
    height: 20px;
    color: white;
}

/* Форма создания нового чата */
.new-chat-form {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.new-chat-form .chat-messages {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.new-chat-form .chat-input-container {
    padding: 20px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.new-chat-form #new-chat-input {
    flex: 1;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 15px;
    resize: none;
    max-height: 120px;
    transition: all 0.2s ease;
    line-height: 1.5;
}

.new-chat-form #new-chat-input:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.08);
}

.new-chat-form .send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.new-chat-form .send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.new-chat-form .send-btn svg {
    width: 20px;
    height: 20px;
    color: white;
}

/* Светлая тема */
.light-theme .chat-list-panel {
    backdrop-filter: blur(1.5px);
    border-color: rgba(0, 0, 0, 0.1);
}

.light-theme .chat-panel {
    backdrop-filter: blur(1.5px);
}

.light-theme .send-btn svg {
    color: black;
}

.light-theme .chat-header {
    backdrop-filter: blur(12px);
    border-color: rgba(0, 0, 0, 0.1);
}

.light-theme .chat-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.light-theme .chat-item.active {
    background: rgba(102, 126, 234, 0.1);
}

.light-theme .message-bubble {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-color: rgba(0, 0, 0, 0.1);
    color: #1C1E24;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.light-theme .message-bubble:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.light-theme .message.own .message-bubble {
    background: rgba(240, 242, 245, 1);
    border-color: rgba(0, 0, 0, 0.12);
    color: #1C1E24;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.light-theme .message.own .message-bubble:hover {
    background: rgba(230, 232, 235, 1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.14);
}

.light-theme #message-input,
.light-theme #new-chat-input {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    border-color: rgba(0, 0, 0, 0.1);
}

.light-theme #message-input:focus,
.light-theme #new-chat-input:focus {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(102, 126, 234, 0.5);
}

.light-theme .chat-input-container {
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    
}

/* Уведомление о закрытом чате */
.chat-closed-notice {
    padding: 24px;
    margin: 20px 24px;
    background: rgba(239, 68, 68, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 16px;
    text-align: center;
}

.chat-closed-notice h3 {
    margin: 0 0 8px 0;
    color: #ef4444;
    font-size: 18px;
    font-weight: 600;
}

.chat-closed-notice p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.light-theme .chat-closed-notice {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    .support-chat-container {
        flex-direction: column;
    }

    .chat-list-panel {
        width: 100%;
        height: 50vh;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .chat-panel {
        height: 50vh;
    }

    .message {
        max-width: 85%;
    }
    
    .chat-closed-notice {
        margin: 16px;
        padding: 20px;
    }
}

/* FAQ секция */
.faq-section {
    margin-top: 40px;
    padding: 0 24px 24px;
}

.faq-section h2 {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 24px;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.faq-question {
    padding: 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.faq-question h4 {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
}

.faq-icon {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 500px;
}

.faq-answer-content {
    padding: 0 20px 20px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Светлая тема для FAQ */
.light-theme .faq-item {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.1);
}

.light-theme .faq-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    .faq-section {
        padding: 0 16px 16px;
    }

    .faq-section h2 {
        font-size: 24px;
    }

    .faq-question {
        padding: 16px;
    }

    .faq-question h4 {
        font-size: 15px;
    }

    .faq-answer-content {
        padding: 0 16px 16px;
        font-size: 14px;
    }
}
