/* ==========================================================================
   SHORTS AGENT DESIGN SYSTEM & TRANSITIONS
   ========================================================================== */

:root {
    /* Fonts */
    --font-primary: 'Inter', sans-serif;
    --font-heading: 'Outfit', sans-serif;

    /* Theme-independent Gradients & Colors */
    --pink: #FF007A;
    --purple: #7928CA;
    --orange: #FF4D4D;
    --yellow: #F9CB28;
    --cyan: #00F0FF;
    --green: #10B981;
    --red: #EF4444;
    --text-gradient-pink: linear-gradient(135deg, #FF007A 0%, #7928CA 100%);
    --text-gradient-orange: linear-gradient(135deg, #FF4D4D 0%, #F9CB28 100%);
    
    /* Layout Sizes */
    --navbar-height: 70px;
    --mobile-nav-height: 60px;
}

/* --- Default LIGHT THEME variables (Home/Landing Page context) --- */
body.theme-light {
    --bg-base: #FAF9F6;
    --bg-surface: #FFFFFF;
    --bg-glass: rgba(255, 255, 255, 0.7);
    --border-subtle: #E2E8F0;
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #64748B;
    --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
    --navbar-bg: rgba(250, 249, 246, 0.8);
    --btn-outline-hover: #F1F5F9;
}

/* --- Default DARK THEME variables (Platform / Dashboard context) --- */
body.theme-dark {
    --bg-base: #0B0C0E;
    --bg-surface: #121318;
    --bg-glass: rgba(18, 19, 24, 0.75);
    --border-subtle: rgba(255, 255, 255, 0.06);
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    --card-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.4);
    --navbar-bg: rgba(11, 12, 14, 0.85);
    --btn-outline-hover: rgba(255, 255, 255, 0.03);
}

/* Reset & Base Elements */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
    line-height: 1.5;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.5px;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Utilities */
.text-gradient {
    background: var(--text-gradient-pink);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}
.text-gradient-pink {
    background: var(--text-gradient-pink);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.text-gradient-orange {
    background: var(--text-gradient-orange);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.text-muted { color: var(--text-muted) !important; }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-red { color: var(--red) !important; }
.text-green { color: var(--green) !important; }
.text-pink { color: var(--pink) !important; }
.text-orange { color: var(--orange) !important; }
.font-bold { font-weight: 700; }
.w-100 { width: 100%; }
.mt-05 { margin-top: 0.5rem; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }
.divider { border: 0; border-top: 1px solid var(--border-subtle); margin: 1.5rem 0; }
.glass-effect {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

/* Layout containers */
.app-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.content-view-port {
    flex: 1;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding-top: var(--navbar-height);
    display: flex;
    flex-direction: column;
}

/* Section Router animation styles */
.view-section {
    display: none; /* Hide non-active views */
    width: 100%;
    margin: 0;
    padding: 0;
    top: 0;
    animation: slideIn 0.3s ease-out forwards;
}

.view-section.active {
    display: block;
}
/* Views use default layout container padding */

@keyframes slideIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   NAVIGATION HEADERS
   ========================================================================== */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--navbar-height);
    background: var(--navbar-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 1000;
    transition: background-color 0.3s, border-bottom 0.3s;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 1.4rem;
    font-family: var(--font-heading);
    font-weight: 800;
}

.logo-icon {
    font-size: 1.6rem;
    color: var(--pink);
}

.animate-spin-slow {
    animation: spin 8s linear infinite;
}

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

.nav-menu {
    display: flex;
    gap: 1.5rem;
}

.nav-item {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    transition: all 0.2s;
}

.nav-item:hover, .nav-item.active {
    color: var(--text-primary);
    background: var(--btn-outline-hover);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Button styles */
button {
    font-family: var(--font-primary);
    cursor: pointer;
    outline: none;
}

.icon-toggle-btn, .icon-logout-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.icon-toggle-btn:hover, .icon-logout-btn:hover {
    background: var(--btn-outline-hover);
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
}

.btn-gradient {
    background: var(--text-gradient-pink);
    border: none;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(255, 0, 122, 0.15);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-gradient:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255, 0, 122, 0.25);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    transition: background-color 0.2s;
}

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

.btn-large {
    padding: 0.8rem 1.8rem;
    font-size: 1rem;
}

.btn-red {
    background: var(--red) !important;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.15);
}
.btn-red:hover {
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.25);
}

/* User avatar header widget */
.profile-header-widget {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--btn-outline-hover);
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    border: 1px solid var(--border-subtle);
}

