html,
body {
  width: 100%;
  overflow-x: hidden;
}

/* General Body Styles */
:root {
    --primary-purple: #7C3AED;
    --light-purple-bg: #feeeff;
    --border-purple: #A78BFA;
    --main-bg: #fff5ff;
    --card-bg: #FFFFFF;
    --primary-text: #1F2937;
    --secondary-text: #6B7280;
    --border-color: #E5E7EB;
    --dashed-border: #D1D5DB;
    --success-color: #22c55e;
    --pending-color: #eab308;
    --active-color: var(--primary-purple);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.05);
}

body {
    font-family: 'Inter', sans-serif;
    /* Very light subtle purple background */
    background: radial-gradient(circle at 50% 0%, #f8f6ff 0%, #fbf9ff 60%, #fefcff 100%);
    margin: 0;
    color: var(--primary-text);
    display: flex; /* keep flex for auth centering */
    height: 100vh;
    overflow-y: hidden;
}

/* Auth container remains for login page */
#auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

/* Main App Layout */
#app-container {
    display: flex;
    flex-direction: column; /* Stack header and main content */
    width: 100%;
    height: 100%;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0; /* Prevent header from shrinking */
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 24px;
}

.logo { display: flex; align-items: center; font-size: 20px; font-weight: 600; gap: 12px; }
.logo img {
    height: auto;
    width: 150px;
    border-radius: 6px;
}

.app-nav {
    margin-left: 0;
    display: flex;
    gap: 8px;
}

.nav-btn {
    background: none;
    border: none;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}
.nav-btn:hover {
    background-color: var(--background-color);
    color: var(--text-primary);
}

.user-profile {
    margin-left: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative; /* For dropdown positioning */
}
#user-photo { 
    width: 36px; 
    height: 36px; 
    border-radius: 50%; 
    cursor: pointer;
}
#user-name { font-weight: 500; font-size: 14px; }
.btn-logout { background: none; border: none; color: var(--text-secondary); cursor: pointer; font-size: 14px; padding: 8px; transition: color 0.2s; }
.btn-logout:hover { color: var(--primary-color); }

/* Main Content & Views */
.app-main-content {
    display: flex;
    justify-content: center;
    padding: 32px 48px; /* more generous side padding */
    flex-grow: 1;
    overflow-y: auto; /* Enable scrolling for main content */
    background-color: var(--main-bg);
}

.main-container {
    display: grid;
    /* Make the left column (upload section) wider than the right column */
    grid-template-columns: 1fr 1fr;
    /* Reduce the gap between the two columns so the empty space nearly disappears */
    gap: 24px;
    width: 100%;
    max-width: none; /* fill full width */
    align-items: start;
}

.left-column, .right-column {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.left-column h2 {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 4px 0;
    color: var(--primary-text);
}

.right-column h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 4px 0;
    color: var(--primary-text);
}

.subtitle {
    font-size: 14px;
    color: var(--secondary-text);
    margin: 0 0 24px 0;
}

.view-container {
    width: 100%;
}

/* View 1: Initial Upload Box */
#initial-upload-view {
    display: flex;
    justify-content: center;
    /* align-items and padding-top are no longer needed due to parent centering */
    width: 100%;
}

.upload-box {
    width: 100%;
    /* Remove the old max-width limitation so the box can expand */
    max-width: none;
    background: var(--card-bg);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    /* Keep a constant height so it doesn’t grow/shrink when other content shows */
    height: 420px;
    aspect-ratio: unset;
    display: flex;
    box-sizing: border-box;
}

.upload-box-input { display: none; }
.upload-box-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    gap: 12px;
}
.upload-box-label:hover {
    border-color: var(--primary-color);
    background-color: var(--primary-color-light);
}
.upload-box-icon { color: var(--text-secondary); }
.upload-box-title { font-size: 24px; font-weight: 600; margin: 0; }
.upload-box-subtitle { font-size: 16px; color: var(--text-secondary); margin: 0; }
.upload-box .btn {
    font-size: 16px;
    padding: 12px 24px;
}
.upload-box-info { font-size: 14px; color: var(--text-secondary); margin: 0; }


