/* General Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Navbar Styling */
/* Layout Structure */
.layout {
    display: flex;
    min-height: 100vh; /* ⬅️ Change from height to min-height */
    align-items: stretch; /* ⬅️ Ensure child elements stretch properly */
}


/* Sidebar Styles */
.sidebar {
    width: 230px;
    background: linear-gradient(180deg, #2c3e50, #1a252f);
    color: white;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease-in-out;
    min-height: 100vh; /* ⬅️ Ensure sidebar fills at least full screen, even when content is longer */
}

.sidebar .logo {
    width: 100%;
    text-align: left;
    padding-left: 10px;
    margin-bottom: 25px;
}

.sidebar .logo img {
    width: 90px; /* Slightly larger for better visibility */
}

.sidebar .nav-links a {
    text-decoration: none;
    color: white;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.sidebar .nav-links li {
    width: 100%;
}

.sidebar .nav-links a {
    text-decoration: none;
    color: white;
    font-size: 1rem;
    display: block;
    padding: 14px 20px;
    text-align: left;
    border-radius: 6px;
    transition: background 0.3s ease, padding-left 0.2s;
}

.sidebar .nav-links a:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.sidebar .nav-links a.active {
    background: rgba(255, 215, 0, 0.3);
    border-left: 4px solid #FFD700;
}


/* Main Content */
.main-content {
    flex: 1;
    padding: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
        padding: 10px;
    }

    .nav-links a {
        font-size: 0; /* Hide text for small screens */
        padding: 10px;
    }

    .nav-links a::before {
        font-size: 1.2rem;
        display: block;
        text-align: center;
    }

    .main-content {
        padding: 10px;
    }
}


/* Navbar Styling - Sub Menu */
/* Sidebar Sections */
.nav-section {
    padding: 12px 15px;
    color: white;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s ease;
    border-radius: 6px;
    margin-bottom: 5px;
}

.nav-section:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Submenu - Initially Hidden */
.submenu {
    display: none;
    padding-left: 15px;
    margin-top: 5px;
}

/* When submenu is open, make it visible */
.submenu.open {
    display: block;
}

/* Submenu Items */
.submenu li {
    list-style: none;
    margin: 5px 0;
}

.submenu a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    padding: 10px 15px;
    font-size: 1rem;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.3s ease;
}

.submenu a:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Ensure active item is properly highlighted */
.submenu a.active {
    background: rgba(255, 215, 0, 0.3);
    border-left: 4px solid #FFD700;
}






/* Expand Submenu on Click */
.nav-section.active + .submenu {
    display: block;
}








/* Body Styling */
body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f9;
    color: #333;
    text-align: center;
    padding: 20px;
}

/* Header */
header {
    /*background: rgba(44, 62, 80, 0.85);*/
    color: white;
    padding: 15px 20px;
    /*border-radius: 8px;*/
    text-align: center;
    font-weight: 600;
    font-size: 1.8rem;
    /*box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);*/
    backdrop-filter: blur(8px);
    /* border-radius: 12px 12px 0 0; 
    background: linear-gradient(90deg, #1E3A5F, #2A537A); 
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); */
    border-radius: 12px 12px 0 0;
    background: rgba(44, 62, 80, 0.75); /* Dark Transparent */
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);    
}


.logo img {
    width: 100px;
}

.app-title {
    font-size: 2rem;
    margin-top: 10px;
}

.app-title:hover {
    text-decoration: underline;
    text-decoration-thickness: 3px;
    text-underline-offset: 5px;
}

/* Main Container */
.home-container {
    margin-top: 50px;
}