.header-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

.profile-header-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.header-username {
    font-size: 0.85rem;
    font-weight: 600;
}

.header-plan-badge {
    font-size: 0.65rem;
    color: var(--pink);
    font-weight: 700;
    text-transform: uppercase;
}

/* ==========================================================================
   1. LANDING PAGE & PRICING
   ========================================================================== */

.hero-container {
    text-align: center;
    padding: 5rem 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.hero-badge {
    background: var(--btn-outline-hover);
    border: 1px solid var(--border-subtle);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: inline-block;
    margin-bottom: 1.5rem;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.hero-ctas {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    padding: 2rem;
    margin-bottom: 4rem;
}

.stat-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    position: relative;
    box-shadow: var(--card-shadow);
}

.stat-box h3 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.stat-box p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
}

.box-icon {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.2rem;
    color: var(--text-muted);
    opacity: 0.4;
}

/* Features grid details */
.features-wrapper {
    padding: 3rem 2rem;
    text-align: center;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
}

.section-heading {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.section-subheading {
    font-size: 1.05rem;
    margin-bottom: 3rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
    max-width: 1000px;
    margin: 0 auto;
    text-align: left;
}

.feature-item {
    display: flex;
    gap: 1.25rem;
}

.feature-icon {
    width: 48px;
    height: 48px;
    background: var(--btn-outline-hover);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--pink);
    flex-shrink: 0;
}

.feature-item h4 {
    font-size: 1.15rem;
    margin-bottom: 0.4rem;
}

.feature-item p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Pricing Grid sections */
.pricing-wrapper {
    padding: 5rem 2rem;
}

.pricing-header {
    text-align: center;
    margin-bottom: 3rem;
}

.pricing-toggle-group {
    display: inline-flex;
    align-items: center;
    background: var(--btn-outline-hover);
    border: 1px solid var(--border-subtle);
    padding: 0.25rem;
    border-radius: 25px;
    margin-top: 1.5rem;
    position: relative;
}

.toggle-btn {
    background: none;
    border: none;
    padding: 0.5rem 1.2rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.toggle-btn.active {
    background: var(--bg-surface);
    color: var(--text-primary);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.save-badge {
    position: absolute;
    top: -12px;
    right: -75px;
    background: var(--pink);
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.25rem 0.5rem;
    border-radius: 10px;
    text-transform: uppercase;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    max-width: 1100px;
    margin: 0 auto;
}

.price-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    position: relative;
    box-shadow: var(--card-shadow);
}

.price-card.popular {
    border: 2px solid var(--pink);
    transform: scale(1.02);
}

.popular-ribbon {
    position: absolute;
    top: 12px;
    right: 15px;
    background: var(--pink);
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.25rem 0.5rem;
    border-radius: 10px;
}

.card-tier {
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.card-price {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
}

.price-sub {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
}

.plan-features {
    list-style: none;
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.plan-features li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ==========================================================================
   2. DASHBOARD VIEW & MAPS
   ========================================================================== */

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 2rem;
    border-bottom: 1px solid var(--border-subtle);
    flex-wrap: wrap;
    gap: 1.5rem;
}

.upload-studio-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-subtle);
}

/* Per-Clip Editing Controls */
.per-clip-controls {
    background: var(--bg-deep);
    border-radius: 0 0 8px 8px;
}

.per-clip-controls .control-row {
    margin-bottom: 4px;
}

.clip-pitch-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    outline: none;
}

