/* =========================================
   CREED PORTAL - MODERN DARK DASHBOARD
   ========================================= */

:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #0d0d0d;
    --bg-card: #111111;
    --bg-card-hover: #1a1a1a;
    --bg-input: #0d0d0d;
    
    --border-color: rgba(255, 184, 0, 0.1);
    --border-hover: rgba(255, 184, 0, 0.25);
    
    --text-primary: #ffffff;
    --text-secondary: #a3a3a3;
    --text-muted: #737373;
    
    --accent-primary: #FFB800;
    --accent-primary-hover: #FFD700;
    --accent-glow: rgba(255, 184, 0, 0.3);
    --accent-secondary: #FFD700;
    
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --warning: #FFB800;
    --error: #ef4444;
    --error-bg: rgba(239, 68, 68, 0.1);
    
    --sidebar-width: 280px;
    --header-height: 70px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    
    --transition: all 0.2s ease;
    --transition-slow: all 0.3s ease;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(59, 130, 246, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

/* =========================================
   PARTICLES BACKGROUND
   ========================================= */
.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: float 20s infinite linear;
}

@keyframes float {
    from {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    to {
        transform: translateY(-100vh) rotate(720deg);
        opacity: 0;
    }
}

/* =========================================
   PUBLIC ANNOUNCEMENTS
   ========================================= */
.public-announcements {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 380px;
    max-width: calc(100% - 40px);
    z-index: 50;
}

.announcements-box {
    background: var(--bg-card);
    border: 1px solid rgba(255, 184, 0, 0.2);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    max-height: 400px;
    overflow-y: auto;
}

.announcements-box h2 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #FFB800;
}

.announcements-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.announcement-item {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    transition: var(--transition);
}

.announcement-item:hover {
    border-color: rgba(255, 184, 0, 0.2);
}

.announcement-item h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.announcement-item p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 8px;
}

.announcement-item .date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.public-announcements.hidden {
    display: none;
}

@media (max-width: 768px) {
    .public-announcements {
        position: relative;
        top: auto;
        right: auto;
        width: 100%;
        max-width: 100%;
        padding: 20px;
        margin-bottom: 20px;
    }
}

/* =========================================
   LOGIN SCREEN
   ========================================= */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 100;
    background: radial-gradient(ellipse at center, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
}

.login-box {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 184, 0, 0.2);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: 0 10px 40px rgba(255, 184, 0, 0.1), 0 0 60px rgba(255, 184, 0, 0.05);
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 30px;
}

.login-logo img {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
}

.login-logo span {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, #FFB800 50%, #FFD700 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-box h2 {
    text-align: center;
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.login-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 28px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.input-group input {
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
    outline: none;
}

.input-group input:focus {
    border-color: #FFB800;
    box-shadow: 0 0 0 3px rgba(255, 184, 0, 0.2);
}

.input-group input::placeholder {
    color: var(--text-muted);
}

.input-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    background: linear-gradient(135deg, #FFB800 0%, #FFD700 100%);
    color: #000;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    outline: none;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(255, 184, 0, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    outline: none;
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.login-error {
    margin-top: 16px;
    padding: 12px 16px;
    background: var(--error-bg);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-md);
    color: var(--error);
    font-size: 0.9rem;
    text-align: center;
    display: none;
}

.login-error.show {
    display: block;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.login-footer {
    margin-top: 24px;
    text-align: center;
}

.login-footer a {
    color: #FFB800;
    font-size: 0.9rem;
    text-decoration: none;
    transition: var(--transition);
}

.login-footer a:hover {
    text-decoration: underline;
}

/* Login Toggle */
.login-toggle {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.btn-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: transparent;
    border: 1px solid rgba(255, 184, 0, 0.3);
    border-radius: var(--radius-md);
    color: #FFB800;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-toggle:hover {
    background: rgba(255, 184, 0, 0.1);
    border-color: rgba(255, 184, 0, 0.5);
}

/* Hidden utility */
.hidden {
    display: none !important;
}

/* Admin-only elements */
.admin-only {
    display: none;
}

body.is-admin .admin-only {
    display: flex;
}

/* Customer-only elements */
body.is-admin .customer-only {
    display: none !important;
}

/* Also hide customer sections in main content for admin */
body.is-admin #section-overview,
body.is-admin #section-downloads,
body.is-admin #section-tickets,
body.is-admin #section-settings {
    display: none !important;
}

body.is-admin .admin-only.hidden {
    display: none;
}

/* =========================================
   DASHBOARD LAYOUT
   ========================================= */
.dashboard {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.dashboard.hidden {
    display: none;
}

/* Top Header */
.top-header {
    height: var(--header-height);
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 184, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left .logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-left .logo img {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
}

.header-left .logo span {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, #FFB800 50%, #FFD700 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-info {
    text-align: right;
}

.user-name {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
}

.user-expiry {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.btn-logout {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.btn-logout:hover {
    background: var(--error-bg);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--error);
}

/* Dashboard Container */
.dashboard-container {
    display: flex;
    flex: 1;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px;
    position: fixed;
    height: calc(100vh - var(--header-height));
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
}

.sidebar-user {
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
    width: 100%;
    overflow-x: hidden;
}

.user-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #FFB800 0%, #FFD700 100%);
    color: #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 12px;
}

.user-details {
    margin-bottom: 12px;
}

.user-fullname {
    display: block;
    font-weight: 600;
    font-size: 1rem;
}

.user-since {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--success-bg);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--success);
}

.status-badge .status-dot {
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    width: 100%;
    overflow-x: hidden;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
    width: 100%;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
}

.nav-item i {
    width: 20px;
    text-align: center;
}

.nav-item:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(255, 184, 0, 0.15) 0%, rgba(255, 215, 0, 0.1) 100%);
    color: #FFB800;
    border: 1px solid rgba(255, 184, 0, 0.3);
}