/* Buttons */
.button-group {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.btn-primary, .btn-secondary {
    padding: 15px 25px;
    font-size: 1.2rem;
    text-decoration: none;
    border-radius: 5px;
}

.btn-primary {
    background-color: #4A90E2;
    color: white;
}

.btn-primary:hover {
    background-color: #357ABD;
}

.btn-secondary {
    background-color: white;
    border: 2px solid #4A90E2;
    color: #4A90E2;
}

.btn-secondary:hover {
    background-color: #e0e8f0;
}


/* Essential Information Form Styles */
.container {
    max-width: 1100px;  /* ⬅️ widened to allow side-by-side image + folders */
    margin: 30px auto;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
}

/* Form Elements */
.form-group {
    margin-bottom: 15px;
    text-align: left;
}

.form-group label {
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
}

textarea.form-control {
    height: 100px;
    resize: vertical;
}

/* Buttons */
.button-group {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.btn-primary, .btn-secondary {
    padding: 12px 20px;
    font-size: 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-align: center;
    transition: background 0.3s ease;
}

.btn-primary {
    background-color: #4A90E2;
    color: white;
}

.btn-primary:hover {
    background-color: #357ABD;
}

.btn-secondary {
    background-color: #ccc;
    color: black;
}

.btn-secondary:hover {
    background-color: #b3b3b3;
}

/* Category Description Box */
.description-box {
    margin-top: 10px;
    padding: 10px;
    background-color: #f4f4f9;
    border-left: 4px solid #4A90E2;
    border-radius: 5px;
    font-size: 0.9rem;
    display: none;
}

.description-box.show {
    display: block;
}




/********************************
 * File Browsing Styling
 ********************************/
 /* Custom File Input Button - emphasized */
label[for="media-files"] {
    display: inline-block;
    padding: 14px 22px;
    font-size: 1.1rem;
    background: linear-gradient(135deg, #5A9BEF, #83C2F6); /* Slightly lighter than primary */
    color: white;
    border-radius: 5px;
    cursor: pointer;
    text-align: center;
    transition: background 0.3s ease, transform 0.2s;
    font-weight: bold;
}

label[for="media-files"]:hover {
    background: linear-gradient(135deg, #4A90E2, #72B8F4);
    transform: scale(1.05);
}

/* Upload Button - keeps standard primary */
.btn-primary {
    padding: 12px 20px;
    font-size: 1rem;
    background-color: #4A90E2;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
    font-weight: bold;
}

.btn-primary:hover {
    background-color: #357ABD;
}

/* Display selected file name */
#file-name {
    margin-left: 10px;
    font-size: 1rem;
    color: #555;
    font-style: italic;
}


/* ========================== */
/* 📂 Media Indexing Styles  */
/* ========================== */

.media-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.preview-item {
    border-radius: 5px;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.2);
}

.media-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin: 10px;
}

.file-name {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 5px;
}



/* ========================== */
/* 🔄 Loading Spinner Styles  */
/* ========================== */
.loading-button {
    opacity: 0.7;
    cursor: not-allowed;
}

.spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid white;
    border-radius: 50%;
    border-top: 2px solid transparent;
    animation: spin 0.8s linear infinite;
    margin-right: 5px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}





/* ========================== */
/* 🖼️ Image Slider Styles  */
/* ========================== */

.image-slider {
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
    max-height: 500px;
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.image-slide {
    width: 80%;
    margin: 10px 0;
    padding: 10px;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.image-frame {
    position: relative;
    display: inline-block;
}

.image-frame img {
    width: 100%;
    max-width: 300px;
    border-radius: 5px;
}

.image-controls {
    position: absolute;
    top: 5px;
    left: 5px;
    display: flex;
    gap: 5px;
    z-index: 15;
}

.image-controls button {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    padding: 5px;
    font-size: 12px;
    cursor: pointer;
    border-radius: 3px;
}

.image-description {
    width: 100%;
    height: 60px;
    margin-top: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 5px;
    resize: vertical;
}



/* ========================== */
/* adherence description box  */
/* ========================== */
#adherence-description {
    font-size: 1.2rem; /* Make text bigger */
    color: #000 !important; /* Force black text */
    font-weight: bold;
    background-color: #e0f7fa !important; /* Light blue background */
    padding: 15px;
    border-radius: 5px;
    display: block !important; /* Ensure it's always displayed */
    min-height: 50px; /* Prevent collapse */
    text-align: center;
    border: 2px solid #007bff; /* Blue border for better visibility */
}

.description-box.show {
    display: block;
}


/*===================================
 The basis of image generation
===================================*/
/* Scene Box Styling */
.scene-box {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.2);
    margin-bottom: 15px;
}

/* Select Group (Align Visual Style & Camera Angle) */
.select-group {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    align-items: center;
}

.select-container {
    flex: 1;
    text-align: center;
}

.placeholder-img {
    width: 100px;
    height: 100px;
    margin-top: 10px;
    display: block;
}

/* Generated Image Placeholder (16:9) */
.generated-img-16-9 {
    width: 320px; /* Adjust width as needed */
    height: 180px; /* 16:9 aspect ratio */
    border: 1px solid #ccc;
    border-radius: 5px;
    margin-top: 10px;
    display: block;
}