.clip-pitch-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--pink);
    cursor: pointer;
}

.clip-pitch-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--pink);
    cursor: pointer;
}

/* Custom dropdown widgets */
.dropdown-container {
    position: relative;
}

.dropdown-trigger {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 0.5rem 1rem;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.2s;
}

.dropdown-trigger:hover {
    background: var(--btn-outline-hover);
}

.channel-icon-sm {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.dropdown-menu {
    position: absolute;
    top: 110%;
    right: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 0.5rem;
    min-width: 220px;
    box-shadow: var(--card-shadow);
    z-index: 100;
    display: none;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    background: none;
    border: none;
    width: 100%;
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-radius: 8px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.2s;
}

.dropdown-item:hover {
    background: var(--btn-outline-hover);
    color: var(--text-primary);
}

/* Dashboard Statistics Cards Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    padding: 2rem;
}

.metric-card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 600;
}

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

.card-middle {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin: 0.5rem 0;
}

.card-middle h2 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.trend-indicator {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.trend-up {
    background: rgba(16, 185, 129, 0.1);
    color: var(--green);
}

.trend-down {
    background: rgba(239, 68, 68, 0.1);
    color: var(--red);
}

.card-desc {
    font-size: 0.75rem;
}

/* Graphs and Map grids section */
.analytics-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    padding: 0 2rem 2rem 2rem;
}

.graph-card, .map-card {
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
}

.card-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.graph-filters {
    display: flex;
    gap: 0.4rem;
    background: var(--bg-base);
    padding: 0.25rem;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
}

.filter-tab {
    background: none;
    border: none;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.filter-tab.active {
    background: var(--bg-surface);
    color: var(--text-primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.chart-canvas-wrapper {
    flex: 1;
    position: relative;
    width: 100%;
    min-height: 250px;
}

/* Map specific styles */
.map-svg-viewport {
    flex: 1;
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    overflow: hidden;
    padding: 1rem;
}

body.theme-dark .map-svg-viewport {
    background: rgba(255, 255, 255, 0.02);
}

#world-svg-map {
    width: 100%;
    height: auto;
    max-height: 250px;
}

.map-land {
    fill: #CCCCCC;
    transition: fill 0.2s;
    cursor: pointer;
}

body.theme-dark .map-land {
    fill: #27272A;
}

.map-land:hover {
    fill: #A1A1AA;
}

body.theme-dark .map-land:hover {
    fill: #4B5563;
}

.map-dynamic-pin {
    fill: var(--pink);
    cursor: pointer;
    filter: drop-shadow(0 0 4px var(--pink));
}

.pulse-animation {
    animation: mapPulse 2s infinite;
}

@keyframes mapPulse {
    0% { r: 5px; fill-opacity: 1; }
    100% { r: 18px; fill-opacity: 0; }
}

.map-floating-popup {
    position: absolute;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    box-shadow: var(--card-shadow);
    z-index: 10;
    pointer-events: none;
    font-size: 0.75rem;
    line-height: 1.3;
}

.popup-title {
    font-weight: 700;
}

.popup-value {
    color: var(--pink);
    font-weight: 600;
}

/* Bottom activities sections */
.dashboard-bottom-grid {
    padding: 0 2rem 2rem 2rem;
}

.content-table-wrapper {
    padding: 1.5rem;
}

.content-table-wrapper h3 {
    margin-bottom: 1rem;
}

.table-container {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.875rem;
    white-space: nowrap;
}

.data-table th {
    border-bottom: 1px solid var(--border-subtle);
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    font-weight: 600;
}

.data-table td {
    border-bottom: 1px solid var(--border-subtle);
    padding: 0.75rem 1rem;
}

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

/* ==========================================================================
   3. CONTENT LIBRARY VIEW
   ========================================================================== */

.search-filter-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 0 1rem;
    height: 38px;
    min-width: 250px;
}

.search-box i {
    color: var(--text-muted);
    margin-right: 0.5rem;
}

.search-box input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-primary);
    width: 100%;
    font-size: 0.85rem;
}

