:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #10b981;
    --accent: #f59e0b;
    --danger: #ef4444;
    --dark: #1e1b4b;
    --darker: #0f0e24;
    --light: #f8fafc;
    --gray: #64748b;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, var(--darker) 0%, var(--dark) 50%, #312e81 100%);
    min-height: 100vh;
    color: var(--light);
    line-height: 1.6;
}

/* Glass Effect */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    margin-bottom: 30px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
    display: flex;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.credits-badge {
    background: linear-gradient(135deg, var(--secondary), #059669);
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.credits-badge svg {
    width: 18px;
    height: 18px;
}

/* Buttons */
.btn {
    padding: 12px 28px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
    background: var(--glass-bg);
    color: white;
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, var(--secondary), #059669);
    color: white;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Touch Feedback */
.btn:active,
.tab:active,
.resolution-option:active,
.aspect-option:active {
    transform: scale(0.98);
    opacity: 0.9;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.tab {
    padding: 14px 28px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--gray);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.tab:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.tab.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-color: transparent;
}

/* Cards */
.card {
    padding: 30px;
    margin-bottom: 20px;
}

.card-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--light);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 14px 18px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-select {
    cursor: pointer;
}

.form-select option {
    background: var(--dark);
}

/* Grid */
.grid {
    display: grid;
    gap: 20px;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {

    .grid-3,
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* Image Preview */
.image-preview {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Khi image-preview chứa uploaded-image-item, không cần aspect-ratio */
.image-preview:has(.uploaded-image-item) {
    aspect-ratio: auto;
    background: transparent;
}

.image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.image-preview.loading::after {
    content: '';
    position: absolute;
    width: 50px;
    height: 50px;
    border: 3px solid var(--glass-border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--glass-border);
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.upload-area.dragover {
    border-color: var(--secondary);
    background: rgba(16, 185, 129, 0.1);
}

.upload-area.small {
    padding: 15px;
    border-radius: 12px;
    font-size: 0.9rem;
}

.upload-area.small p {
    margin: 0;
    opacity: 0.7;
}

.upload-area.small:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.15);
}

@media (max-width: 768px) {
    .upload-area {
        padding: 20px;
    }
}

/* Mode description for AI Complex */
.mode-description {
    margin: 0 0 15px 0;
    font-size: 0.95rem;
    color: var(--gray);
    line-height: 1.5;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* Uploaded Images Grid */
.uploaded-image-item {
    position: relative;
    display: inline-block;
    width: 120px;
    height: 120px;
    margin: 8px;
    border-radius: 16px;
    overflow: hidden;
    border: 2px solid var(--glass-border);
    background: var(--glass-bg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.uploaded-image-item:hover {
    border-color: var(--primary);
    transform: scale(1.05);
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.3);
}

.uploaded-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.uploaded-image-item .remove-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    backdrop-filter: blur(4px);
}

.uploaded-image-item:hover .remove-btn {
    opacity: 1;
}

.uploaded-image-item .remove-btn:hover {
    background: var(--danger);
    transform: scale(1.1);
}

/* Resolution Options */
.resolution-options {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.resolution-option {
    flex: 1;
    min-width: 100px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid var(--glass-border);
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.resolution-option:hover {
    border-color: var(--primary-light);
}

.resolution-option.selected {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.2);
}

.resolution-option .size {
    font-size: 1.2rem;
    font-weight: 700;
}

.resolution-option .credits {
    font-size: 0.85rem;
    color: var(--secondary);
    margin-top: 5px;
}

/* Aspect Ratio Options */
.aspect-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.aspect-option {
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.aspect-option:hover {
    border-color: var(--primary-light);
}

.aspect-option.selected {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.2);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--glass-border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    margin-top: 20px;
    font-size: 1.1rem;
    color: var(--gray);
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 12px;
    color: white;
    font-weight: 500;
    z-index: 1001;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    max-width: 400px;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: linear-gradient(135deg, var(--secondary), #059669);
}

.notification.error {
    background: linear-gradient(135deg, var(--danger), #dc2626);
}

.notification.info {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

/* Result Notifications (in result panels) */
.result-notification {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 15px;
    font-weight: 500;
    font-size: 0.95rem;
    animation: fadeIn 0.3s ease;
}

.result-notification-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 700;
}

.result-notification.success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

.result-notification.success .result-notification-icon {
    background: var(--secondary);
    color: white;
}

.result-notification.error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.result-notification.error .result-notification-icon {
    background: var(--danger);
    color: white;
}

.result-notification-message {
    flex: 1;
}

/* Login Page */
.login-container {
    min-height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px 40px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 40px;
}

.login-card .logo {
    text-align: center;
    margin-bottom: 30px;
    font-size: 2rem;
}

/* Table */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
}

th {
    font-weight: 600;
    color: var(--gray);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* Status Badge */
.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-active {
    background: rgba(16, 185, 129, 0.2);
    color: var(--secondary);
}

.status-inactive {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.status-expired {
    background: rgba(245, 158, 11, 0.2);
    color: var(--accent);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.modal-title {
    font-size: 1.3rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--gray);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: white;
}

/* Sidebar */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    padding: 30px 20px;
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
}

.sidebar-nav {
    flex: 1;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    color: var(--gray);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s ease;
    margin-bottom: 5px;
}

.sidebar-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-link.active {
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.main-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

/* History Table */
.history-table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
}

.history-table {
    width: 100%;
    border-collapse: collapse;
}

.history-table thead {
    background: rgba(0, 0, 0, 0.3);
}

.history-table th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    color: var(--gray);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--glass-border);
}

.history-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--glass-border);
    color: var(--light);
}

.history-table tbody tr {
    transition: all 0.2s ease;
}

.history-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.1);
}

.history-table tbody tr:last-child td {
    border-bottom: none;
}

/* Feature Badge */
.feature-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.feature-create {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-light);
}

.feature-edit {
    background: rgba(245, 158, 11, 0.2);
    color: var(--accent);
}

.feature-design {
    background: rgba(16, 185, 129, 0.2);
    color: var(--secondary);
}

/* History Container */
#history-container {
    min-height: 400px;
}