/* View 2: Post-Upload Mode Selection */
#post-upload-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* Center content vertically */
    gap: 30px;
    width: 100%;
    max-width: 65vh; /* Match the size of the upload box */
    margin: 0 auto; /* Center the container itself */
}
#uploaded-image-preview {
    width: 100%; /* Fill the container */
    height: auto;
    object-fit: contain; /* Ensure the whole image is visible */
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    max-height: 80%; /* Limit image height to leave space for buttons */
}
.mode-selection-buttons { 
    display: flex; 
    gap: 20px; 
    justify-content: center; /* Ensure buttons are centered */
    width: 100%; /* Take full width to allow centering */
}
.mode-selection-buttons .btn { 
    font-size: 18px; /* Larger font */
    padding: 16px 32px; /* More padding */
    min-width: 200px; /* Give them a minimum width */
    text-align: center;
}

.mode-btn {
    padding: 16px 32px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 220px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.mode-btn.btn-primary {
    background: linear-gradient(to right, #6D28D9, #4F46E5);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.mode-btn.btn-primary:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    background: linear-gradient(to right, #7C3AED, #6366F1);
}

.mode-btn.btn-secondary {
    background-color: #F3F4F6;
    color: #1F2937;
    border: 1px solid #E5E7EB;
}

.mode-btn.btn-secondary:hover:not(:disabled) {
    background-color: #E5E7EB;
    border-color: #D1D5DB;
    transform: translateY(-2px);
}

/* View 5: Library */
.library-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 30px;
    text-align: center;
}

.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.library-item {
    background-color: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

.library-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.library-item video {
    width: 100%;
    height: auto;
    aspect-ratio: 9 / 16;
    background-color: #f0f0f0;
}

.library-item-footer {
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.library-item-date {
    font-size: 12px;
    color: var(--text-secondary);
}

.library-item .btn {
    padding: 6px 12px;
    font-size: 12px;
}


/* View 3: 1-Click Progress */
#one-click-view {
    text-align: center;
}
#one-click-status { font-size: 18px; color: var(--text-secondary); margin-bottom: 20px; }

.progress-bar {
    width: 100%;
    max-width: 500px;
    height: 24px;
    background-color: var(--border-color);
    border-radius: 12px;
    margin: 20px auto;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, #6D28D9, #4F46E5);
    border-radius: 12px;
    transition: width 1s linear;
}

#lucky-progress-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 600;
    mix-blend-mode: exclusion;
    line-height: 1;
}

.timer-text {
    margin-top: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
}

/* View 4: Manual Mode (Stepper) */
.stepper-container { display: flex; flex-direction: column; gap: 20px; }
.step { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 12px; transition: all 0.3s ease; }
.step-header {
    display: flex;
    align-items: center;
    padding: 20px;
    border-radius: 12px;
    transition: background-color 0.3s ease;
}

.step.active .step-header, .step.completed .step-header { cursor: pointer; }
.step.completed .step-header:hover { background-color: #f9fafb; }

.step-indicator {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: var(--primary-color-light);
    color: var(--primary-color);
    display: grid;
    place-items: center;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-right: 16px; /* Added margin */
}
.step-title { font-size: 18px; font-weight: 600; margin: 0; flex-grow: 1; }
.step-status { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 99px; margin-left: 16px; }
.step-status[data-status="pending"] { color: var(--pending-color); background-color: #fffbeb; }
.step-status[data-status="active"] { color: var(--active-color); background-color: var(--primary-color-light); }
.step-status[data-status="completed"] { color: var(--success-color); background-color: #ecfdf5; }
.step-content { padding: 0 20px 20px; display: none; }
.step.open .step-content { display: block; }
.step.active .step-indicator { background-color: var(--primary-color); color: white; }
.step-chevron { width: 20px; height: 20px; color: var(--text-secondary); transition: transform 0.3s ease; margin-left: 16px; }
.step.open .step-chevron, .step.active .step-chevron { transform: rotate(180deg); }


/* Shared components */
.media-generation-container { display: flex; gap: 20px; }
.media-column { flex: 1; }

.model-selection {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    font-size: 14px;
    align-items: center;
    color: var(--text-secondary);
}
.model-selection label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

/* Button Styles */
.btn { background-color: #ffffff; color: #333; border: 1px solid #ccc; padding: 10px 18px; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 500; transition: all 0.2s; position: relative; box-shadow: var(--shadow-sm); }
.btn:hover:not(:disabled) { border-color: #999; background-color: #f7f7f7; box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-danger { background-color: #dc2626; color: #ffffff; border-color: #dc2626; }
.btn-danger:hover:not(:disabled) { background-color: #b91c1c; border-color: #b91c1c; }
.btn-primary { background-color: var(--primary-color); color: white; border-color: var(--primary-color); }
.btn-primary:hover:not(:disabled) { background-color: #7c3aed; border-color: #5244e0; }
.btn-secondary {
    background-color: var(--card-bg);
    color: #FC3AED;
    border-color: var(--border-color);
}
.btn-secondary:hover:not(:disabled) {
    background-color: #f9fafb;
    border-color: #d1d5db;
}

/* Results Display */
.results-box { margin-top: 15px; }
#prompts-container p { background-color: #f9fafb; padding: 8px 12px; border-radius: 6px; font-size: 14px; }
.results-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 15px; margin-top: 15px; }
.results-grid img, .results-grid video { width: 100%; border-radius: 8px; aspect-ratio: 9/16; object-fit: cover; }
#audio-player { width: 100%; margin-top: 15px; }
#video-prompts-display { background-color: #f9fafb; border-radius: 8px; padding: 15px; font-size: 12px; white-space: pre-wrap; word-break: break-all; }
.status-text { text-align: center; margin-top: 15px; color: var(--text-secondary); }
.final-video-wrapper { 
    margin: 20px auto 0 auto; 
    max-width: 420px; /* Increased from 320px */
    text-align: center; 
}
#final-video-player { width: 100%; margin-inline: auto; display: block; border-radius: 8px; }


/* Spinner for buttons */
.spinner { display: none; width: 18px; height: 18px; border: 2px solid; border-radius: 50%; border-right-color: transparent !important; animation: spin 1s linear infinite; position: absolute; left: 50%; top: 50%; margin-left: -9px; margin-top: -9px; }
.btn .spinner { border-color: var(--text-secondary); }
.btn-primary .spinner { border-color: white; }
.btn .btn-text { transition: opacity 0.2s; }

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

.step-content, .view-container { animation: fadeIn 0.4s ease-in-out; }

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

.dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 8px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    padding: 8px;
    z-index: 10;
    min-width: 120px;
}
.dropdown-menu button { display: block; width: 100%; text-align: left; }
.dropdown-menu select {
    width: 100%;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    font-size: 14px;
    background-color: var(--card-bg);
    color: var(--text-primary);
}
.dropdown-menu select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-color-light);
}

.product-description-input {
    width: 100%;
    min-height: 120px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    font-size: 14px;
    box-sizing: border-box;
    resize: vertical;
}
.product-description-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-color-light);
}

/* NEW: Generation Options Row */
.generation-options{
  display:flex;
  gap:16px;
  margin:12px 0;
  flex-wrap:wrap;
}
.generation-options .opt-label{
  font-size:14px;
  display:flex;
  flex-direction:column;
}
.generation-options select,.generation-options input[type="checkbox"]{
  margin-top:4px;
  padding:4px 6px;
  font-size:14px;
}

/* Thumbnail grid */
#uploaded-thumbnails{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  justify-content:center;
}
.thumb{
  width:150px;
  height:150px;
  position:relative;
  overflow:hidden;
  border-radius:8px;
}
.thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
}
.delete-thumb{
  position:absolute;
  top:4px;
  right:4px;
  background:#ffffffcc;
  border:none;
  border-radius:50%;
  width:24px;
  height:24px;
  font-size:16px;
  line-height:24px;
  cursor:pointer;
  transition:background 0.2s;
}
.delete-thumb:hover{background:#ff5555cc; color:#fff;}

/* Button polish */
.btn{
  padding:10px 20px;
  font-size:16px;
  border:none;
  border-radius:6px;
  cursor:pointer;
  transition:background 0.2s, transform 0.1s;
}
.btn-primary{background:#2563eb; color:#fff;}
.btn-primary:hover{background:#1e4fbe; transform:translateY(-1px);}
.btn-secondary{background:#f3f4f6; color:#111827;}
.btn-secondary:hover{background:#e5e7eb; transform:translateY(-1px);}

/* Center helper */
.flex-center{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
}

@media (max-width: 768px) {
    .app-header { flex-direction: column; gap: 16px; padding: 16px; }
    .user-profile { margin-left: 0; }
    .app-main-content { padding: 20px; }
    .results-grid { grid-template-columns: repeat(2, 1fr); }
    .media-generation-container { flex-direction: column; }
}

@media (max-width: 640px) {
    .app-header {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 16px;
        gap: 16px;
    }

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

    .logo img { height: 48px; }
    .app-nav {
        display: flex;
        align-items: center;
        gap: 24px;
        margin-left: 0;
    }

    .nav-btn {
        font-weight: 600;
    }

    .user-profile {
        margin-left: 0;
        gap: 0;
    }
    #user-name { display: none; }
    #user-photo { margin-right: 0; order: -1; }
    .btn-logout { display: none; } /* Hidden, shown in dropdown */
    .app-main-content{
        padding: 16px;
    }
    .mode-selection-buttons{
        flex-direction: column;
    }
    #uploaded-image-preview {
        max-width: 50%;
        margin-inline: auto;
        display: block;
    }
    /* Shrink upload box on small screens */
    .upload-box {
        max-width: 90%;
        margin: 0 auto;
        aspect-ratio: unset;
        height: auto;
        padding: 16px;
    }
    .upload-box-label {
        padding: 16px;
    }
    /* Library grid: smaller columns */
    .library-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
    .library-item video {
        max-height: 200px;
    }
    /* Enable scrolling */
    body {
        overflow-y: auto;
    }
    /* Ensure library item footer elements remain visible on small screens */
    .library-item-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .library-item-footer .btn {
        width: 100%;
    }
}

/* --- Fix mobile scrolling and spacing issues --- */
@media (max-width: 640px) {
    body {
        height: auto; /* Allow full scrolling on small screens */
    }
    .app-main-content {
        align-items: flex-start;
        justify-content: flex-start;
    }
}

/* Ensure gap between header and library content on larger screens */
#library-view {
    /* Ensure the whole grid starts at the top of the scrollable area */
    align-self: flex-start;
    margin-top: 32px;
}

/* -------- Modern design overhaul -------- */
:root{
  --slate-800:#1f2937;
  --slate-700:#374151;
  --slate-300:#d1d5db;
  --indigo-500:#7c3aed;
  --violet-500:#8b5cf6;
  --bg-light:#f9fafb;
}
body{background:var(--bg-light); color:var(--slate-800); font-family:"Inter",sans-serif;}

/* Buttons */
.btn{
  padding:12px 26px;
  font-size:16px;
  font-weight:500;
  border-radius:8px;
  border:1px solid transparent;
  cursor:pointer;
  transition:transform .15s,box-shadow .15s;
  display:inline-flex; align-items:center; justify-content:center;
}
.btn:disabled{opacity:.6;cursor:not-allowed;}
.btn-primary{
  background-image:linear-gradient(90deg,var(--indigo-500) 0%,var(--violet-500) 100%);
  color:#ffffff;
  box-shadow:0 1px 2px rgba(0,0,0,.05);
}
.btn-primary:hover:not(:disabled){
  transform:translateY(-2px);
  box-shadow:0 4px 14px rgba(0,0,0,.12);
}
.btn-secondary{
  background:transparent;
  border-color:var(--slate-300);
  color:var(--slate-700);
}
.btn-secondary:hover:not(:disabled){
  transform:translateY(-2px);
  box-shadow:0 4px 14px rgba(0,0,0,.06);
}

/* Generation options layout */
.generation-options{display:flex;gap:32px;flex-wrap:wrap;justify-content:center;margin:20px 0;}
.opt-label{font-weight:500;color:var(--slate-700);display:flex;flex-direction:column;gap:4px;}

/* Select */
.opt-label select{
  appearance:none;-webkit-appearance:none;
  background:var(--bg-light) url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iOCIgdmlld0JveD0iMCAwIDE0IDgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNzUgMS41TDcgNi41TDEyLjI1IDEuNSIgc3Ryb2tlPSIjNjM2NmYxIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjwvc3ZnPg==') no-repeat right 12px center;
  border:1px solid var(--slate-300);border-radius:8px;padding:10px 40px 10px 14px;font-size:15px;color:var(--slate-800);
  transition:border .2s,box-shadow .2s;
}
.opt-label select:focus{outline:none;border-color:var(--indigo-500);box-shadow:0 0 0 3px rgba(99,102,241,.35);}   

/* Checkbox */
.opt-label input[type="checkbox"]{width:20px;height:20px;appearance:none;border:2px solid var(--slate-300);border-radius:4px;cursor:pointer;transition:background .2s,border .2s;}
.opt-label input[type="checkbox"]:checked{background:var(--indigo-500);border-color:var(--indigo-500);} 
.opt-label input[type="checkbox"]:checked::after{content:"";position:absolute;width:5px;height:10px;border:solid #fff;border-width:0 2px 2px 0;transform:translate(6px,2px) rotate(45deg);}  

/* Textarea */
.product-description-input{width:100%;max-width:700px;min-height:140px;padding:14px 16px;border:1px solid var(--slate-300);border-radius:8px;font-size:15px;font-family:"Inter",sans-serif;resize:vertical;transition:border .2s,box-shadow .2s;}
.product-description-input:focus{outline:none;border-color:var(--indigo-500);box-shadow:0 0 0 3px rgba(99,102,241,.35);}  

/* Thumbnail grid improvements */
#uploaded-thumbnails{display:grid;grid-template-columns:repeat(5,165px);gap:16px;max-width:none;margin:0;}
.thumb,.thumb-placeholder{width:165px;height:165px;position:relative;overflow:hidden;border-radius:10px;background:var(--bg-light);box-shadow:0 1px 3px rgba(0,0,0,.08);transition:transform .15s,box-shadow .15s;}
.thumb:hover{transform:scale(1.02);box-shadow:0 4px 12px rgba(0,0,0,.12);}  

.delete-thumb{position:absolute;top:6px;right:6px;background:#ffffffee;border:none;border-radius:50%;width:24px;height:24px;font-size:16px;line-height:24px;text-align:center;color:var(--slate-700);cursor:pointer;transition:background .2s,color .2s,transform .15s;}
.delete-thumb:hover{background:#ef4444;color:#fff;transform:scale(1.05);}  

/* Adjust option label spacing */
.opt-label{
  font-weight:500;
  color:#374151;
}
.opt-label + .opt-label{margin-left:24px;}

/* --- UI Kit Inspired Buttons (applied globally) --- */
/* Uses existing CSS variables defined above */

/* Base button */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 24px;
  font-size:15px;
  font-weight:500;
  border-radius:999px; /* pill shape */
  cursor:pointer;
  transition:all 0.2s ease;
  border:none;
  box-shadow:0 2px 8px rgba(0,0,0,0.06);
}

/* Primary filled */
.btn-primary{background:var(--indigo-500);color:#fff;}
.btn-primary:hover{background:var(--violet-500);box-shadow:0 4px 14px rgba(0,0,0,0.12);transform:translateY(-2px);} 

/* Secondary outlined */
.btn-secondary{background:var(--bg-light);color:var(--indigo-500);border:1px solid var(--indigo-500);} 
.btn-secondary:hover{background:var(--indigo-500);color:#fff;box-shadow:0 4px 14px rgba(0,0,0,0.1);transform:translateY(-2px);} 

/* Disabled state */
.btn:disabled{opacity:0.5;cursor:not-allowed;transform:none;box-shadow:none;}

/* Icon (circular) */
.btn-icon{width:40px;height:40px;border-radius:50%;padding:0;display:inline-flex;align-items:center;justify-content:center;background:var(--bg-light);color:var(--indigo-500);border:1px solid var(--indigo-500);} 
.btn-icon:hover{background:var(--indigo-500);color:#fff;box-shadow:0 4px 14px rgba(0,0,0,0.12);} 

/* Navigation pills */
.nav-btn{padding:8px 20px;border-radius:999px;font-weight:500;background:transparent;color:var(--indigo-500);transition:background 0.2s,color 0.2s;} 
.nav-btn:hover{background:var(--bg-light);}

/* New Header Styles */
.new-header {
    background-color: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 0 32px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.header-left, .header-right, .header-nav, .logo {
    display: flex;
    align-items: center;
    gap: 24px;
}

.header-right{display:none;}

.logo img {
    height: auto;
    width: 150px; /* make logo bigger and wider */
    border-radius: 6px;
}

.logo span {
    font-weight: 600;
    font-size: 18px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280; /* text-secondary */
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.nav-item .icon {
    width: 20px;
    height: 20px;
}

.nav-item.active, .nav-item:hover {
    color: #6366f1; /* primary-color */
}

.nav-item.active {
    color: #4f46e5;
}

.header-right button {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #374151; /* slate-700 */
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.header-right button .icon {
    width: 20px;
    height: 20px;
    color: #6b7280;
}

.header-right button:hover {
    background-color: #f9fafb; /* bg-light */
}

.feedback-btn {
    background-color: #eef2ff !important; /* primary-color-light */
    color: #4f46e5 !important;
}

.feedback-btn .icon {
    color: #4f46e5 !important;
}

.settings-container {
    position: relative;
}

.settings-container .dropdown-menu {
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    position: absolute;
    z-index: 9999;  /* Ensure it's above everything */
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.settings-menu-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.settings-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: none;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--primary-text);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
}

.settings-menu-item:hover {
    background-color: #f3f4f6;
    color: var(--primary-purple);
}

.settings-menu-item .icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.settings-divider {
    border: none;
    height: 1px;
    background-color: var(--border-color);
    margin: 8px 0;
}

.logout-item {
    color: #dc2626;
}

.logout-item:hover {
    background-color: #fef2f2;
    color: #b91c1c;
}

/* All Cards */
.upload-section,
.video-description-section,
.voice-settings-section,
.subtitles-section,
.uploaded-images-section {
    background-color: var(--card-bg);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--border-color);
    /* Soft neutral grey drop-shadow */
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.10), 0 4px 16px rgba(0, 0, 0, 0.06);
}
.uploaded-images-section {
    background-color: var(--card-bg);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--border-color);
}
 
 .upload-box {
     display: flex;
}

/* Upload Section */
.upload-box-label {
    border: 2px dashed var(--border-purple);
    border-radius: 12px;
    padding: 48px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--light-purple-bg);
}

.upload-box-label:hover {
    border-color: var(--primary-purple);
    background-color: #FBF9FF;
}

.upload-icon-container {
    width: 48px;
    height: 48px;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: grid;
    place-items: center;
    margin: 0 auto 16px auto;
}

.upload-icon {
    width: 24px;
    height: 24px;
    color: var(--primary-purple);
}

.upload-box-title { font-size: 16px; font-weight: 600; margin: 0; color: var(--primary-text); }
.upload-box-subtitle { color: var(--secondary-text); font-size: 14px; margin: 4px 0 16px 0; }
.upload-box .btn-primary {
    background: var(--primary-purple);
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
}
.upload-box-info { font-size: 12px; color: var(--secondary-text); text-align: center; margin-top: 16px; }

.upload-section.has-images .upload-box {
    padding-bottom: 0;
}

.upload-section.has-images .upload-box-label {
    padding: 24px;
    min-height: auto;
}

/* Keep upload box size constant even after images uploaded */
.upload-section.has-images .upload-box{padding-bottom:24px;height:420px;}
.upload-section.has-images .upload-box-label{padding:48px;}

/* Uploaded Images Section */
.uploaded-images-section-inner {
    margin-top: 24px;
}

.uploaded-images-section-inner h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 16px 0;
    color: var(--primary-text);
}
.thumbnails-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}
.thumb, .thumb-placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
}
.thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.thumb .delete-thumb {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 14px;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.thumb:hover .delete-thumb {
    opacity: 1;
}
.thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--dashed-border);
    color: var(--dashed-border);
    font-size: 36px;
    font-weight: bold;
    background-color: #F9FAFB;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
}

.thumb-placeholder {
    display: grid;
    place-items: center;
    border: 2px dashed var(--dashed-border);
    color: var(--dashed-border);
    font-size: 36px;
    font-weight: bold;
    background-color: #F9FAFB;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
}
.thumb:hover {
    box-shadow: 0 0 0 3px var(--border-purple);
}

/* Right Column Sections */
.video-description-section label, .voice-settings-section > div > label {
    font-weight: 500;
    font-size: 14px;
    display: block;
    margin-bottom: 8px;
    color: var(--primary-text);
}

.video-description-section textarea {
    width: 100%;
    min-height: 120px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    font-size: 14px;
    resize: vertical;
    box-sizing: border-box;
}
.video-description-section textarea:focus {
    outline: none;
    border-color: var(--primary-purple);
    box-shadow: 0 0 0 2px var(--light-purple-bg);
}

.char-counter {
    font-size: 12px;
    color: var(--secondary-text);
    text-align: right;
    margin: 8px 0 0 0;
}

/* Voice Settings */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.gender-and-subtitles {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.voice-settings-section .language-options, .voice-settings-section .gender-options {
    margin-bottom: 0;
}
.language-grid, .gender-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-card {
    position: relative;
}

.radio-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-card label {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.radio-card input[type="radio"]:checked + label {
    border-color: var(--primary-purple);
    background-color: var(--light-purple-bg);
}

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

.radio-card.disabled label {
    cursor: not-allowed;
}

.radio-card label::before { /* Custom radio button */
    content: '';
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    margin-right: 12px;
    transition: all 0.2s ease;
}

.radio-card input[type="radio"]:checked + label::before {
    border-color: var(--primary-purple);
    background-color: var(--primary-purple);
    box-shadow: inset 0 0 0 3px white;
}


.radio-card .radio-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #FEE2E2; /* Example for Female */
    display: grid;
    place-items: center;
    margin-right: 12px;
    color: #EF4444;
}
.radio-card .gender-icon--female {
     background-color: #FEE2E2;
     color: #EF4444;
}
.radio-card .gender-icon--male {
     background-color: #DBEAFE;
     color: #3B82F6;
}
.radio-card .lang-icon {
    font-weight: 500;
    color: var(--primary-text);
    border: 1px solid var(--border-color);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    margin-right: 12px;
}

.radio-card .radio-text p {
    font-weight: 500;
    margin: 0;
    color: var(--primary-text);
}
.radio-card .radio-text span {
    font-size: 12px;
    color: var(--secondary-text);
}

.radio-card .play-icon {
    width: 20px;
    height: 20px;
    color: var(--primary-purple);
    margin-left: auto;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.radio-card input[type="radio"]:checked + label .play-icon {
    opacity: 1;
}


/* Subtitles Section */
.subtitles-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background-color: var(--light-purple-bg);
    border-radius: 16px; /* Add back border-radius */
    border: 1px solid transparent; /* To prevent layout shift on hover if needed */
}
.subtitle-icon {
    width: 40px;
    height: 40px;
    background-color: #fff;
    color: var(--primary-purple);
    border-radius: 8px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border-color);
}
.subtitle-icon svg { width: 24px; height: 24px; }
.subtitle-text { flex-grow: 1; margin: 0 16px; }
.subtitle-text p { font-weight: 600; margin: 0; color: var(--primary-text); }
.subtitle-text span { font-size: 14px; color: var(--secondary-text); }

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .slider { background-color: var(--primary-purple); }
input:checked + .slider:before { transform: translateX(20px); }

.action-buttons {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
}

.action-buttons .btn-primary {
    background: var(--primary-purple);
    padding: 12px 32px;
    font-size: 16px;
    font-weight: 500;
}

.fab-container{
    margin-top:32px;
    display:flex;
    justify-content:center;
    gap:24px;
}
.fab{padding:18px 32px;border-radius:999px;font-size:18px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(0,0,0,.15);transition:transform .15s,box-shadow .15s;}
.fab:hover{transform:translateY(-2px);box-shadow:0 6px 18px rgba(0,0,0,.2);}
.fab.btn-primary:hover{background:var(--indigo-500);color:#fff;box-shadow:0 6px 18px rgba(0,0,0,.2);}
.fab.btn-secondary:hover{background:var(--bg-light);color:var(--indigo-500);border-color:var(--indigo-500);box-shadow:0 6px 18px rgba(0,0,0,.2);}

@media (max-width:640px){
    .main-container{grid-template-columns:1fr;gap:24px;}
    .fab-container{flex-direction:column;right:16px;left:auto;bottom:16px;}
    #main-nav{display:none;flex-direction:column;gap:12px;position:absolute;top:64px;right:16px;background:#ffffff;border:1px solid var(--border-color);border-radius:8px;padding:12px 16px;box-shadow:0 8px 24px rgba(0,0,0,.12);}  
    #main-nav.show{display:flex;}
    .mobile-menu-btn{display:block;background:none;border:none;color:#374151;padding:8px;}
}

@media(min-width:641px){.mobile-menu-btn{display:none;}}

@media (max-width:640px) {
    #uploaded-thumbnails{grid-template-columns:repeat(auto-fill,minmax(70px,1fr));gap:8px;width:100%;}
    .thumb,.thumb-placeholder{height:70px;}
    .main-container{width:100%;}
}