.select-field {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 0 1rem;
    height: 38px;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.25rem;
    padding: 2rem;
}

@media (min-width: 1200px) {
    .content-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

.video-library-card {
    overflow: hidden;
    max-width: 220px;
    margin: 0 auto;
}

.video-thumbnail-wrapper {
    position: relative;
    aspect-ratio: 9/16;
    background: #000;
    overflow: hidden;
    border-radius: 12px;
}

.video-thumbnail-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.video-library-card:hover .video-thumbnail-img {
    transform: scale(1.03);
}

.video-duration-tag {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

.video-meta-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.video-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.8em;
}

.status-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    display: inline-block;
    width: fit-content;
}

.badge-published { background: rgba(16, 185, 129, 0.1); color: var(--green); }
.badge-scheduled { background: rgba(249, 203, 40, 0.1); color: var(--yellow); }
.badge-draft { background: rgba(100, 116, 139, 0.1); color: var(--text-secondary); }
.badge-uploading { background: rgba(0, 240, 255, 0.1); color: var(--cyan); }

.video-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-subtle);
    padding-top: 0.75rem;
    margin-top: 0.5rem;
    text-align: center;
}

.video-stats-grid div {
    display: flex;
    flex-direction: column;
}

.video-stats-grid span {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.85rem;
}

/* ==========================================================================
   4. STUDIO / CREATOR SECTION
   ========================================================================== */

.create-subview-wrapper {
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.studio-card {
    padding: 2rem;
    margin: 0 2rem 2rem 2rem;
}

.studio-inputs-row {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.url-input-group {
    flex: 1;
    display: flex;
    align-items: center;
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 0 1rem;
    height: 44px;
}

.url-input-group input {
    background: none;
    border: none;
    width: 100%;
    height: 100%;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.9rem;
    outline: none;
}

.input-icon {
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

.studio-inputs-row select {
    height: 44px;
}

.studio-inputs-row button {
    height: 44px;
}

.advanced-studio-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    border-top: 1px solid var(--border-subtle);
    padding-top: 1rem;
}

/* Switch styling */
.switch-container {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch-container input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-subtle);
    transition: .3s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .3s;
}

input:checked + .slider {
    background: var(--text-gradient-pink);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

.slider.round {
    border-radius: 24px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Progress Status bar panels */
.status-panel-card {
    padding: 1.5rem;
    margin: 0 2rem 2rem 2rem;
}

.status-meta-flex {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.timer-countdown {
    font-size: 1.2rem;
    font-family: var(--font-heading);
}

.render-progress-container {
    width: 100%;
    height: 8px;
    background: var(--bg-base);
    border-radius: 4px;
    overflow: hidden;
}

.render-progress-fill {
    width: 0%;
    height: 100%;
    background: var(--text-gradient-pink);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Preview generated clips */
.preview-clips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    padding: 0 2rem 2rem 2rem;
}

.clip-gen-card {
    position: relative;
    overflow: hidden;
}

.clip-mock-video {
    width: 100%;
    aspect-ratio: 9/16;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    position: relative;
    border-radius: 12px 12px 0 0;
}

.clip-check-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 5;
}

.clip-checkbox {
    width: 22px;
    height: 22px;
    accent-color: var(--cyan);
    cursor: pointer;
}

.clip-caption-glow {
    position: absolute;
    bottom: 25px;
    left: 0;
    width: 100%;
    text-align: center;
    padding: 0.5rem;
    font-weight: 800;
    color: var(--yellow);
    font-size: 0.85rem;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.9), 0 0 10px var(--yellow);
    letter-spacing: 0.5px;
    pointer-events: none;
}

/* Side by Side Upload Workspace */
.upload-studio-workspace {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    padding: 0 2rem;
}

@media (min-width: 1200px) {
    .upload-studio-workspace {
        grid-template-columns: repeat(5, 1fr);
    }
}

.upload-column-card {
    width: 100%;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
}

.upload-column-card .studio-input-group {
    margin-bottom: 0.5rem;
}

.upload-column-card .studio-input-group label {
    font-size: 0.65rem;
    margin-bottom: 0.2rem;
}

.upload-column-card .input-field {
    padding: 0.4rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 6px;
}

.upload-column-card .textarea-field {
    min-height: 48px;
    font-size: 0.75rem;
}

.upload-column-card .btn-outline {
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
    border-radius: 6px;
}

.upload-video-box {
    aspect-ratio: 9/16;
    max-width: 130px;
    margin: 0 auto 0.75rem auto;
    background: #000;
    border-radius: 8px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.upload-video-box video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.studio-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1rem;
}

.studio-input-group label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
}

.input-field {
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.85rem;
    outline: none;
    width: 100%;
}

.input-field:focus {
    border-color: var(--pink);
}

.select-field {
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 0.5rem 0.6rem;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23888'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    padding-right: 1.8rem;
}

.select-field:focus {
    border-color: var(--pink);
}

.upload-column-card .select-field {
    padding: 0.35rem 0.45rem;
    font-size: 0.75rem;
    border-radius: 6px;
    padding-right: 1.5rem;
    background-position: right 0.4rem center;
}

.textarea-field {
    min-height: 80px;
    resize: none;
}

.time-row-flex {
    display: flex;
    gap: 0.5rem;
}

.studio-bottom-actions {
    display: flex;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-subtle);
}