.history-item-info {
    padding: 12px;
    font-size: 0.85rem;
    color: var(--gray);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

/* QR Code */
.qr-container {
    text-align: center;
    padding: 20px;
}

.qr-container img {
    max-width: 200px;
    border-radius: 12px;
    background: white;
    padding: 10px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

/* ===== ADMIN HEADER NAVIGATION ===== */
.admin-nav {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.admin-nav-link {
    padding: 10px 16px;
    color: var(--gray);
    text-decoration: none;
    border-radius: 10px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.admin-nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.admin-nav-link.active {
    color: white;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
}

.admin-main {
    padding: 30px 0;
}

/* ===== PAGE HEADER ===== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    gap: 15px;
    flex-wrap: wrap;
}

.page-header h1 {
    margin: 0;
}

/* ===== SEARCH FORM ===== */
.search-form {
    display: flex;
    gap: 15px;
    align-items: center;
}

.search-form .form-input {
    flex: 1;
}

/* ===== SITE FOOTER (COPYRIGHT) ===== */
.site-footer {
    text-align: center;
    padding: 30px 20px;
    margin-top: 40px;
    border-top: 1px solid var(--glass-border);
    color: var(--gray);
    font-size: 0.9rem;
}

.site-footer p {
    margin: 0;
}

.site-footer a {
    color: var(--primary-light);
    text-decoration: none;
    transition: color 0.3s ease;
}

.site-footer a:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {

    /* ===== ADMIN SIDEBAR ===== */
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        height: 100%;
        z-index: 100;
        transition: left 0.3s ease;
    }

    .sidebar.open {
        left: 0;
    }

    .main-content {
        padding: 15px;
    }

    /* ===== LAYOUT ===== */
    .container {
        padding: 10px;
    }

    .card {
        padding: 20px;
    }

    /* ===== HEADER ===== */
    .header {
        padding: 15px;
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    /* ===== ADMIN NAV MOBILE ===== */
    .admin-nav {
        order: 3;
        width: 100%;
        justify-content: center;
        gap: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 5px;
    }

    .admin-nav::-webkit-scrollbar {
        display: none;
    }

    .admin-nav-link {
        padding: 10px 14px;
        font-size: 0.85rem;
        flex-shrink: 0;
    }

    .admin-main {
        padding: 20px 0;
    }

    /* ===== PAGE HEADER MOBILE ===== */
    .page-header {
        flex-direction: column;
        align-items: flex-start !important;
        text-align: left;
    }

    .page-header h1 {
        font-size: 1.3rem !important;
        margin-bottom: 15px !important;
        width: 100%;
    }

    .page-header .btn {
        width: 100%;
        justify-content: center;
    }

    /* ===== SEARCH FORM MOBILE ===== */
    .search-form {
        flex-direction: column;
    }

    .search-form .form-input {
        width: 100%;
    }

    .search-form .btn {
        width: 100%;
        justify-content: center;
    }

    .logo {
        text-align: center;
        font-size: 1.1rem;
        justify-content: center;
        width: 100%;
    }

    .logo img {
        height: 32px !important;
    }

    .user-info {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    .credits-badge {
        width: 100%;
        justify-content: center;
        padding: 12px 16px;
        font-size: 1rem;
    }

    .user-info .btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    /* ===== FORM ELEMENTS - Prevent iOS zoom ===== */
    input,
    textarea,
    select,
    .form-input,
    .form-textarea,
    .form-select {
        font-size: 16px !important;
    }

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

    .form-textarea {
        min-height: 100px;
    }

    .form-label {
        font-size: 0.95rem;
        margin-bottom: 10px;
    }

    /* ===== TABS ===== */
    .tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 8px;
        margin-bottom: 20px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 8px;
    }

    .tabs::-webkit-scrollbar {
        display: none;
    }

    .tab {
        white-space: nowrap;
        padding: 12px 18px;
        flex-shrink: 0;
        min-height: 44px;
        font-size: 0.9rem;
    }

    /* ===== TOUCH TARGETS - Min 44px ===== */
    .resolution-option {
        min-height: 60px;
        padding: 12px;
    }

    .resolution-option .size {
        font-size: 1.2rem;
    }

    .aspect-option {
        min-height: 44px;
        padding: 12px 16px;
        font-size: 0.95rem;
    }

    /* ===== UPLOAD AREA ===== */
    .upload-area {
        padding: 30px 20px;
        border-width: 3px;
    }

    .upload-area:active {
        background: rgba(99, 102, 241, 0.2);
        border-color: var(--primary);
        transform: scale(0.98);
    }

    .upload-icon {
        font-size: 2.5rem;
        margin-bottom: 12px;
    }

    .upload-area p {
        font-size: 0.95rem;
    }

    /* ===== UPLOADED IMAGES ===== */
    .uploaded-image-item {
        width: 100px;
        height: 100px;
        margin: 6px;
    }

    .uploaded-image-item .remove-btn {
        opacity: 1;
        width: 28px;
        height: 28px;
        font-size: 18px;
    }

    /* ===== BUTTONS ===== */
    .btn-primary {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
        font-size: 1rem;
    }

    .btn-secondary {
        padding: 12px 16px;
    }

    /* ===== IMAGE PREVIEW ===== */
    .image-preview {
        min-height: 200px;
    }

    .image-preview:has(.uploaded-image-item) {
        min-height: auto;
    }

    .image-preview img {
        max-height: 300px;
    }

    .empty-state {
        padding: 40px 15px;
    }

    .empty-state-icon {
        font-size: 3rem;
    }

    /* ===== LOADING ===== */
    .loading-spinner {
        width: 50px;
        height: 50px;
    }

    .loading-text {
        font-size: 1.1rem;
        margin-top: 15px;
    }

    /* ===== NOTIFICATIONS ===== */
    .notification {
        right: 10px;
        left: 10px;
        max-width: none;
        font-size: 0.95rem;
    }

    /* ===== TABLES ===== */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -20px;
        padding: 0 20px;
    }

    table {
        min-width: 600px;
    }

    th,
    td {
        padding: 12px 10px;
        font-size: 0.9rem;
    }

    /* ===== ADMIN STATS ===== */
    .grid-4 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px;
    }

    .grid-4 .card {
        padding: 15px;
    }

    .grid-4 .card div[style*="font-size: 2rem"] {
        font-size: 1.5rem !important;
    }

    .grid-4 .card div[style*="font-size: 2.5rem"] {
        font-size: 2rem !important;
    }

    /* ===== MODALS ===== */
    .modal {
        width: 95%;
        max-height: 90vh;
        overflow-y: auto;
    }

    .modal-header {
        padding: 15px 20px;
    }

    /* ===== LOGIN PAGE ===== */
    .login-card {
        padding: 25px 20px;
        margin: 10px;
    }

    .login-card .logo {
        font-size: 1.2rem;
    }

    /* ===== MOBILE MENU ===== */
    .menu-toggle {
        display: inline-flex !important;
        align-items: center;
        gap: 8px;
        margin-bottom: 20px;
        background: var(--glass-bg);
        backdrop-filter: blur(20px);
        border: 1px solid var(--glass-border);
        padding: 12px 20px;
        border-radius: 10px;
        color: white;
        font-size: 1rem;
        cursor: pointer;
        transition: all 0.3s ease;
        min-height: 44px;
    }

    .menu-toggle:hover,
    .menu-toggle:active {
        background: rgba(255, 255, 255, 0.15);
    }

    .sidebar-close {
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid var(--glass-border);
        color: white;
        font-size: 1.4rem;
        cursor: pointer;
        padding: 10px 14px;
        border-radius: 8px;
        transition: all 0.3s ease;
        min-width: 44px;
        min-height: 44px;
    }

    .sidebar-close:hover,
    .sidebar-close:active {
        background: rgba(255, 255, 255, 0.2);
    }

    .sidebar-overlay.active {
        display: block;
        opacity: 1;
        visibility: visible;
    }

    /* ===== PAGE TITLES ===== */
    h1 {
        font-size: 1.5rem !important;
    }

    .card-title {
        font-size: 1.1rem;
    }
}

/* Mobile Menu Elements - Hidden by default on desktop */
.menu-toggle {
    display: none !important;
}

.sidebar-close {
    display: none !important;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 90;
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

/* ===================================
   AI COMPLEX STYLES
   =================================== */

.aicomplex-modes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    padding: 15px;
}

.mode-btn {
    padding: 12px 24px;
    background: rgba(30, 27, 75, 0.4);
    border: 2px solid rgba(99, 102, 241, 0.3);
    border-radius: 12px;
    color: #cbd5e1;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    font-size: 0.95rem;
    outline: none;
    white-space: nowrap;
    user-select: none;
}

.mode-btn:hover {
    color: white;
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.mode-btn:active {
    transform: translateY(0);
}

.mode-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-color: transparent;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}

.mode-description {
    color: var(--gray);
    right: 10px;
    left: 10px;
    max-width: none;
    font-size: 0.95rem;
}

/* ===== TABLES ===== */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -20px;
    padding: 0 20px;
}

table {
    min-width: 600px;
}

th,
td {
    padding: 12px 10px;
    font-size: 0.9rem;
}

/* ===== ADMIN STATS ===== */
.grid-4 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 15px;
}

