/* ============================================================
   ReelFix - Global Styles
   ============================================================ */

:root {
    --primary: #6C5CE7;
    --primary-light: #A29BFE;
    --primary-dark: #5A4BD1;
    --accent: #00D2D3;
    --accent-light: #55E6C1;
    --bg-dark: #0F0F1A;
    --bg-card: #1A1A2E;
    --bg-card-hover: #222240;
    --bg-input: #16213E;
    --text-primary: #FFFFFF;
    --text-secondary: #A0A0C0;
    --text-muted: #6C6C8A;
    --success: #00D68F;
    --warning: #FFD93D;
    --danger: #FF6B6B;
    --border: rgba(255,255,255,0.08);
    --shadow: 0 4px 24px rgba(0,0,0,0.3);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;

    /* Tier Colors */
    --tier-free: #888;
    --tier-basic: #4ECDC4;
    --tier-pro: #FFD93D;
    --tier-master: #FF6B6B;
}

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

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

a { color: var(--primary-light); text-decoration: none; }
a:hover { color: var(--accent); }

/* ============================================================
   LAYOUT
   ============================================================ */
.page-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.page-header {
    background: linear-gradient(135deg, var(--primary-dark), #2D1B69);
    border-radius: var(--radius);
    padding: 30px 40px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(108,92,231,0.3), transparent);
    border-radius: 50%;
}

.page-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.page-header .subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 4px;
    position: relative;
    z-index: 1;
}

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--bg-card);
    border-radius: var(--radius);
    margin-bottom: 24px;
    border: 1px solid var(--border);
}