/*===================================
 Images ti Scenes Template
===================================*/
/* Ensures both images appear side by side */
.image-video-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;  /* Adjust spacing as needed */
}

/* Ensures images take equal space */
.image-video-container .image-preview,
.image-video-container .video-placeholder {
    flex: 1;
    text-align: center;
}

/* Maintain 16:9 aspect ratio */
.generated-img-16-9 {
    width: 100%;
    max-width: 320px;  /* Adjust as needed */
    height: auto;
    border: 1px solid #ccc;
    border-radius: 5px;
}



/*===================================
 Video Generation Template
===================================*/
.video-wrapper {
    position: relative;
    width: 100%;
    max-width: 240px;
    height: auto;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.generated-video-16-9 {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}



.video-circle.active{
  background:#0d6efd;        /* Bootstrap primary */
  color:#fff;
}


/* Enrich Image Prompt Radio Group */
.form-group h3 {
    margin-bottom: 10px;
}
.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}



/*===================================
 Voice Selection Container
===================================*/
.voice-selection-container {
    display: flex;
    align-items: center;
    gap: 10px; /* Space between elements */
}

.voice-selection-container label {
    font-weight: bold;
    margin-right: 5px;
}

.voice-selection-container .form-control {
    flex: 1; /* Evenly distribute width */
    min-width: 100px; /* Prevents squishing */
}


/* New Concept Suggestions Box */
.suggestion-box {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    margin-top: 8px;
    background-color: #f8f8f8;
    cursor: pointer;
}
.suggestion-box:hover {
    background-color: #eef;
}

.suggestion-box p { white-space: pre-wrap; }

/*===================================
 Text Area Long & Short inputs 
===================================*/
/* For small input fields */
textarea.short-input {
    height: 70px !important;  /* About 2 lines */
}

/* For longer story output */
textarea.story-long {
    height: 600px !important;  /* About 20 lines */
}


/* relevant to processing status */
.info-text {
    font-size: 0.9rem;
    color: #555;
  }
  
  .hidden {
    display: none !important;
}


/*===================================
 Copy icon
====================================*/
.copy-icon {
    position: absolute;
    right: 10px;
    top: 30px;
    background: transparent;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: #4A90E2;
}

.copy-icon:hover {
    color: #2a64a5;
}


/*===================================
  Group of icon-buttons
====================================*/
.copy-btn {
    background: transparent;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: #4A90E2;
    padding: 2px 6px;
  }
  
  .copy-btn:hover {
    color: #2a64a5;
  }
  
  .prompt-icon-group {
    position: absolute;
    right: 5px;
    top: -15px;
    display: flex;
    flex-direction: row;
    gap: 2px;
    z-index: 5;
  }
  



/* ===================================
  Collapsible Scene Cards
=================================== */