.grid-4 .card {
    padding: 15px;
}

.grid-4 .card div[style*="font-size: 2rem"] {
    font-size: 1.5rem !important;
}

.grid-4 .card div[style*="font-size: 2.5rem"] {
    font-size: 2rem !important;
}

/* ===== MODALS ===== */
.modal {
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 15px 20px;
}

/* ===== LOGIN PAGE ===== */
.login-card {
    padding: 25px 20px;
    margin: 10px;
}

.login-card .logo {
    font-size: 1.2rem;
}

/* ===== MOBILE MENU ===== */
.menu-toggle {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    padding: 12px 20px;
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 44px;
}

.menu-toggle:hover,
.menu-toggle:active {
    background: rgba(255, 255, 255, 0.15);
}

.sidebar-close {
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: white;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 10px 14px;
    border-radius: 8px;
    transition: all 0.3s ease;
    min-width: 44px;
    min-height: 44px;
}

.sidebar-close:hover,
.sidebar-close:active {
    background: rgba(255, 255, 255, 0.2);
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
    visibility: visible;
}

/* ===== PAGE TITLES ===== */
h1 {
    font-size: 1.5rem !important;
}

.card-title {
    font-size: 1.1rem;
}

/* AI Complex feature badge */
.feature-aicomplex {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
}

