/* =============================================
   Support Page Styles
   Modern, clean design consistent with other pages
   ============================================= */

/* Page Layout */
.support-page {
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--bg-primary, #f8f9fa);
}

/* Hero Section */
.support-hero {
    position: relative;
    padding: 0;
    margin-bottom: 2rem;
    overflow: hidden;
}

.support-hero-background {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary-color, #00a7ff) 0%, var(--primary-dark, #0077cc) 100%);
    z-index: 0;
}

.support-hero-overlay {
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    z-index: 1;
}

.support-hero-container {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    padding: calc(80px + 3rem) 1.5rem 2.5rem;
}

.support-hero-icon {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    backdrop-filter: blur(10px);
}

.support-hero-icon i {
    font-size: 2.5rem;
    color: white;
}

.support-hero-title {
    color: white;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.support-hero-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    margin: 0;
}

/* Main Content */
.support-content {
    padding: 0 1.5rem 3rem;
}

.support-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Quick Actions Card */
.support-actions-card {
    background: var(--card-background, #ffffff);
    border-radius: 1rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-create-ticket {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-color, #00a7ff), var(--primary-dark, #0077cc));
    color: white;
    font-weight: 600;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 167, 255, 0.2);
}

.btn-create-ticket:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 167, 255, 0.3);
}