/* Automation toggle header switch */
.toggle-switch-container {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.toggle-switch-checkbox {
    display: none;
}

.toggle-switch-slider {
    width: 50px;
    height: 26px;
    background-color: var(--border-subtle);
    border-radius: 20px;
    position: relative;
    transition: background-color 0.2s;
}

.toggle-switch-slider::before {
    content: "";
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    position: absolute;
    top: 3px;
    left: 3px;
    transition: transform 0.2s;
}

.toggle-switch-checkbox:checked + .toggle-switch-slider {
    background: var(--text-gradient-pink);
}

.toggle-switch-checkbox:checked + .toggle-switch-slider::before {
    transform: translateX(24px);
}

.toggle-switch-label {
    font-size: 0.85rem;
    font-weight: 700;
}

/* ==========================================================================
   5. SETTINGS / ACCOUNT
   ========================================================================== */

.account-settings-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    padding: 2rem;
}

.settings-sidebar {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.settings-menu-tab {
    background: none;
    border: none;
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    text-align: left;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s;
}

.settings-menu-tab:hover {
    background: var(--btn-outline-hover);
    color: var(--text-primary);
}

.settings-menu-tab.active {
    background: rgba(255, 0, 122, 0.1);
    color: var(--pink);
    font-weight: 700;
}

.settings-menu-tab.text-red.active {
    background: rgba(239, 68, 68, 0.1);
    color: var(--red);
}

.settings-main-card {
    padding: 2.5rem;
}

.settings-tab-panel {
    display: none;
    animation: fadeIn 0.2s ease-out forwards;
}

.settings-tab-panel.active {
    display: block;
}

/* Avatar setting styles */
.avatar-flex {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.settings-avatar-large {
    width: 64px;
    height: 64px;
    border-radius: 50%;
}

.api-key-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.icon-toggle-field {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
}

.usage-bar-card {
    padding: 1.25rem;
}

.usage-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

.usage-progress-container {
    width: 100%;
    height: 8px;
    background: var(--bg-base);
    border-radius: 4px;
    overflow: hidden;
}

.usage-progress-fill {
    height: 100%;
    background: var(--cyan);
    border-radius: 4px;
    transition: width 0.3s;
}

.plan-info-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.connected-channel-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
}

.channel-info-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.channel-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.channel-titles-vertical {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.channel-username-text {
    font-size: 0.85rem;
    font-weight: 600;
}

.channel-url-text {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.btn-remove-channel {
    background: none;
    border: none;
    color: var(--text-muted);
    transition: color 0.2s;
}

.btn-remove-channel:hover {
    color: var(--red);
}

/* ==========================================================================
   MODALS, TOASTS & MOBILE LAYOUT OVERRIDES (Phone Fit Fix)
   ========================================================================== */

/* Sign-in Modals */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease-out;
}

.modal-panel {
    width: 90%;
    max-width: 400px;
    padding: 2.5rem 2rem;
}

.modal-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    font-size: 1.5rem;
}

/* Toast Container & Notification styles */
.toast-container {
    position: fixed;
    top: 85px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 9999;
    pointer-events: none;
    align-items: center;
}

.toast {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    border-left: 4px solid var(--pink);
    border-radius: 8px;
    padding: 0.75rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: toastIn 0.3s ease-out forwards;
    pointer-events: auto;
    min-width: 320px;
    max-width: 600px;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-20px); }
}