/* File: static/css/styles.css */
/* Collapsible scene-body */
.scene-box.collapsed .scene-body {
    display: none;
  }
  /* Header layout */
  .scene-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
  }
  .scene-header .thumb {
    width: 80px;
    height: auto;
    border-radius: 4px;
  }
  .partial-prompt {
    flex: 1;
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .mini-controls button {
    background: transparent;
    border: none;
    cursor: pointer;
  }
  .toggle-collapse {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.1em;
  }
  

  /* Collapsible Scene Blocks */
.scene-box {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    margin-bottom: 15px;
  }
  .scene-box.collapsed .scene-body {
    display: none;
  }
  .scene-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    cursor: pointer;  /* allow clicking header to toggle */
  }
  .scene-header .thumb {
    width: 80px;
    height: auto;
    border-radius: 4px;
  }
  .partial-prompt {
    flex: 1;
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .mini-controls button,
  .toggle-collapse {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.1em; /* arrow slightly larger */
  }
  
  /* Subsection selection styles */
  .subsection-select {
    margin: 10px 0;
  }
  .subsection-select label {
    margin-right: 15px;
    cursor: pointer;
    font-weight: 500;
  }
  .subsection-content {
    display: none;
    margin-bottom: 15px;
  }
  .subsection-content.active {
    display: block;
  }
  
  /* (Ensure existing styles for .form-group, .generated-img-16-9, etc., remain in effect) */
  
  /*===================================
  Nested Scene Cards
====================================*/
.subsection {
    border: 1px solid #ddd;
    margin-bottom: 10px;
    border-radius: 6px;
    overflow: hidden;
  }


  .subsection-header {
    display: flex;
    justify-content: flex-start;
    background-color: rgba(255, 243, 205, 0.6); 
    padding: 8px 12px;
    background: #f7f7f7;
    font-weight: 500;
    border-radius: 4px;
  }
  .subsection-header:hover {
    background-color: rgba(255, 238, 156, 0.8);
  }
  .subsection-body {
    padding: 10px 12px;
  }



  /*===================================
  List of Generated Images
====================================*/

  .image-folders-box select {
    margin-bottom: 8px;
  }
  
  .image-preview-row {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 20px;
    margin: 10px 0;
    max-width: 100%;
    width: 100%;
    flex-wrap: wrap;
  }
  
  .image-frame {
    flex: 0 0 auto;
    width: 320px;
    max-width: 100%;
  }
  
  
  .image-frame img {
    width: 100%;
    height: auto;
    border-radius: 5px;
    border: 1px solid #ccc;
  }
  
  .image-folders-box {
    flex: 1;
    min-width: 240px;
    max-width: 100%;
    background-color: #f9f9f9;
    padding: 10px;
    border-radius: 6px;
    border: 1px dashed #ccc;
  }
  


  .scene-box {
    width: 100%;
    overflow-x: hidden;
  }
/*   
  .scene-body {
    max-width: 100%;
    overflow-x: auto;
  } */
  
  .image-preview-row {
    width: 100%;
    box-sizing: border-box;
  }
  

  .scene-body {
    max-width: 950px;
    margin-left: auto;
    margin-right: auto;
  }
  
  .scene-box {
    width: 100%;
    margin: 0 auto;
    max-width: 950px;
  }
  
  .scene-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
  }

  .image-preview-wrapper {
    width: 100%;
    max-width: 100%;
    display: flex;
    justify-content: center;
  }
  
  .image-preview-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    max-width: 880px; /* Same as your desired layout width */
    width: 100%;
  }
  



.image-label {
    position: absolute;
    top: 5px;
    right: 20px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 12px;
    padding: 2px 4px;
    border-radius: 3px;
    z-index: 5;
}




/* position the copy + refine buttons inside the textarea wrapper */
.copy-icon,
.refine-icon {
    position: absolute;
    top: 0.7rem;      /* align with the top of the textarea */
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
}

/* copy-icon sits to the right */
.copy-icon {
    right: 0.5rem;
}

/* refine-icon sits just left of the copy */
.refine-icon {
    right: 2.5rem;
}

/* optional: dim out disabled state */
.refine-icon:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}


/* More about buttons */
.loading-button {
    opacity: 0.7;
    cursor: not-allowed;
    display: inline-flex;       /* 🆕 keeps icon + text aligned */
    align-items: center;        /* 🆕 */
}

.spinner {
    display: inline-block;
    width: 14px;               /* slightly larger */
    height: 14px;
    border: 2px solid currentColor;  /* 🆕 use button text colour */
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;          /* keeps gap before "Search Internet" text */
}






/* ── Scene Control Bar ── */
.scene-control-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-top: 1px solid #ccc;
    margin-top: 16px;
}

.scene-control-bar .control-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 6px;
    border-radius: 4px;
    transition: background 0.2s;
}

.scene-control-bar .control-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.scene-control-bar .control-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.scene-control-bar .trim-input,
.scene-control-bar .speed-input {
    width: 48px;
    padding: 4px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9rem;
    text-align: center;
}

.scene-control-bar .previous-videos-select {
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95rem;
    min-width: 160px;
}



/* ========================= 
    Target section
========================= */

.delete-target-btn {
    position: absolute;
    top: 5px;
    left: 5px;
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 12;
    font-size: 16px;
}




/* ========================= 
    Linking Scene Thumbnails
========================= */