/* Responsive adjustments for AI Complex */
@media (max-width: 768px) {
    .aicomplex-modes {
        gap: 6px;
        padding: 10px;
    }

    .mode-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
        min-width: 0;
        flex: 1 1 auto;
    }

    /* Make grid single column on mobile */
    #tab-aicomplex .grid-2 {
        grid-template-columns: 1fr;
    }

    /* Adjust form elements for mobile */
    #tab-aicomplex .form-group {
        margin-bottom: 15px;
    }

    #tab-aicomplex .upload-area {
        padding: 30px 20px;
    }

    #tab-aicomplex .aspect-options,
    #tab-aicomplex .resolution-options {
        gap: 8px;
    }

    #tab-aicomplex .aspect-option,
    #tab-aicomplex .resolution-option {
        font-size: 0.85rem;
        padding: 8px 12px;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .aicomplex-modes {
        gap: 5px;
        padding: 8px;
    }

    .mode-btn {
        padding: 6px 10px;
        font-size: 0.75rem;
        white-space: nowrap;
    }

    #tab-aicomplex .card-title {
        font-size: 1.1rem;
    }

    .mode-description {
        font-size: 0.85rem;
    }
}

/* AI Complex feature badge */
.feature-aicomplex {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
}

/* Responsive adjustments for AI Complex */
@media (max-width: 768px) {
    .aicomplex-modes {
        gap: 6px;
        padding: 10px;
    }

    .mode-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
        min-width: 0;
        flex: 1 1 auto;
    }

    /* Make grid single column on mobile */
    #tab-aicomplex .grid-2 {
        grid-template-columns: 1fr;
    }

    /* Adjust form elements for mobile */
    #tab-aicomplex .form-group {
        margin-bottom: 15px;
    }

    #tab-aicomplex .upload-area {
        padding: 30px 20px;
    }

    #tab-aicomplex .aspect-options,
    #tab-aicomplex .resolution-options {
        gap: 8px;
    }

    #tab-aicomplex .aspect-option,
    #tab-aicomplex .resolution-option {
        font-size: 0.85rem;
        padding: 8px 12px;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .aicomplex-modes {
        gap: 5px;
        padding: 8px;
    }

    .mode-btn {
        padding: 6px 10px;
        font-size: 0.75rem;
        white-space: nowrap;
    }

    #tab-aicomplex .card-title {
        font-size: 1.1rem;
    }

    .mode-description {
        font-size: 0.85rem;
    }
}