.toast.toast-green { border-left-color: var(--green); }
.toast.toast-red { border-left-color: var(--red); }

/* MOBILE NAVIGATION BOTTOM BAR (Visible only on phone sizes) */
.mobile-bottom-navbar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--mobile-nav-height);
    background: var(--navbar-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-subtle);
    display: none; /* Hidden on Desktop */
    justify-content: space-around;
    align-items: center;
    z-index: 999;
    transition: background-color 0.3s;
}

.mobile-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 500;
    gap: 2px;
    transition: color 0.2s;
}

.mobile-nav-link i {
    font-size: 1.15rem;
}

.mobile-nav-link.active {
    color: var(--pink);
    font-weight: 700;
}

/* ==========================================================================
   MOBILE MEDIA OVERRIDES (PHONE FIT FIX)
   ========================================================================== */

@media (max-width: 1024px) {
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .analytics-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    /* Hide desktop nav menu items & auth blocks */
    #desktop-nav-menu {
        display: none;
    }
    
    .auth-buttons-group, .profile-header-widget {
        display: none !important; /* Managed by bottom navigation on phone viewports */
    }
    
    /* Enable bottom navbar on mobile */
    .mobile-bottom-navbar {
        display: flex;
    }
    
    /* Reduce body bottom padding to clear floating nav */
    .content-view-port {
        padding-bottom: calc(var(--mobile-nav-height) + 1.5rem);
    }

    .navbar {
        padding: 0 1rem;
    }

    /* Collapse pricing grid columns */
    .pricing-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 0 1rem;
    }
    
    .price-card.popular {
        transform: scale(1.0);
    }
    
    /* Collapse feature list grid columns */
    .features-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .stats-row {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
        margin-bottom: 2rem;
    }

    /* Convert settings section split layout to stacked */
    .account-settings-container {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    
    .settings-sidebar {
        flex-direction: row;
        overflow-x: auto;
        padding: 0.5rem;
        white-space: nowrap;
        scrollbar-width: none;
    }
    
    .settings-sidebar::-webkit-scrollbar {
        display: none;
    }

    .settings-menu-tab {
        width: auto;
        display: inline-flex;
    }
    
    .settings-main-card {
        padding: 1.5rem;
    }

    /* Collapse stats cards */
    .metrics-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
        gap: 1rem;
    }
    
    .analytics-row {
        padding: 0 1rem 1rem 1rem;
        gap: 1rem;
    }

    .dashboard-bottom-grid {
        padding: 0 1rem 1rem 1rem;
    }

    /* Create subview row columns */
    .studio-inputs-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .url-input-group {
        width: 100%;
    }

    .studio-card {
        margin: 0 1rem 1rem 1rem;
        padding: 1rem;
    }
    
    .status-panel-card {
        margin: 0 1rem 1rem 1rem;
    }
    
    .preview-clips-grid {
        padding: 0 1rem 1rem 1rem;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .upload-studio-workspace {
        padding: 0 1rem;
    }

    .studio-bottom-actions {
        padding: 1rem;
    }
}

/* ==========================================================================
   PLANS & BILLING SCREEN UPDATES
   ========================================================================== */