/* ░░ Scene-to-scene transition button ░░ */
.transition-btn{
  position:absolute;            /* sits inside .timeline-track */
  top: 6px;                     /* a bit above the thumbnails */
  width:24px;height:24px;
  border:none;
  background:#fff;
  border-radius:50%;
  box-shadow:0 1px 3px rgba(0,0,0,.35);
  display:flex;align-items:center;justify-content:center;
  font-size:14px;               /* icon size */
  cursor:pointer;
  transform:translateX(-50%);   /* centre on given .style.left */
  z-index:4;
}
.transition-btn:hover{ background:#fffae6; }


/* ░░ Scene-transition picker ░░ */
.transition-menu{
  position:absolute;
  background:#fff;
  border:1px solid #d0d0d0;
  border-radius:6px;
  box-shadow:0 3px 8px rgba(0,0,0,.2);
  padding:4px 0;
  font-size:14px;
  min-width:140px;
  z-index:10;
}
.transition-menu button{
  all:unset;
  display:block;
  width:100%;
  padding:6px 12px;
  cursor:pointer;
}
.transition-menu button:hover{
  background:#f0f4ff;
}









/* ───── crop handles ───── */
.crop-handle {
    position:absolute;
    top:0;
    width:4px;
    height:100%;
    background:rgba(0,0,0,.3);
    cursor:ew-resize;
    z-index:3;
}
.crop-handle.left  { left:-3px;  border-radius:3px 0 0 3px; }
.crop-handle.right { right:-3px; border-radius:0 3px 3px 0; }
.scene-block:hover .crop-handle   { background:rgba(0,0,0,.5); }

.crop-handle { width: 8px; cursor: ew-resize; }


/* live tooltip while trimming */
.crop-tooltip{
  position:fixed;            /* follows the mouse */
  pointer-events:none;       /* never steals clicks */
  background:#000; color:#fff;
  font:12px/1.4 sans-serif;
  padding:2px 6px; border-radius:4px;
  white-space:nowrap;
  z-index:9999;              /* always on top */
  display:none;
  opacity:.85;
}


.sfx-bar.selected { outline:2px solid #000; }
#sfx-inspector   { background:#f8f9fa; border:1px solid #ddd; }



.transition-icon {
  position: absolute;
  top: 80px;
  transform: translateX(-50%);
  background: #f9f9f9;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 12px;
  color: #555;
  font-weight: bold;
  z-index: 5;
  font-family: sans-serif;
  white-space: nowrap;
}
.transition-menu {
  position: absolute;
  z-index: 9999 !important;
  background: white;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  padding: 6px 0;
  min-width: 160px;
  font-size: 0.95rem;
  overflow: visible;
}
.transition-btn {
  z-index: 1000;
  background: white;
  border: 1px solid #ccc;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  text-align: center;
  font-weight: bold;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

#sketch-overlay{
  position:fixed; top:0; left:0; width:100%; height:4rem;
  background:rgba(0,0,0,.8); color:#fff; display:flex;
  align-items:center; gap:1rem; padding:0 1rem; z-index:5000;
}
.sketch-hidden{display:none}
#sketch-overlay .spinner{
  width:18px; height:18px; border:3px solid #fff;
  border-top:3px solid transparent; border-radius:50%;
  animation:spin .8s linear infinite;
}
@keyframes spin{to{transform:rotate(360deg)}}

/* ───── hide the progress bar until JS removes the class ───── */
.sketch-hidden{
  display:none !important;
}


/* ── Scenes - Automation Section ── */

.automation-section { background: #f6f8fc; border-radius: 8px; padding: 20px; box-shadow: 0 1px 8px rgba(0,0,0,0.05); }
.automation-col h3 { margin-top: 0; }
.auto-option { margin-bottom: 12px; display: flex; align-items: center; }
.coming-soon { color: #999; font-size: 0.95em; margin-left: 8px; }

.collapsible-bar {
  width: 100%;
  background: #e0e7ef;
  border: none;
  color: #2d3c5c;
  font-size: 1.17em;
  font-weight: 600;
  text-align: left;
  padding: 13px 20px;
  border-radius: 7px;
  cursor: pointer;
  box-shadow: 0 1px 6px rgba(0,0,0,0.07);
  outline: none;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 0;
}

.collapsible-bar:hover {
  background: #d1deed;
}

.collapsible-bar .chevron {
  font-size: 1.1em;
  transition: transform 0.3s;
}

.collapsible-bar[aria-expanded="true"] .chevron {
  transform: rotate(90deg);
}

/* (optional) tighten up spacing for the section below the bar */
.collapsible-automation .automation-section {
  margin-top: 0;
}




/* ───────── Modal (scene extension) ───────── */
.modal        { display:none; position:fixed; inset:0;
                background:rgba(0,0,0,0.6); z-index:1000;
                align-items:center; justify-content:center; }
.modal.show   { display:flex; }
.modal-content{ background:#fff; padding:24px 28px;
                border-radius:8px; width:92%; max-width:520px;
                position:relative; box-shadow:0 4px 16px rgba(0,0,0,0.25); }
.close-btn    { position:absolute; top:8px; right:12px;
                font-size:24px; cursor:pointer; }
.extend-scene-btn { margin-left:8px; font-size:1rem;
                    background:#f3f3f3; border:none; cursor:pointer;
                    border-radius:4px; padding:2px 6px; }
.extend-scene-btn:hover { background:#e0e0e0; }



.thumb-preview { text-align:center; margin-top:10px; }



/* ── overlay spinner ─────────────────────── */
.overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,.55); display: flex;
  flex-direction: column; align-items: center; justify-content: center;
  color: #fff; font-size: 1.1rem; text-align: center;
}
.overlay .spinner {
  border: 4px solid #fff; border-top: 4px solid transparent;
  border-radius: 50%; width: 42px; height: 42px;
  animation: spin 0.8s linear infinite; margin-bottom: 14px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.overlay.hidden { display: none; }




/* ===== B28: Alternating scene colors ===== */
#scenes-container .scene-box {
  background: #fff;              /* odd default */
  transition: background 0.2s ease;
}

/* Even scenes: soft tint so it’s easy to scan */
#scenes-container .scene-box:nth-child(even) {
  background: #f7fbff;           /* light bluish */
}

/* Optional: subtle left accent so edges line up in a long list */
#scenes-container .scene-box {
  border-left: 6px solid #e9ecef;   /* odd accent */
}
#scenes-container .scene-box:nth-child(even) {
  border-left-color: #d7e9ff;       /* even accent */
}