.sidebar-footer {
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    overflow-x: hidden;
}

.footer-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: var(--radius-md);
    transition: var(--transition);
    width: 100%;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
}

.footer-link:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 32px;
    max-width: calc(100% - var(--sidebar-width));
}

/* Content Sections */
.content-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.content-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-header {
    margin-bottom: 28px;
}

.section-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* =========================================
   OVERVIEW SECTION
   ========================================= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, rgba(255, 184, 0, 0.15) 0%, rgba(255, 215, 0, 0.1) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFB800;
    font-size: 1.25rem;
}

.stat-info {
    flex: 1;
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stat-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
}

.stat-value.status-active {
    color: var(--success);
}

.stat-badge {
    padding: 6px 12px;
    background: var(--success-bg);
    color: var(--success);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* License Card */
.license-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 184, 0, 0.15);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 28px;
}

.license-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.license-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.btn-copy {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-copy:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.btn-copy.copied {
    background: var(--success-bg);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--success);
}

.license-key-container {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
}

.license-key {
    flex: 1;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.95rem;
    letter-spacing: 1px;
    user-select: all;
}

.btn-reveal {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.btn-reveal:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

/* Order Details Card */
.order-details-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.order-details-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.order-info {
    color: var(--text-secondary);
}

.order-info p {
    margin-bottom: 8px;
}

.order-info code {
    background: var(--bg-input);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-size: 0.9em;
}

.order-info ul {
    margin-top: 12px;
    padding-left: 20px;
}

.order-info ul li {
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.loading-text {
    color: var(--text-muted);
    font-style: italic;
}

/* =========================================
   DOWNLOADS SECTION
   ========================================= */
.downloads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.download-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: var(--transition-slow);
}

.download-card:hover {
    border-color: rgba(255, 184, 0, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(255, 184, 0, 0.1);
}

/* Launcher Download Section - Always visible */
.download-launcher-section {
    background: linear-gradient(135deg, rgba(255, 184, 0, 0.08) 0%, rgba(255, 215, 0, 0.05) 100%);
    border: 1px solid rgba(255, 184, 0, 0.2);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 16px;
}

.btn-download-full {
    width: 100%;
    margin-top: 10px;
}

/* License Key Section */
.download-key-section {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    transition: var(--transition);
}

.download-key-section.key-unavailable {
    border-color: rgba(245, 158, 11, 0.3);
    background: rgba(245, 158, 11, 0.05);
}

.download-key-container {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-top: 10px;
}

.key-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.key-actions .btn-secondary {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Key Status Badges */
.key-status-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-top: 10px;
}

.key-status-badge i {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.key-status-badge a {
    color: inherit;
    text-decoration: underline;
    font-weight: 500;
}

.key-out-of-stock {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.key-pending {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.download-card.out-of-stock {
    opacity: 0.7;
}

.download-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.download-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.download-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.download-version {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--bg-input);
    padding: 4px 10px;
    border-radius: 20px;
}

.download-key {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 16px;
}

.download-key-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #FFB800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.download-launcher-section .download-key-label {
    color: #10b981;
}

.download-key-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    word-break: break-all;
}

.download-actions {
    display: flex;
    gap: 10px;
}

.download-actions .btn-primary {
    flex: 1;
}

.out-of-stock-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: var(--radius-md);
    color: var(--warning);
    font-size: 0.9rem;
}

.out-of-stock-badge i {
    font-size: 1rem;
}

/* Skeleton Loading */
.skeleton {
    animation: skeleton-pulse 2s infinite;
}

.skeleton-header {
    height: 24px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}

.skeleton-body {
    height: 60px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
}

@keyframes skeleton-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* =========================================
   SUPPORT SECTION
   ========================================= */
.support-grid {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 24px;
}

.tickets-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.tickets-panel h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.tickets-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ticket-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.ticket-item:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.ticket-item.active {
    border-color: var(--accent-primary);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(139, 92, 246, 0.05) 100%);
}

.ticket-info h4 {
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 4px;
}