/* ============================================
   LANDING PAGE SECTIONS
   ============================================ */

/* Section Header */
.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-header h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-header p {
    color: var(--gray);
    font-size: 1.1rem;
}

/* ============================================
   PRICING SECTION
   ============================================ */
.pricing-section {
    max-width: 1200px;
    margin: 0 auto 60px;
    padding: 0 20px;
}

/* Credit Info Box */
.credit-info {
    padding: 25px;
    margin-bottom: 40px;
    text-align: center;
}

.credit-info h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.credit-grid {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.credit-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.credit-item .resolution {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-light);
}

.credit-item .cost {
    color: var(--secondary);
    font-weight: 500;
}

/* Promo Banner */
.promo-banner {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 30px;
    margin-bottom: 40px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(239, 68, 68, 0.1));
    border: 2px solid var(--accent);
    animation: pulse-border 2s ease-in-out infinite;
}

@keyframes pulse-border {

    0%,
    100% {
        border-color: var(--accent);
    }

    50% {
        border-color: var(--danger);
    }
}

.promo-icon {
    font-size: 2.5rem;
}

.promo-content h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 5px;
}

.promo-content p {
    color: var(--light);
    font-size: 0.95rem;
    margin: 0;
}

.promo-content strong {
    color: var(--accent);
}