/* The form-group wrapping the textarea already has position:relative inline in HTML.
   If not guaranteed, uncomment:
.form-group { position: relative; }
*/

.prompt-left-controls {
  position: absolute;
  right: 8px;               /* bottom-right corner of the textarea block */
  bottom: 8px;
  display: flex;
  gap: 6px;
  z-index: 2;               /* below top-right copy/refine, above textarea bg */
}

.prompt-left-icon {
  background: rgba(0,0,0,0.7);
  color: #fff;
  border: none;
  padding: 6px 8px;
  font-size: 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: transform .1s ease, opacity .2s ease;
  opacity: 0.9;
}

.prompt-left-icon:hover { transform: scale(1.05); opacity: 1; }
.prompt-left-icon:disabled { opacity: 0.4; cursor: not-allowed; }

/* active state so users know which prompt they’re viewing */
.prompt-left-icon.active {
  background: #4A90E2;
  color: #fff;
}


/* Button row next to the original generator */
#generate-voiceovers-btn { margin-right: .5rem; }

/* Keep outline button visually consistent */
#refine-voiceovers-btn.btn-outline-secondary {
  border-width: 1px;
  padding: .5rem .9rem;
  line-height: 1.25;
}


.is-busy { opacity: .7; pointer-events: none; }



/* Version Control (public) widget */
.vc-widget { margin-top: 10px; padding: 8px; background: rgba(255,255,255,0.04); border-radius: 8px; }
.vc-header { font-weight: 600; font-size: 0.95rem; margin-bottom: 6px; opacity: 0.9; }
.vc-list { list-style: none; margin: 0; padding: 0; }
.vc-item { margin: 4px 0; }
.vc-link { display: flex; align-items: center; gap: 8px; text-decoration: none; color: inherit; }
.vc-link:hover { text-decoration: underline; }
.vc-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.7; display: inline-block; }
.vc-empty { opacity: 0.6; font-size: 0.9rem; }
.vc-article { max-width: 960px; margin: 0 auto; }
.vc-title { margin-bottom: 1rem; }
.vc-pre { background: #111; color: #eee; padding: 12px; border-radius: 8px; overflow-x: auto; }
.vc-md { white-space: pre-wrap; }


.vc-article { max-width: 980px; margin: 0 auto; line-height: 1.6; }
.vc-title { margin: 0 0 12px; }
.vc-md h1,.vc-md h2,.vc-md h3 { margin-top: 1.2em; }
.vc-md pre, .vc-md code { background: #111; padding: 10px; border-radius: 8px; overflow-x: auto; display: block; }
.vc-md table { border-collapse: collapse; width: 100%; }
.vc-md th, .vc-md td { border: 1px solid #333; padding: 6px 8px; }
.vc-md a { text-decoration: underline; }


/* ---- Version Control reader: left aligned + light theme ---- */
.main-content, .vc-article, .vc-md { text-align: left; }

.vc-article { max-width: 980px; margin: 12px auto; line-height: 1.65; }

.vc-md pre, .vc-md code {
  background: #f8fafc;   /* light */
  color: #222;            /* dark text */
  padding: 12px;
  border-radius: 8px;
  overflow-x: auto;
  display: block;
  border: 1px solid #e5e7eb;
}

.vc-md h1, .vc-md h2, .vc-md h3 { margin: 1.2em 0 .5em; }
.vc-md p, .vc-md ul, .vc-md ol { margin: .6em 0; }
.vc-md table { border-collapse: collapse; width: 100%; }
.vc-md th, .vc-md td { border: 1px solid #e5e7eb; padding: 6px 8px; }








/* Sidebar testing button */
.vc-btn {
  display: inline-block;
  margin-top: 8px;
  padding: 6px 10px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  font-size: 0.92rem;
}
.vc-btn:hover { background: rgba(255,255,255,0.14); }

/* Testing feedback form */
.card { background: rgba(255,255,255,0.04); border-radius: 12px; }
.p-4 { padding: 16px; }
.mb-2 { margin-bottom: 8px; }
.mt-3 { margin-top: 12px; }

.tf-form .form-row { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.tf-form label { font-weight: 600; }
.tf-form select, .tf-form textarea {
  background: #0f172a; /* matches your dark scheme */
  color: #e5e7eb;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 8px 10px;
}
.tf-form textarea { resize: vertical; }
.form-actions { display: flex; gap: 8px; margin-top: 8px; }

.btn { padding: 8px 12px; border-radius: 8px; border: 1px solid #334155; text-decoration: none; color: inherit; }
.btn.primary { background: #2563eb; border-color: #2563eb; color: #fff; }
.btn:hover { filter: brightness(1.05); }

.alert { padding: 8px 10px; border-radius: 8px; margin: 8px 0; }
.alert.success { background: #064e3b; color: #d1fae5; }
.alert.error { background: #7f1d1d; color: #fee2e2; }
.muted { opacity: .8; }
.small { font-size: .9rem; }






/***** B29 — Unified Buttons (global) *****/
:root{
  --btn-primary: #4A90E2;
  --btn-danger:  #DC3545;
  --btn-success: #16A34A;
  --btn-text:    #1f2937;
  --btn-border:  #cbd5e1;
  --btn-bg:      #ffffff;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:.5rem .9rem;
  font: 500 0.95rem/1.25 system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, sans-serif;
  border-radius:8px;
  border:1px solid var(--btn-border);
  background:var(--btn-bg);
  color:var(--btn-text);
  cursor:pointer;
  transition: background-color .15s ease, border-color .15s ease, filter .15s ease, opacity .15s ease;
}
.btn:hover{ filter:brightness(0.98); }
.btn:disabled{ opacity:.6; cursor:not-allowed; }

/* sizes */
.btn-sm{ padding:.35rem .6rem; font-size:.85rem; border-radius:7px; }

/* filled variants */
.btn-primary{ background:var(--btn-primary); border-color:var(--btn-primary); color:#fff; }
.btn-success{ background:var(--btn-success); border-color:var(--btn-success); color:#fff; }
.btn-danger { background:var(--btn-danger);  border-color:var(--btn-danger);  color:#fff; }

/* outline variants */
.btn-outline-primary  { background:#fff; color:var(--btn-primary); border-color:var(--btn-primary); }
.btn-outline-secondary{ background:#fff; color:#374151;          border-color:var(--btn-border); }
.btn-outline-success  { background:#fff; color:var(--btn-success); border-color:var(--btn-success); }
.btn-outline-danger   { background:#fff; color:var(--btn-danger);  border-color:var(--btn-danger); }

/* small cleanup for legacy rules that set odd paddings */
#refine-voiceovers-btn.btn-outline-secondary{ padding:.5rem .9rem; line-height:1.25; }


/* ── B29: Special Effects tabs ───────────────────────────── */
.fx-tabs { border: 1px solid #e5e7eb; border-radius: 10px; background: #fff; }
.fx-tab-list { display: flex; gap: 6px; padding: 8px; border-bottom: 1px solid #eee; flex-wrap: wrap; }
.fx-tab { padding: 8px 12px; border: 1px solid #ddd; border-radius: 8px; background: #f7f7f7; cursor: pointer; }
.fx-tab.active { background: #eef2ff; border-color: #c7d2fe; font-weight: 600; }
.fx-tab-panels { padding: 12px; }
.fx-tab-panel { display: none; }
.fx-tab-panel.active { display: block; }
.fx-fieldset { border: 1px dashed #ddd; border-radius: 8px; padding: 10px 12px; margin: 8px 0 12px; }

.fx-selected { color:#444; }

/* Subtle visual for a selected scene thumbnail */
.scene-block.selected img {
  box-shadow: 0 0 0 3px rgba(103, 143, 255, 0.8);
  border-radius: 6px;
}






/* ===== Selected Subsection badge + header colors ===== */
.mode-badge{
  margin-left: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid transparent;
  white-space: nowrap;
}

/* Badge color variants */
.mode-manual       { background:#FFF7E6; color:#92400E; border-color:#F59E0B; } /* amber */
.mode-upload       { background:#EEF2F7; color:#334155; border-color:#64748B; } /* slate */
.mode-merge-ultra  { background:#E6F4EA; color:#0F5132; border-color:#A3CFBB; } /* light green */
.mode-merge-logo   { background:#E7F1FF; color:#1E40AF; border-color:#93C5FD; } /* light blue */
.mode-plot-logo    { background:#F3E8FF; color:#5B21B6; border-color:#C4B5FD; } /* lavender */

/* Highlight the open subsection header with matching colors */
.subsection-header.active{ font-weight:600; }

.subsection-header.active[data-subsection="manual"]{
  background:#FFF7E6; border-left:4px solid #F59E0B;
}
.subsection-header.active[data-subsection="upload"]{
  background:#EEF2F7; border-left:4px solid #64748B;
}
.subsection-header.active[data-subsection="merge-ultra"]{
  background:#E6F4EA; border-left:4px solid #16A34A;
}
.subsection-header.active[data-subsection="merge-logo"]{
  background:#E7F1FF; border-left:4px solid #3B82F6;
}
.subsection-header.active[data-subsection="plot-logo"]{
  background:#F3E8FF; border-left:4px solid #8B5CF6;
}


.fx-tab-list .fx-tab + .fx-tab { margin-left: .35rem; }



.refine-wrap {
  display: none;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
}

.guide-select {
  height: 32px;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 0.95rem;
  background: var(--bg, #fff);
}



.caption-card{
  background:#fff8e1;           /* soft highlight */
  border:1px solid #ffd37a;
  border-radius:8px;
  padding:10px 12px;
  font-size:.95rem;
  line-height:1.45;
  white-space:pre-wrap;
}
.meta-line{
  margin-top:6px;
  color:#555;
  font-size:.9rem;
}


#progress-log {
    background: #f9f9f9;
    border: 1px solid #ddd;
    padding: 8px;
    border-radius: 5px;
    max-height: 150px;
    overflow-y: auto;
    margin-bottom: 10px;
    font-family: monospace;
}
#progress-log div {
    margin: 3px 0;
}

#b26-progress {
    margin: 12px 0;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fdfdfd;
    text-align: left;
}
#b26-progress strong { color: #333; }
#b26-progress ul { margin-top: 6px; padding-left: 20px; }


/* hard-lock while busy */
button.is-busy,
button[disabled] {
  pointer-events: none !important;
  cursor: not-allowed;
  opacity: 0.7;
}

.loading-button,
.is-busy {
  opacity: .7;
  cursor: not-allowed;
  pointer-events: none;   /* ← prevents accidental clicks on the hourglass */
}


.spinner { pointer-events: none; }


/* quick highlight for required guide selection */
.input-error {
  outline: 2px solid #ff4d4f;
  box-shadow: 0 0 0 3px rgba(255,77,79,.15);
}


/* B28 – busy button spinner */
/* .btn-primary.loading-button {
  position: relative;
  pointer-events: none;
  opacity: 0.9;
}
.btn-primary.loading-button::after {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-left: 8px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -3px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } } */

/* B28 – nudge the guide selector when missing */
.guide-select.input-error {
  outline: 2px solid #e67e22;
  box-shadow: 0 0 0 3px rgba(230,126,34,.15);
}

.guide-select.input-error {
  outline: 2px solid #e63946;   /* red highlight */
  border-color: #e63946;
}

/* B26: logo thumbnail */
.logo-thumb{
  width:50px;
  height:50px;
  object-fit:contain;
  margin-left:10px;
}
.logo-thumb--placeholder{
  opacity:0.5;
}