.payment-notice-banner {
    background: linear-gradient(90deg, rgba(255, 0, 122, 0.08) 0%, rgba(121, 40, 202, 0.08) 100%);
    border: 1px solid rgba(255, 0, 122, 0.2);
    border-radius: 12px;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.payment-notice-banner span {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
}

.banner-action-link {
    color: var(--pink);
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s;
}

.banner-action-link:hover {
    color: var(--cyan);
}

.plan-expiry-meta {
    font-size: 0.8rem;
    color: var(--pink);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
}

.settings-plans-container {
    margin-top: 1.5rem;
}

.settings-plans-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-top: 1rem;
}

.mini-price-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 1.25rem 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.2s, border-color 0.2s, background-color 0.2s;
    position: relative;
    overflow: hidden;
}

body.theme-light .mini-price-card {
    background: var(--bg-surface);
}

.mini-price-card:hover:not(.current) {
    transform: translateY(-2px);
    border-color: var(--pink);
    background: rgba(255, 255, 255, 0.04);
}

.mini-price-card.current {
    background: rgba(255, 255, 255, 0.01) !important;
    border-color: var(--text-muted);
    opacity: 0.6;
    cursor: not-allowed;
}

body.theme-light .mini-price-card.current {
    background: #E2E8F0 !important;
}

.mini-tier {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    letter-spacing: 0.5px;
}

.mini-price {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.mini-sub {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
}

.mini-badge {
    font-size: 0.65rem;
    font-weight: 600;
    background: var(--btn-outline-hover);
    padding: 0.15rem 0.5rem;
    border-radius: 8px;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.btn-mini-plan {
    width: 100%;
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.4rem 0.5rem;
    border-radius: 6px;
    transition: all 0.2s;
    cursor: pointer;
}

.mini-price-card.current .btn-mini-plan {
    background: var(--border-subtle);
    border-color: transparent;
    color: var(--text-muted);
    cursor: not-allowed;
}

.mini-price-card:not(.current) .btn-mini-plan:hover {
    background: var(--text-gradient-pink);
    border-color: transparent;
    color: white;
}

@media (max-width: 992px) {
    .settings-plans-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .settings-plans-row {
        grid-template-columns: 1fr;
    }
}

/* World Map SVG land paths styling */
.map-land {
    fill: rgba(255, 255, 255, 0.05);
    stroke: var(--border-subtle);
    stroke-width: 0.8;
    transition: fill 0.2s, fill-opacity 0.2s;
}

body.theme-light .map-land {
    fill: rgba(15, 23, 42, 0.12);
    stroke: rgba(15, 23, 42, 0.2);
}

.map-land:hover {
    fill: var(--pink);
    fill-opacity: 0.2;
    cursor: pointer;
}

/* Restricted Links */
.restricted-link.locked { color: var(--text-tertiary, #888) !important; opacity: 0.6; cursor: not-allowed; pointer-events: auto; }

/* Render circular spinner loader ring */
.render-spinner-ring {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 0, 85, 0.2);
    border-top: 3px solid var(--pink);
    border-radius: 50%;
    animation: render-spin 1s linear infinite;
    display: inline-block;
    vertical-align: middle;
}

@keyframes render-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Fullscreen fit portrait fix to prevent stretching and cropping */
video:fullscreen {
    object-fit: contain !important;
    background-color: #000 !important;
}
video:-webkit-full-screen {
    object-fit: contain !important;
    background-color: #000 !important;
}
video:-ms-fullscreen {
    object-fit: contain !important;
    background-color: #000 !important;
}

/* Timeline Selector Bar Segment Control */
.timeline-bar {
    display: flex;
    gap: 4px;
    background: var(--bg-deep);
    padding: 3px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    align-items: center;
}

body.theme-light .timeline-bar {
    background: var(--bg-surface);
}

.timeline-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 4px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 600;
    transition: all 0.2s;
}

.timeline-btn:hover {
    color: var(--text-primary);
}

.timeline-btn.active {
    background: var(--text-gradient-pink);
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(255, 0, 122, 0.2);
}