/* Pricing Cards */
.pricing-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.pricing-card {
    padding: 30px;
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
}

.pricing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.pricing-card.popular {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.pricing-card.enterprise {
    border-color: var(--accent);
    background: rgba(245, 158, 11, 0.05);
}

.popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 6px 20px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.package-badge {
    color: var(--gray);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

.package-price {
    margin-bottom: 10px;
}

.package-price .amount {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--light), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.package-price .currency {
    font-size: 1rem;
    color: var(--gray);
    margin-left: 5px;
}

.package-credits {
    margin-bottom: 10px;
}

.package-credits .credit-count {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--secondary);
}

.package-credits .bonus {
    display: block;
    color: var(--accent);
    font-size: 0.9rem;
    margin-top: 5px;
}

.package-duration {
    color: var(--gray);
    font-size: 0.95rem;
    margin-bottom: 20px;
}

.package-features {
    list-style: none;
    text-align: left;
    margin-bottom: 25px;
}

.package-features li {
    padding: 8px 0;
    color: var(--light);
    font-size: 0.95rem;
    border-bottom: 1px solid var(--glass-border);
}

.package-features li:last-child {
    border-bottom: none;
}

.pricing-card .btn {
    width: 100%;
    justify-content: center;
}

/* Button outline style */
.btn-outline {
    background: transparent;
    color: var(--primary-light);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

/* ============================================
   FEATURES SECTION
   ============================================ */
.features-section {
    max-width: 1200px;
    margin: 0 auto 60px;
    padding: 0 20px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.feature-card {
    padding: 30px;
    text-align: center;
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-light);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--light);
}

.feature-card p {
    color: var(--gray);
    font-size: 0.95rem;
    line-height: 1.7;
}

.feature-card strong {
    color: var(--primary-light);
}

/* ============================================
   FAQ SECTION
   ============================================ */
.faq-section {
    max-width: 800px;
    margin: 0 auto 60px;
    padding: 0 20px;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.faq-item {
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item:hover {
    border-color: var(--primary-light);
}

.faq-question {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: transparent;
    border: none;
    color: var(--light);
    font-size: 1rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
}

.faq-question:hover {
    color: var(--primary-light);
}

.faq-icon {
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--gray);
    transition: transform 0.3s ease;
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
    color: var(--primary-light);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 25px;
}

.faq-item.active .faq-answer {
    max-height: 500px;
    padding: 0 25px 20px;
}

.faq-answer p {
    color: var(--gray);
    line-height: 1.7;
    margin-bottom: 10px;
}

.faq-answer p:last-child {
    margin-bottom: 0;
}

.faq-answer ul {
    list-style: none;
    margin: 10px 0;
}

.faq-answer ul li {
    padding: 5px 0;
    color: var(--gray);
}

.faq-answer strong {
    color: var(--primary-light);
}

/* ============================================
   RESPONSIVE DESIGN FOR LANDING SECTIONS
   ============================================ */
@media (max-width: 1024px) {

    .pricing-cards,
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .section-header h2 {
        font-size: 1.6rem;
    }

    .section-header p {
        font-size: 1rem;
    }

    .pricing-cards,
    .features-grid {
        grid-template-columns: 1fr;
    }

    .pricing-card,
    .feature-card {
        padding: 25px;
    }

    .package-price .amount {
        font-size: 2rem;
    }

    .credit-grid {
        gap: 25px;
    }

    .faq-question {
        padding: 15px 20px;
        font-size: 0.95rem;
    }

    .faq-answer {
        padding: 0 20px;
    }

    .faq-item.active .faq-answer {
        padding: 0 20px 15px;
    }
}

@media (max-width: 480px) {

    .pricing-section,
    .features-section,
    .faq-section {
        margin-bottom: 40px;
    }

    .section-header {
        margin-bottom: 25px;
    }

    .section-header h2 {
        font-size: 1.4rem;
    }

    .pricing-card,
    .feature-card {
        padding: 20px;
    }

    .feature-icon {
        font-size: 2.5rem;
    }

    .feature-card h3 {
        font-size: 1.1rem;
    }

    .feature-card p {
        font-size: 0.9rem;
    }
}