.btn-create-ticket.active {
    background: var(--bg-secondary, #e9ecef);
    color: var(--text-primary, #212529);
    box-shadow: none;
}

.support-actions-text {
    color: var(--text-secondary, #6c757d);
    font-size: 0.9rem;
    margin: 0;
}

/* New Ticket Section */
.support-new-ticket-section {
    margin-bottom: 1.5rem;
}

/* Tabs */
.support-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: var(--card-background, #ffffff);
    padding: 0.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.support-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: transparent;
    color: var(--text-secondary, #6c757d);
    font-weight: 600;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.support-tab:hover {
    background: var(--bg-secondary, #f8f9fa);
    color: var(--text-primary, #212529);
}

.support-tab.active {
    background: var(--primary-color, #00a7ff);
    color: white;
}

.support-tab-badge {
    background: rgba(255, 255, 255, 0.25);
    padding: 0.15rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.75rem;
}

.support-tab.active .support-tab-badge {
    background: rgba(255, 255, 255, 0.3);
}

/* Tickets Grid */
.support-tickets-section {
    min-height: 300px;
}

.support-tickets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

/* Ticket Card */
.support-ticket-card {
    background: var(--card-background, #ffffff);
    border-radius: 1rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.2s ease;
}

.support-ticket-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.support-ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color, #e9ecef);
}

.support-ticket-number {
    font-weight: 700;
    color: var(--text-primary, #212529);
}

.support-ticket-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.support-ticket-status.open {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.support-ticket-status.open i {
    font-size: 0.5rem;
}

.support-ticket-status.closed {
    background: var(--bg-secondary, #f8f9fa);
    color: var(--text-secondary, #6c757d);
}

.support-ticket-body {
    padding: 1.25rem;
}

.support-ticket-topic {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color, #00a7ff);
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.support-ticket-topic i {
    font-size: 0.875rem;
}

.support-ticket-message {
    color: var(--text-secondary, #6c757d);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.support-ticket-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.support-ticket-date {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-muted, #adb5bd);
    font-size: 0.8rem;
}

.support-ticket-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color, #e9ecef);
}

.btn-view-ticket {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    color: var(--primary-color, #00a7ff);
    font-weight: 600;
    border: 2px solid var(--primary-color, #00a7ff);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-view-ticket:hover {
    background: var(--primary-color, #00a7ff);
    color: white;
}

/* Empty State */
.support-empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--card-background, #ffffff);
    border-radius: 1rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.support-empty-state i {
    font-size: 4rem;
    color: var(--text-muted, #adb5bd);
    margin-bottom: 1rem;
}

.support-empty-state h4 {
    font-size: 1.25rem;
    color: var(--text-primary, #212529);
    margin-bottom: 0.5rem;
}

.support-empty-state p {
    color: var(--text-secondary, #6c757d);
    margin-bottom: 1.5rem;
}

.btn-create-ticket-empty {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-color, #00a7ff), var(--primary-dark, #0077cc));
    color: white;
    font-weight: 600;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-create-ticket-empty:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 167, 255, 0.3);
}

/* Loading */
.support-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    gap: 1rem;
    color: var(--text-primary, #212529);
}

.support-loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color, #e9ecef);
    border-top-color: var(--primary-color, #00a7ff);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.support-loading-spinner.small {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Modal */
.support-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 24px;
}

.support-modal {
    background: var(--card-background, #ffffff);
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.05);
    animation: slideInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.support-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color, #e9ecef);
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 16px 16px 0 0;
}

.support-modal-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary, #212529);
}

.support-modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary, #6c757d);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.support-modal-close:hover {
    background: var(--bg-secondary, #e9ecef);
    color: var(--text-primary, #212529);
}

.support-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    max-height: calc(80vh - 200px);
}

.support-modal-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 0.75rem;
}

.support-modal-info-item label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-color, #00a7ff);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.support-modal-info-item span {
    font-weight: 600;
    color: var(--text-primary, #212529);
}

.support-modal-messages h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #212529);
    margin-bottom: 1rem;
}

/* Messages */
.support-message {
    padding: 1rem;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
}

.support-message.user-message {
    background: var(--bg-secondary, #f8f9fa);
    border-left: 3px solid var(--primary-color, #00a7ff);
}

.support-message.support-team-message {
    background: rgba(40, 167, 69, 0.05);
    border-left: 3px solid #28a745;
}

.support-message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.support-message-author {
    font-weight: 600;
    color: var(--text-primary, #212529);
}

.support-message-date {
    font-size: 0.8rem;
    color: var(--text-muted, #adb5bd);
}

.support-message-content {
    color: var(--text-secondary, #4a5568);
    line-height: 1.6;
    white-space: pre-wrap;
}

/* Reply Section */
.support-reply-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color, #e9ecef);
}

.support-reply-section h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #212529);
    margin-bottom: 1rem;
}

.support-reply-input {
    width: 100%;
    min-height: 100px;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border-color, #d1d5db);
    border-radius: 0.5rem;
    font-size: 1rem;
    resize: vertical;
    margin-bottom: 1rem;
    background: var(--input-background, #ffffff);
    color: var(--text-primary, #212529);
}

.support-reply-input:focus {
    outline: none;
    border-color: var(--primary-color, #00b4ff);
    box-shadow: 0 0 0 3px rgba(0, 180, 255, 0.1);
}

.btn-send-reply {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-color, #00a7ff), var(--primary-dark, #0077cc));
    color: white;
    font-weight: 600;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-send-reply:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 167, 255, 0.3);
}

.btn-send-reply:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Responsive */
@media (max-width: 768px) {
    .support-hero-title {
        font-size: 2rem;
    }
    
    .support-tickets-grid {
        grid-template-columns: 1fr;
    }
    
    .support-tabs {
        flex-wrap: wrap;
    }
    
    .support-tab {
        flex: 1;
        justify-content: center;
        min-width: fit-content;
    }
    
    .support-modal-overlay {
        bottom: 0;
        right: 0;
        left: 0;
        max-width: 100%;
        width: 100%;
    }
    
    .support-modal {
        border-radius: 16px 16px 0 0;
        max-height: 85vh;
    }
    
    .support-modal-info {
        grid-template-columns: 1fr;
    }
    
    .support-actions-card {
        flex-direction: column;
        text-align: center;
    }
}

/* =============================================
   Dark Mode Support
   ============================================= */

body.dark-mode .support-page {
    background: var(--bg-primary, #121212);
}

body.dark-mode .support-actions-card,
body.dark-mode .support-ticket-card,
body.dark-mode .support-empty-state {
    background: var(--card-background, #1e1e1e);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

body.dark-mode .support-ticket-header,
body.dark-mode .support-ticket-footer {
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .support-ticket-number {
    color: var(--text-primary, #e0e0e0);
}

body.dark-mode .support-ticket-status.closed {
    background: rgba(108, 117, 125, 0.2);
}

body.dark-mode .support-ticket-message {
    color: var(--text-secondary, #9ca3af);
}

body.dark-mode .support-empty-state h4 {
    color: var(--text-primary, #e0e0e0);
}

body.dark-mode .support-loading {
    color: var(--text-primary, #e0e0e0);
}

body.dark-mode .support-loading-spinner {
    border-color: rgba(255, 255, 255, 0.2);
    border-top-color: var(--primary-color, #00a7ff);
}


body.dark-mode .btn-create-ticket.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary, #e0e0e0);
}

/* Tabs Dark Mode */
body.dark-mode .support-tabs {
    background: var(--card-background, #1e1e1e);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

body.dark-mode .support-tab {
    color: var(--text-secondary, #9ca3af);
}

body.dark-mode .support-tab:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary, #e0e0e0);
}

body.dark-mode .support-tab.active {
    background: var(--primary-color, #00b4ff);
    color: #0a1628; /* Dark text for contrast on blue background */
}

body.dark-mode .support-tab.active .support-tab-badge {
    background: rgba(0, 0, 0, 0.2);
    color: #0a1628;
}

/* Modal Dark Mode */
body.dark-mode .support-modal {
    background: var(--card-background, #1e1e1e);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

body.dark-mode .support-modal-header {
    background: rgba(30, 30, 30, 0.9);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .support-modal-title {
    color: var(--text-primary, #e0e0e0);
}

body.dark-mode .support-modal-info {
    background: rgba(30, 30, 30, 0.7);
}

body.dark-mode .support-modal-info-item span {
    color: var(--text-primary, #e0e0e0);
}

body.dark-mode .support-modal-messages h4,
body.dark-mode .support-reply-section h4 {
    color: var(--text-primary, #e0e0e0);
}

body.dark-mode .support-message.user-message {
    background: rgba(0, 167, 255, 0.1);
}

body.dark-mode .support-message.support-team-message {
    background: rgba(40, 167, 69, 0.1);
}

body.dark-mode .support-message-author {
    color: var(--text-primary, #e0e0e0);
}

body.dark-mode .support-message-content {
    color: var(--text-secondary, #9ca3af);
}

body.dark-mode .support-reply-section {
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .support-reply-input {
    background: var(--input-background, #2a2a2a);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-primary, #e0e0e0);
}

body.dark-mode .support-reply-input:focus {
    border-color: var(--primary-color, #00b4ff);
    background: #333;
}
