/* --- Support Page Styles --- */

/* Layout */
.support-layout {
    display: flex;
    height: calc(100vh - 73px); /* Высота хедера вычитается */
    overflow: hidden;
    position: relative;
}

/* Sidebar (Ticket List) */
.tickets-sidebar {
    width: 100%;
    max-width: 320px;
    background: rgba(15, 23, 42, 0.6);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    z-index: 20;
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ticket-item {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.ticket-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.ticket-item.active {
    background: rgba(59, 130, 246, 0.1);
    border-left: 3px solid #3b82f6;
}

.ticket-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444; /* Unread */
    position: absolute;
    top: 1rem;
    right: 1rem;
    box-shadow: 0 0 5px #ef4444;
}

/* Chat Area */
.chat-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.2);
    position: relative;
}

.chat-header {
    padding: 1rem;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.messages-container {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scroll-behavior: smooth;
}

/* Message Bubbles */
.message {
    display: flex;
    gap: 0.75rem;
    max-width: 80%;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.my-msg {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.msg-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: #1e293b;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.msg-content {
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    position: relative;
    min-width: 60px;
}

.message.my-msg .msg-content {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    border-top-right-radius: 0.2rem;
}

.message.other-msg .msg-content {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
    border-top-left-radius: 0.2rem;
}

.msg-sender {
    font-size: 0.7rem;
    margin-bottom: 0.2rem;
    opacity: 0.7;
    font-weight: 600;
}

.msg-text {
    font-size: 0.95rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.system-msg {
    align-self: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem 1rem;
    border-radius: 999px;
    font-size: 0.75rem;
    color: #94a3b8;
    text-align: center;
    margin: 1rem 0;
}

/* Input Area */
.chat-input-area {
    padding: 1rem;
    background: rgba(15, 23, 42, 0.8);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-input-wrapper {
    display: flex;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: border-color 0.2s;
}

.chat-input-wrapper:focus-within {
    border-color: #3b82f6;
}

.chat-input {
    flex-grow: 1;
    background: transparent;
    border: none;
    color: white;
    padding: 0.5rem;
    outline: none;
    font-size: 0.95rem;
}

.send-btn {
    background: #3b82f6;
    color: white;
    border: none;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.send-btn:hover:not(:disabled) {
    background: #2563eb;
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #475569;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .tickets-sidebar {
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 30;
        transform: translateX(0);
    }
    
    .tickets-sidebar.hidden-mobile {
        transform: translateX(-100%);
    }
    
    .chat-area {
        width: 100%;
    }
}

/* Empty State */
.empty-chat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #64748b;
    text-align: center;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}