.navbar-brand {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-brand span {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.navbar-menu {
    display: flex;
    gap: 8px;
    align-items: center;
}

.navbar-item {
    padding: 8px 16px;
    border-radius: var(--radius-xs);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
}

.navbar-item:hover, .navbar-item.active {
    background: var(--primary);
    color: white;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tier-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.tier-free { background: var(--tier-free); color: white; }
.tier-basic { background: var(--tier-basic); color: #1a1a2e; }
.tier-pro { background: var(--tier-pro); color: #1a1a2e; }
.tier-master { background: var(--tier-master); color: white; }

/* ============================================================
   CARDS
   ============================================================ */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--primary);
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 16px;
}

.card-icon.purple { background: rgba(108,92,231,0.2); }
.card-icon.cyan { background: rgba(0,210,211,0.2); }
.card-icon.yellow { background: rgba(255,217,61,0.2); }
.card-icon.red { background: rgba(255,107,107,0.2); }
.card-icon.green { background: rgba(0,214,143,0.2); }

.card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.card p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.card .card-value {
    font-size: 1.8rem;
    font-weight: 800;
    margin-top: 8px;
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ============================================================
   STAT BANNER
   ============================================================ */
.stat-banner {
    background: linear-gradient(135deg, #1B1464, #2D1B69, #5B2C8E);
    border-radius: var(--radius);
    padding: 32px 40px;
    margin-bottom: 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.stat-banner::after {
    content: '';
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 200px;
    background: radial-gradient(ellipse, rgba(108,92,231,0.2), transparent);
}

.stat-banner .label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.stat-banner .value {
    font-size: 3rem;
    font-weight: 900;
    position: relative;
    z-index: 1;
}

.stat-banner .value span {
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--text-secondary);
}

/* ============================================================
   PREMIUM BANNER (Points / Earnings pages)
   ============================================================ */
.premium-banner {
    position: relative;
    background: linear-gradient(135deg, #0D0B21 0%, #1B1464 30%, #2D1B69 60%, #5B2C8E 100%);
    border-radius: var(--radius);
    padding: 36px 40px 32px;
    margin-bottom: 24px;
    overflow: hidden;
    border: 1px solid rgba(108,92,231,0.25);
}

.premium-banner-glow {
    position: absolute;
    top: -60%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(108,92,231,0.25) 0%, rgba(0,210,211,0.08) 50%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.premium-banner-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 32px;
}

.premium-stat-main {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-shrink: 0;
}

.premium-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    margin-right: 4px;
}

.premium-value {
    font-size: 3rem;
    font-weight: 900;
    background: linear-gradient(135deg, #fff 30%, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
}

.premium-unit {
    font-size: 1.2rem;
    color: var(--text-muted);
    font-weight: 400;
}

.premium-divider {
    width: 1px;
    height: 48px;
    background: rgba(255,255,255,0.12);
    flex-shrink: 0;
}

.premium-stat-row {
    display: flex;
    gap: 28px;
}

.premium-stat-sub {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.premium-sub-label {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.premium-sub-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.premium-sub-value.accent {
    color: var(--accent);
}

/* Summary Cards */
.summary-card {
    text-align: center;
    padding: 20px 16px !important;
}

.summary-card:hover {
    transform: none;
    cursor: default !important;
}

.summary-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin: 0 auto 10px;
}

.summary-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.summary-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* KYC Info Rows */
.kyc-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-dark);
    border-radius: var(--radius-xs);
    margin-bottom: 6px;
}

.kyc-label {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.kyc-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ============================================================
   STUDIO
   ============================================================ */
.studio-new-card {
    text-align: center;
    transition: all 0.3s;
}

.studio-new-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
}

.studio-project-card {
    cursor: pointer;
    margin-bottom: 12px;
    transition: all 0.2s;
}

.studio-project-card:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
}

/* ============================================================
   VOICE SELECTOR
   ============================================================ */
.voice-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.voice-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--bg-dark);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.voice-card:hover {
    border-color: var(--primary);
    background: var(--bg-card-hover);
}

.voice-card.selected {
    border-color: var(--accent);
    background: rgba(0,210,211,0.08);
}

.voice-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
}

.voice-info {
    min-width: 0;
}

.voice-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.voice-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.voice-preview-btn {
    padding: 4px 8px !important;
    font-size: 0.7rem !important;
    flex-shrink: 0;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.voice-card:hover .voice-preview-btn {
    opacity: 1;
}

@media (max-width: 768px) {
    .voice-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .voice-card {
        padding: 10px 12px;
    }
    .voice-name {
        font-size: 0.82rem;
    }
    .voice-desc {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .voice-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   FORMS
   ============================================================ */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.form-control:focus {
    border-color: var(--primary);
}

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

select.form-control {
    cursor: pointer;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(108,92,231,0.4);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent), #00B4D8);
    color: #0F0F1A;
}

.btn-success {
    background: var(--success);
    color: #0F0F1A;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}
.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary-light);
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.8rem;
}

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

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================================
   TABLES
   ============================================================ */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

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

th {
    background: rgba(255,255,255,0.03);
    padding: 14px 16px;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    padding: 14px 16px;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
}

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

/* ============================================================
   STATUS BADGES
   ============================================================ */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-open { background: rgba(0,214,143,0.15); color: var(--success); }
.badge-pending { background: rgba(255,217,61,0.15); color: var(--warning); }
.badge-progress { background: rgba(108,92,231,0.15); color: var(--primary-light); }
.badge-completed { background: rgba(0,210,211,0.15); color: var(--accent); }
.badge-rejected { background: rgba(255,107,107,0.15); color: var(--danger); }

/* ============================================================
   REFERRAL LINK BOX
   ============================================================ */
.referral-box {
    background: linear-gradient(135deg, rgba(0,214,143,0.1), rgba(0,210,211,0.1));
    border: 1px solid rgba(0,214,143,0.3);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
}

.referral-box h3 {
    color: var(--accent-light);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.referral-link-wrapper {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.referral-link-wrapper input {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.referral-link-wrapper .btn {
    white-space: nowrap;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    display: none;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal h2 {
    margin-bottom: 20px;
}

/* ============================================================
   AUTH PAGES
   ============================================================ */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
    width: 100%;
    max-width: 440px;
}

.auth-box h1 {
    text-align: center;
    margin-bottom: 8px;
    font-size: 1.6rem;
}

.auth-box .subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-size: 0.9rem;
}

.auth-divider {
    text-align: center;
    color: var(--text-muted);
    margin: 20px 0;
    font-size: 0.85rem;
}

/* ============================================================
   TOOL PAGES (Task / AI)
   ============================================================ */
.tool-container {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 24px;
    min-height: calc(100vh - 200px);
}

.tool-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.tool-preview {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    position: sticky;
    top: 20px;
}

.preview-frame {
    background: #000;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 16px;
}

.preview-frame.portrait {
    aspect-ratio: 9/16;
    max-height: 600px;
}

.preview-frame.landscape {
    aspect-ratio: 16/9;
}

.step-indicator {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.step {
    flex: 1;
    padding: 12px;
    text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.3s;
}

.step.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.step.completed {
    background: rgba(0,214,143,0.15);
    border-color: var(--success);
    color: var(--success);
}

.step:hover {
    opacity: 0.85;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Scene Cards */
.scene-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 12px;
}

.scene-card .scene-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.scene-card .scene-number {
    font-weight: 700;
    color: var(--primary-light);
}

.scene-card .upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 30px;
    text-align: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.scene-card .upload-zone:hover {
    border-color: var(--primary);
    color: var(--primary-light);
}

.scene-card .upload-zone.has-file {
    border-color: var(--success);
    background: rgba(0,214,143,0.05);
}

/* Subtitle Settings */
.subtitle-settings {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.color-picker-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.color-picker-row input[type="color"] {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: none;
}

.range-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.range-row input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    height: 6px;
    background: var(--bg-input);
    border-radius: 3px;
    outline: none;
}

.range-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
}

.range-row .value {
    min-width: 40px;
    text-align: right;
    font-weight: 600;
    color: var(--primary-light);
}

/* ============================================================
   PRICING SECTION
   ============================================================ */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 40px 0;
}

.pricing-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    text-align: center;
    transition: all 0.3s;
}

.pricing-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.pricing-card.featured {
    border-color: var(--primary);
    position: relative;
}

.pricing-card.featured::before {
    content: 'POPULAR';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
}

.pricing-card .tier-name {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.pricing-card .price {
    font-size: 2.2rem;
    font-weight: 900;
    margin: 16px 0;
}

.pricing-card .price small {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text-muted);
}

.pricing-card .features {
    list-style: none;
    text-align: left;
    margin: 20px 0;
}

.pricing-card .features li {
    padding: 8px 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pricing-card .features li::before {
    content: '✓';
    color: var(--success);
    font-weight: 700;
}

.pricing-card .features li.disabled {
    color: var(--text-muted);
    text-decoration: line-through;
}

.pricing-card .features li.disabled::before {
    content: '✗';
    color: var(--danger);
}

/* ============================================================
   LOADING
   ============================================================ */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 40px;
    color: var(--text-muted);
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    animation: slideIn 0.3s ease;
    min-width: 300px;
}

.toast-success { background: var(--success); color: #0F0F1A; }
.toast-error { background: var(--danger); color: white; }
.toast-info { background: var(--primary); color: white; }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ============================================================
   RESPONSIVE UTILITY CLASSES
   ============================================================ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.flex-col-mobile { display: flex; gap: 12px; }
.flex-wrap-mobile { display: flex; flex-wrap: wrap; gap: 8px; }

/* Mobile Hamburger */
.navbar-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text-primary);
    padding: 8px 12px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
}
.navbar-toggle:hover { border-color: var(--primary); }

/* ============================================================
   RESPONSIVE - TABLET (≤ 1024px)
   ============================================================ */
@media (max-width: 1024px) {
    .page-wrapper {
        padding: 16px;
    }

    .tool-container {
        grid-template-columns: 1fr;
    }

    .tool-preview {
        position: static;
    }

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

    .pricing-grid {
        grid-template-columns: 1fr;
        max-width: 500px;
        margin-left: auto;
        margin-right: auto;
    }

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

    .stat-banner .value {
        font-size: 2.2rem;
    }

    .premium-banner {
        padding: 28px 30px;
    }

    .premium-value {
        font-size: 2.4rem;
    }

    .premium-stat-row {
        gap: 20px;
    }

    .page-header {
        padding: 24px 28px;
    }

    .page-header h1 {
        font-size: 1.5rem;
    }
}

/* ============================================================
   RESPONSIVE - MOBILE (≤ 768px)
   ============================================================ */
@media (max-width: 768px) {
    .page-wrapper {
        padding: 12px;
    }

    /* Navbar - hamburger */
    .navbar {
        flex-wrap: wrap;
        padding: 12px 16px;
        gap: 0;
    }

    .navbar-toggle {
        display: block;
    }

    .navbar-menu {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 4px;
        padding-top: 12px;
        margin-top: 12px;
        border-top: 1px solid var(--border);
    }

    .navbar-menu.open {
        display: flex;
    }

    .navbar-item {
        padding: 10px 16px;
        text-align: center;
        border-radius: var(--radius-xs);
    }

    .navbar-user {
        display: none;
        width: 100%;
        justify-content: center;
        padding-top: 12px;
        margin-top: 4px;
        border-top: 1px solid var(--border);
        flex-wrap: wrap;
    }

    .navbar-user.open {
        display: flex;
    }

    .navbar-brand {
        flex: 1;
    }

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

    .card-grid {
        grid-template-columns: 1fr;
    }

    .tool-container {
        grid-template-columns: 1fr;
    }

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

    .feature-grid {
        grid-template-columns: 1fr;
    }

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

    /* Cards */
    .card {
        padding: 18px;
    }

    .card h3 {
        font-size: 1rem;
    }

    .card .card-value {
        font-size: 1.4rem;
    }

    .card-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
        margin-bottom: 12px;
    }

    /* Page Header */
    .page-header {
        padding: 20px 20px;
        margin-bottom: 16px;
        border-radius: var(--radius-sm);
    }

    .page-header h1 {
        font-size: 1.3rem;
    }

    .page-header .subtitle {
        font-size: 0.82rem;
    }

    /* Stat Banner */
    .stat-banner {
        padding: 20px;
        border-radius: var(--radius-sm);
        margin-bottom: 16px;
    }

    .stat-banner .value {
        font-size: 2rem;
    }

    .stat-banner .value span {
        font-size: 1rem;
    }

    /* Premium Banner Mobile */
    .premium-banner {
        padding: 20px;
        border-radius: var(--radius-sm);
        margin-bottom: 16px;
    }

    .premium-banner-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .premium-value {
        font-size: 2rem;
    }

    .premium-divider {
        width: 100%;
        height: 1px;
    }

    .premium-stat-row {
        width: 100%;
        justify-content: space-between;
    }

    .premium-sub-value {
        font-size: 1.1rem;
    }

    /* Buttons */
    .btn {
        padding: 10px 18px;
        font-size: 0.88rem;
    }

    .btn-lg {
        padding: 14px 24px;
        font-size: 1rem;
    }

    .btn-sm {
        padding: 7px 12px;
        font-size: 0.75rem;
    }

    /* Forms */
    .form-control {
        padding: 10px 14px;
        font-size: 0.9rem;
    }

    /* Tables */
    table {
        font-size: 0.82rem;
    }

    th, td {
        padding: 10px 12px;
        white-space: nowrap;
    }

    /* Referral Box */
    .referral-box {
        padding: 18px;
    }

    .referral-link-wrapper {
        flex-direction: column;
    }

    .referral-link-wrapper .btn {
        width: 100%;
        justify-content: center;
    }

    /* Flex utilities mobile */
    .flex-col-mobile {
        flex-direction: column;
    }

    /* Steps */
    .step-indicator {
        gap: 4px;
    }

    .step {
        padding: 8px 4px;
        font-size: 0.7rem;
    }

    /* Modal */
    .modal {
        padding: 24px 18px;
        width: 95%;
    }

    .user-detail-box {
        padding: 24px 18px;
        width: 95%;
        max-height: 90vh;
    }

    /* Toast */
    .toast-container {
        left: 12px;
        right: 12px;
        top: 12px;
    }

    .toast {
        min-width: auto;
        font-size: 0.85rem;
    }

    /* Admin tab bar */
    .tab-bar {
        gap: 4px;
    }

    .tab-btn {
        padding: 8px 12px;
        font-size: 0.78rem;
        flex: 1;
        text-align: center;
        min-width: 0;
    }

    /* Admin stat */
    .admin-stat {
        padding: 14px 10px;
    }

    .admin-stat .val {
        font-size: 1.3rem;
    }

    .admin-stat .label {
        font-size: 0.72rem;
    }

    /* Scene cards */
    .scene-card {
        padding: 16px;
    }

    .scene-card .upload-zone {
        padding: 20px;
    }

    /* Preview */
    .preview-frame.portrait {
        max-height: 400px;
    }

    /* Empty state */
    .empty-state {
        padding: 40px 16px;
    }

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

    /* Pricing card mobile */
    .pricing-card {
        padding: 24px;
    }

    .pricing-card .price {
        font-size: 1.8rem;
    }
}

/* ============================================================
   RESPONSIVE - SMALL MOBILE (≤ 480px)
   ============================================================ */
@media (max-width: 480px) {
    .page-wrapper {
        padding: 8px;
    }

    .navbar {
        padding: 10px 12px;
        border-radius: var(--radius-sm);
        margin-bottom: 16px;
    }

    .navbar-brand {
        font-size: 1.1rem;
    }

    .page-header {
        padding: 16px;
    }

    .page-header h1 {
        font-size: 1.15rem;
    }

    .card {
        padding: 14px;
        border-radius: var(--radius-sm);
    }

    .stat-banner {
        padding: 16px;
    }

    .stat-banner .value {
        font-size: 1.6rem;
    }

    .premium-banner {
        padding: 16px;
    }

    .premium-value {
        font-size: 1.6rem;
    }

    .premium-sub-value {
        font-size: 1rem;
    }

    .summary-card {
        padding: 14px 12px !important;
    }

    .summary-value {
        font-size: 1rem;
    }

    .admin-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .admin-stat {
        padding: 10px 8px;
    }

    .admin-stat .val {
        font-size: 1.1rem;
    }

    .tab-bar {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }

    .tab-btn {
        flex: none;
        white-space: nowrap;
        padding: 8px 14px;
    }

    .btn {
        padding: 9px 14px;
        font-size: 0.82rem;
    }

    .grid-2, .grid-3, .grid-4 {
        gap: 12px;
    }

    .card-grid {
        gap: 12px;
    }

    th, td {
        padding: 8px 10px;
        font-size: 0.78rem;
    }

    .tier-badge {
        padding: 3px 8px;
        font-size: 0.68rem;
    }

    .badge {
        padding: 3px 8px;
        font-size: 0.68rem;
    }
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 3px;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state .icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--text-secondary);
}
