/* ==========================================================================
   Support System - User Side Styles (Premium, Modern, Glassmorphism)
   ========================================================================== */

   .support-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.support-overlay.show {
    display: flex;
    opacity: 1;
}

.support-container {
    width: 90%;
    max-width: 1000px;
    height: 85vh;
    background: rgba(20, 20, 25, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    box-shadow: 0 24px 40px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    transform: translateY(20px) scale(0.98);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.support-overlay.show .support-container {
    transform: translateY(0) scale(1);
}

/* Header */
.support-header {
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(0, 149, 255, 0.1), rgba(138, 43, 226, 0.1));
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.support-header-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.support-header-title i {
    color: var(--accent-blue);
    font-size: 24px;
}

.support-close-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.support-close-btn:hover {
    background: rgba(255, 59, 48, 0.15);
    color: #ff3b30;
    transform: scale(1.05);
}

/* Body Layout */
.support-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar - Ticket List */
.support-sidebar {
    width: 320px;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.2);
}

.support-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.support-search-box {
    position: relative;
}

.support-search-box input {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 10px 15px 10px 40px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

.support-search-box input:focus {
    border-color: var(--accent-blue);
    background: rgba(0, 149, 255, 0.05);
}

.support-search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.support-filters {
    display: flex;
    gap: 10px;
}

.support-filter-btn {
    flex: 1;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    padding: 6px 0;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.support-filter-btn.active {
    background: rgba(0, 149, 255, 0.15);
    color: var(--accent-blue);
    border-color: rgba(0, 149, 255, 0.3);
}

.support-ticket-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.support-ticket-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.support-ticket-item:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

.support-ticket-item.active {
    background: linear-gradient(135deg, rgba(0, 149, 255, 0.1), rgba(138, 43, 226, 0.1));
    border-color: rgba(138, 43, 226, 0.3);
}

.support-ticket-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    align-items: center;
}

.support-ticket-id {
    font-size: 12px;
    color: var(--text-muted);
    font-family: monospace;
}

.support-ticket-status {
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
}

.status-open { background: rgba(52, 199, 89, 0.15); color: #34c759; border: 1px solid rgba(52, 199, 89, 0.3); }
.status-pending { background: rgba(255, 149, 0, 0.15); color: #ff9500; border: 1px solid rgba(255, 149, 0, 0.3); }
.status-replied { background: rgba(0, 149, 255, 0.15); color: #0095ff; border: 1px solid rgba(0, 149, 255, 0.3); }
.status-closed { background: rgba(255, 59, 48, 0.15); color: #ff3b30; border: 1px solid rgba(255, 59, 48, 0.3); }
.status-resolved { background: rgba(138, 43, 226, 0.15); color: #8a2be2; border: 1px solid rgba(138, 43, 226, 0.3); }

.support-ticket-subject {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.support-ticket-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
}

.support-unread-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff3b30;
    color: white;
    font-size: 10px;
    font-weight: bold;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(255, 59, 48, 0.5);
}

.support-create-btn {
    margin: 10px 20px 20px 20px;
    padding: 12px;
    background: linear-gradient(135deg, var(--accent-blue), #8a2be2);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.support-create-btn:hover {
    box-shadow: 0 8px 20px rgba(0, 149, 255, 0.3);
    transform: translateY(-2px);
}

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

.support-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.support-empty-state i {
    font-size: 60px;
    margin-bottom: 20px;
    opacity: 0.5;
    background: linear-gradient(135deg, rgba(0, 149, 255, 0.5), rgba(138, 43, 226, 0.5));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.support-chat-header {
    padding: 15px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
}

.support-chat-info-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.support-chat-info-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    gap: 15px;
    align-items: center;
}

.support-chat-info-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.support-admin-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    display: inline-block;
}

.support-admin-status.online {
    background: #34c759;
    box-shadow: 0 0 8px #34c759;
}

.support-chat-actions button {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.support-chat-actions button:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.support-messages {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Scrollbar for chat */
.support-messages::-webkit-scrollbar,
.support-ticket-list::-webkit-scrollbar {
    width: 6px;
}
.support-messages::-webkit-scrollbar-thumb,
.support-ticket-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.support-message-bubble {
    max-width: 75%;
    display: flex;
    flex-direction: column;
}

.support-message-bubble.user {
    align-self: flex-end;
}

.support-message-bubble.admin {
    align-self: flex-start;
}

.support-message-content {
    padding: 15px 20px;
    border-radius: 20px;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
    color: white;
}

.support-message-bubble.user .support-message-content {
    background: linear-gradient(135deg, var(--accent-blue), #5b42f3);
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 15px rgba(0, 149, 255, 0.2);
}

.support-message-bubble.admin .support-message-content {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom-left-radius: 4px;
    color: var(--text-primary);
}

.support-message-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.support-message-bubble.user .support-message-meta {
    justify-content: flex-end;
}

.support-read-status {
    font-size: 12px;
}

.support-read-status.read {
    color: var(--accent-blue);
}

/* Attachments in Chat */
.support-message-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.support-attachment-img {
    width: 150px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.2s ease;
}

.support-attachment-img:hover {
    transform: scale(1.05);
}

.support-attachment-file {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.2);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-decoration: none;
    color: var(--text-primary);
    font-size: 12px;
}

.support-attachment-file:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Typing Indicator */
.support-typing-indicator {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    display: none;
    align-items: center;
    gap: 5px;
    width: fit-content;
    margin-bottom: 10px;
}

.support-typing-dot {
    width: 6px;
    height: 6px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}

.support-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.support-typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Input Area */
.support-input-area {
    padding: 20px 30px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.support-attachment-preview {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.support-preview-item {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.support-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.support-preview-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(0,0,0,0.6);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    cursor: pointer;
}

.support-input-wrapper {
    display: flex;
    align-items: flex-end;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 5px;
    transition: border-color 0.3s ease;
}

.support-input-wrapper:focus-within {
    border-color: rgba(0, 149, 255, 0.5);
}

.support-attach-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.support-attach-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.support-textarea {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 12px 15px;
    font-size: 14px;
    resize: none;
    outline: none;
    max-height: 120px;
    font-family: inherit;
}

.support-textarea::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.support-send-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-blue), #8a2be2);
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    border-radius: 12px;
    margin-left: 5px;
    transition: all 0.2s ease;
}

.support-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 149, 255, 0.3);
}

.support-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}


/* New Ticket Modal overlaying the chat area */
.support-new-ticket-view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(20, 20, 25, 0.95);
    backdrop-filter: blur(10px);
    z-index: 10;
    display: none;
    flex-direction: column;
    padding: 40px;
    overflow-y: auto;
}

.support-new-ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.support-new-ticket-title {
    font-size: 24px;
    font-weight: 600;
    color: white;
}

.support-form-group {
    margin-bottom: 20px;
}

.support-form-group label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.support-form-control {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    color: white;
    font-size: 14px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.support-form-control:focus {
    border-color: var(--accent-blue);
}

.support-form-row {
    display: flex;
    gap: 20px;
}
.support-form-row > div {
    flex: 1;
}

.support-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 20px;
}

.support-btn-cancel {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 12px 25px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
}
.support-btn-submit {
    background: linear-gradient(135deg, var(--accent-blue), #8a2be2);
    border: none;
    color: white;
    padding: 12px 35px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    box-shadow: 0 8px 20px rgba(0, 149, 255, 0.3);
}
.support-btn-submit:disabled {
    opacity: 0.7;
    cursor: wait;
}

/* Responsive */
@media (max-width: 768px) {
    .support-container {
        width: 100%;
        height: 100vh;
        border-radius: 0;
        border: none;
    }
    
    .support-body {
        flex-direction: column;
    }
    
    .support-sidebar {
        width: 100%;
        height: 35vh;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
    
    .support-chat-area {
        height: 65vh;
    }
    
    .support-form-row {
        flex-direction: column;
        gap: 0;
    }
}