.ticket-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.ticket-status {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.ticket-status.open {
    background: rgba(255, 184, 0, 0.15);
    color: #FFB800;
}

.ticket-status.closed {
    background: rgba(107, 114, 128, 0.1);
    color: var(--text-muted);
}

.new-badge {
    display: inline-block;
    padding: 2px 8px;
    background: linear-gradient(135deg, #FFB800 0%, #FFD700 100%);
    color: #000;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 4px;
    margin-left: 8px;
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

.empty-text {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.new-ticket-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.new-ticket-card h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.new-ticket-card input,
.new-ticket-card textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-bottom: 12px;
    outline: none;
    transition: var(--transition);
    font-family: inherit;
}

.new-ticket-card input:focus,
.new-ticket-card textarea:focus {
    border-color: #FFB800;
}

.new-ticket-card textarea {
    resize: vertical;
    min-height: 80px;
}

/* Chat Panel */
.chat-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    min-height: 500px;
    display: flex;
    flex-direction: column;
}

.chat-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    padding: 40px;
}

.chat-placeholder i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-container.hidden {
    display: none;
}

.chat-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h4 {
    font-size: 1rem;
    font-weight: 600;
}

.chat-status {
    padding: 4px 12px;
    background: var(--success-bg);
    color: var(--success);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    max-width: 80%;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    position: relative;
}

.message.customer {
    align-self: flex-end;
    background: linear-gradient(135deg, #FFB800 0%, #FFD700 100%);
    color: #000;
    border-bottom-right-radius: 4px;
}

.message.staff {
    align-self: flex-start;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}

.message.customer .message-header {
    color: rgba(255, 255, 255, 0.9);
}

.message.staff .message-header {
    color: var(--accent-primary);
}

.message-body {
    font-size: 0.95rem;
    line-height: 1.5;
    white-space: pre-wrap;
}

.message-time {
    font-size: 0.75rem;
    margin-top: 8px;
    opacity: 0.7;
}

.chat-input-area {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
}

.chat-input-area textarea {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    resize: none;
    outline: none;
    font-family: inherit;
    transition: var(--transition);
}

.chat-input-area textarea:focus {
    border-color: #FFB800;
}

.chat-input-area .btn-primary {
    width: 48px;
    height: 48px;
    padding: 0;
}

/* =========================================
   SETTINGS SECTION
   ========================================= */
.settings-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 700px;
}

.settings-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.settings-card-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.settings-card-header i {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border-radius: var(--radius-md);
    font-size: 1.1rem;
}

.settings-card-header h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.settings-card-header p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.settings-card > h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.settings-card > h4 i {
    color: #FFB800;
}

.settings-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.settings-hint {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 12px;
}

.order-id-display {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.order-id-display .label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.order-id-display code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    color: #FFB800;
}

/* =========================================
   TOAST NOTIFICATIONS
   ========================================= */
.toast-container {
    position: fixed;
    top: 90px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.3s ease;
    min-width: 300px;
}

.toast.success {
    border-color: rgba(255, 184, 0, 0.3);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(255, 184, 0, 0.05) 100%);
}

.toast.error {
    border-color: rgba(239, 68, 68, 0.3);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(239, 68, 68, 0.05) 100%);
}

.toast-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.8rem;
}

.toast.success .toast-icon {
    background: rgba(255, 184, 0, 0.15);
    color: #FFB800;
}

.toast.error .toast-icon {
    background: var(--error-bg);
    color: var(--error);
}

.toast-message {
    flex: 1;
    font-size: 0.95rem;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    transition: var(--transition);
}

.toast-close:hover {
    color: var(--text-primary);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.hiding {
    animation: slideOutRight 0.3s ease forwards;
}

@keyframes slideOutRight {
    to {
        opacity: 0;
        transform: translateX(20px);
    }
}

/* =========================================
   GUIDES EMBED
   ========================================= */

.guides-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.guide-tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.guide-tab-btn:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.guide-tab-btn.active {
    background: rgba(255, 184, 0, 0.1);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.guide-content {
    display: none;
}

.guide-content.active {
    display: block;
}

.guides-embed-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.guides-embed-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.guides-embed-toolbar-text {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.guides-embed-badge {
    background: var(--accent-primary);
    color: var(--bg-primary);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.guides-embed-hint {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.guides-embed-open-tab {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.875rem;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
}

.guides-embed-open-tab:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.guides-embed-frame-wrap {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-card);
    height: 70vh;
    min-height: 500px;
}

.guides-embed-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #ffffff;
}

@media (max-width: 768px) {
    .guides-embed-toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .guides-embed-frame-wrap {
        height: 60vh;
        min-height: 400px;
    }
}

/* =========================================
   RESPONSIVE DESIGN
   ========================================= */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        max-width: 100%;
    }
    
    .support-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .login-box {
        padding: 28px;
    }
    
    .downloads-grid {
        grid-template-columns: 1fr;
    }
    
    .top-header {
        padding: 0 16px;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .section-header h1 {
        font-size: 1.5rem;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-hover);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}
