/* public/css/style.css (Additions) */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  display: grid;
  place-content: center;
  min-height: 100vh;
  margin: 0;
  background-color: #121212;
  color: #e0e0e0;
  padding: 1rem;
  padding-top: 50px;
  box-sizing: border-box;
}

/* --- Login Page Specific --- */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.login-box {
  background-color: #1e1e1e;
  padding: 2.5rem;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 400px;
  text-align: center;
  border: 1px solid #333;
}

/* --- General Content Styling --- */
.main-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.content-box {
  background-color: #1e1e1e;
  padding: 2.5rem;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 900px; /* Wider for more content */
  text-align: center;
  border: 1px solid #333;
}

h2 {
  color: #00aaff;
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.75rem;
}

h3 {
  color: #e0e0e0;
  border-bottom: 1px solid #444;
  padding-bottom: 0.5rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
  text-align: left;
}

p {
  color: #888;
  margin-bottom: 2rem;
}

.input-group {
  margin-bottom: 1.5rem;
  text-align: left;
}

.input-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #ccc;
}

.input-group input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #444;
  border-radius: 8px;
  background-color: #2a2a2a;
  color: #e0e0e0;
  font-size: 1rem;
  box-sizing: border-box;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.input-group input:focus {
  outline: none;
  border-color: #00aaff;
  box-shadow: 0 0 0 3px rgba(0, 170, 255, 0.2);
}

.action-button,
.login-button {
  width: 100%;
  padding: 0.85rem;
  border: none;
  border-radius: 8px;
  background-color: #00aaff;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
  margin-top: 1.5rem;
}

.action-button:hover,
.login-button:hover {
  background-color: #0088cc;
}

.action-button:active,
.login-button:active {
  transform: scale(0.98);
}

/* --- Channel Selection Specific --- */
.channel-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.channel-option {
  display: block;
  background-color: #2a2a2a;
  border: 2px solid #444;
  border-radius: 10px;
  padding: 1.5rem 1rem;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

.channel-option:hover {
  border-color: #00aaff;
  background-color: #333;
}

.channel-option input[type="radio"] {
  display: none;
}

.channel-option input[type="radio"]:checked + .channel-info {
  border-color: #00aaff;
  box-shadow: 0 0 15px rgba(0, 170, 255, 0.3);
}

.channel-option.selected {
  border-color: #00aaff;
  background-color: #2c3e50;
}

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

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

.channel-name {
  font-weight: 600;
  color: #e0e0e0;
}

/* --- Newscast Page Specific --- */
.story-list {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 0.5rem;
  background-color: #2a2a2a;
  text-align: left;
}

.story-item {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #444;
  cursor: pointer;
  transition: background-color 0.2s;
}

.story-item:last-child {
  border-bottom: none;
}

.story-item:hover {
  background-color: #3c3c3c;
}

.story-item label {
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
}

.story-item input[type="radio"] {
  accent-color: #00aaff;
  width: 1.2em;
  height: 1.2em;
}

.story-title {
  font-weight: 500;
}

.story-snippet {
  font-size: 0.9em;
  color: #999;
  margin-top: 0.25rem;
}

#loading-indicator {
  display: block; /* Hidden by default */
  margin: 2rem auto;
  color: #888;
}

.newscaster-selection {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

/* --- Edit Script Page Specific --- */
#script-editor {
  width: 100%;
  min-height: 400px;
  padding: 1rem;
  border: 1px solid #444;
  border-radius: 8px;
  background-color: #2a2a2a;
  color: #e0e0e0;
  font-size: 1rem;
  line-height: 1.6;
  box-sizing: border-box;
  resize: vertical;
}

#script-editor:focus {
  outline: none;
  border-color: #00aaff;
  box-shadow: 0 0 0 3px rgba(0, 170, 255, 0.2);
}

/* --- Processing Page Specific --- */
#status-container {
  text-align: left;
}

#status-container h2 {
  text-align: center;
}

.job-item {
  display: flex; /* CHANGED from grid */
  flex-direction: column; /* CHANGED */
  gap: 10px; /* CHANGED */
  transition: border-color 0.3s, box-shadow 0.3s;
  align-items: center;
  background-color: #2a2a2a;
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid #333;
  margin-bottom: 1rem;
}

/* Override the old grid layout for the new structure */

.job-sentence {
  color: #e0e0e0;
}

.job-status {
  color: #888;
}

.job-status audio {
  max-width: 250px;
}

/* --- Visual Generation Page Specific --- */
.visuals-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.visual-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: stretch;
  background-color: #2a2a2a;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 1rem;
}

.sentence-editor {
  width: 100%;
  min-height: 150px;
  background-color: #1e1e1e;
  border: 1px solid #444;
  border-radius: 8px;
  color: #e0e0e0;
  padding: 1rem;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.5;
  resize: vertical;
}

.sentence-editor:focus {
  outline: none;
  border-color: #00aaff;
}

.image-item {
  position: relative;
  padding: 0;
  overflow: hidden;
  min-height: 150px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #1e1e1e;
}

.image-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s;
}

.image-item.loading img {
  opacity: 0.3;
}

.image-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 0.5rem;
  z-index: 10;
}

.retry-btn,
.upload-btn {
  background-color: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 30px;
  text-align: center;
  transition: transform 0.2s;
}

.retry-btn:hover,
.upload-btn:hover {
  transform: scale(1.1);
}

.retry-btn:disabled,
.upload-btn:disabled {
  cursor: not-allowed;
  background-color: rgba(0, 0, 0, 0.3);
}

.hidden-file-input {
  display: none;
}

.unused-images {
  border: 2px dashed #444;
  border-radius: 8px;
  padding: 1rem;
  min-height: 100px;
  margin-top: 2rem;
}

.unused-images h3 {
  margin-top: 0;
}

/* --- Finalize Page Specific --- */
.finalize-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.video-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: stretch;
}

.video-item {
  position: relative;
  min-height: 200px;
  background-color: #1e1e1e;
  border-radius: 8px;
}

.video-item video {
  width: 100%;
  height: 100%;
  border-radius: 8px;
}

.video-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  justify-content: center;
}

.video-controls select {
  background-color: #2a2a2a;
  color: #e0e0e0;
  border: 1px solid #444;
  border-radius: 8px;
  padding: 0.75rem;
}

/* --- Download Page Specific --- */
.download-video-container {
  width: 100%;
  max-width: 800px;
  margin: 0 auto 1.5rem auto;
}
/* --- Download Page Specific --- */
.download-video-container video {
  width: 100%;
  height: auto;
  border-radius: 8px;
}

#play-all-button {
  margin-bottom: 20px;
  width: auto; /* Allow button to size to content */
  padding: 0.75rem 1.5rem;
  display: block; /* Make it a block element */
  margin-left: auto;
  margin-right: auto;
}

/* Add a highlight for the currently playing track */
.job-item.playing {
  border-color: #00aaff;
  box-shadow: 0 0 8px rgba(0, 170, 255, 0.5);
}

.sentence-editor {
  width: 100%;
  min-height: 60px;
  padding: 10px;
  background-color: #2a2a2e;
  color: #f0f0f0;
  border: 1px solid #555;
  border-radius: 4px;
  font-family: inherit;
  font-size: 1rem;
  resize: vertical;
  box-sizing: border-box;
}

.sentence-editor:focus {
  outline: none;
  border-color: #00aaff;
}

.job-controls {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.job-status {
  flex-grow: 1; /* Take up remaining space */
}

/* Ensure the redo button doesn't stretch 100% width */
.job-controls .action-button {
  width: auto;
  margin-top: 0;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

.unused-images {
  border: 2px dashed #444;
  border-radius: 8px;
  padding: 1rem;
  min-height: 150px;
  margin-top: 2rem;
  text-align: center;
}

.unused-images h3 {
  margin-top: 0;
}

.unused-img {
  width: 100px;
  height: auto;
  margin: 0.5rem;
  border-radius: 4px;
  cursor: move;
  transition: transform 0.2s;
}

.unused-img:hover {
  transform: scale(1.05);
}

/* Drop zone feedback */
.image-item.drop-active {
  border: 2px dashed #00aaff;
}

.unused-images.drop-active {
  border: 2px dashed #00aaff;
}

/* Generate button */
#generate-missing {
  margin-bottom: 1rem;
}

/* ADD THESE STYLES AT THE END OF THE FILE */

/* --- Progress Bar Specific --- */
#progress-status {
  color: #ccc;
  margin-bottom: 0.75rem;
  font-size: 1rem;
  text-align: center;
}

.progress-bar-track {
  width: 100%;
  height: 20px;
  background-color: #2a2a2a;
  border: 1px solid #444;
  border-radius: 10px;
  overflow: hidden;
}

.progress-bar-fill {
  width: 0%;
  height: 100%;
  background-color: #00aaff;
  border-radius: 10px;
  transition: width 0.5s ease-in-out;
}

.video-controls {
  display: flex;
  flex-direction: row; /* Changed from column */
  align-items: center; /* Vertically center the items */
  gap: 1rem;
  justify-content: space-between; /* Puts space between items */
}

/* This makes the paragraph take up most of the space */
.video-controls p {
  flex-grow: 1;
  margin-bottom: 0; /* Remove bottom margin */
  text-align: left;
}

/* Style the new AI button to be smaller */
.ai-animate-btn {
  width: auto; /* Allow button to size to its content */
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  margin-top: 0; /* Remove top margin */
  flex-shrink: 0; /* Prevent the button from shrinking */
}

/* --- ADDITIONS FOR WELCOME PAGE --- */

/* Ensures the .action-button looks correct as an <a> tag */
.action-button {
  text-decoration: none;
  box-sizing: border-box; /* Ensures padding doesn't break width */
  display: inline-block; /* Required for <a> tag to respect padding */
}

/* Container for the smaller buttons */
.button-group {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

/* Style for the smaller "Manage" buttons */
.secondary-button {
  width: auto; /* Not full width */
  padding: 0.75rem 1.5rem;
  border: 1px solid #444;
  border-radius: 8px;
  background-color: #2a2a2a;
  color: #ccc;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s, border-color 0.3s;
  text-decoration: none;
}

.secondary-button:hover {
  background-color: #333;
  border-color: #555;
  color: #fff;
}

/* A simple CSS spinner */
.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #444; /* Light grey track */
  border-top-color: #00aaff; /* Blue spinner */
  border-radius: 50%;
  display: inline-block;
  animation: spin 1s linear infinite;
}

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

/* === Auto-Hiding Header === */
.app-header {
  position: fixed;
  /* Change: Hide fully off-screen (height is 50px) */
  top: -50px; 
  left: 0;
  width: 100%;
  height: 50px;
  background-color: #1e1e1e;
  border-bottom: 1px solid #333;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2.5rem;
  z-index: 1000;
  transition: top 0.3s ease-in-out;
  box-sizing: border-box;
  
  /* CRITICAL: Allows the little box to be seen while header is hidden */
  overflow: visible; 
}

/* When hovering the header OR the trigger box inside it, slide down */
.app-header:hover {
  top: 0;
}

.header-title {
  color: #00aaff;
  font-size: 1.25rem;
  font-weight: 600;
  text-decoration: none;
}

.header-nav {
  display: flex;
  gap: 1rem;
}

.header-nav .secondary-button {
  margin-top: 0;
  width: auto;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

/* --- NEW: The small hover box with arrow --- */
.header-trigger {
  position: absolute;
  /* Hang it off the bottom of the header */
  bottom: -20px; 
  left: 50%;
  transform: translateX(-50%);
  
  /* Size of the box */
  width: 40px; 
  height: 20px;
  
  /* Look and Feel */
  background-color: #1e1e1e;
  border: 1px solid #333;
  border-top: none; /* Make it blend with header */
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.2);
  
  /* Centering the arrow */
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #00aaff;
  font-size: 10px;
  transition: background-color 0.2s;
}

.header-trigger:hover {
  background-color: #2a2a2a;
}

/* Optional: Flip the arrow when menu is open */
.app-header:hover .header-trigger span {
  transform: rotate(180deg);
  transition: transform 0.3s;
}
/* === End Header === */

/* === Footer === */
.app-footer {
  width: 100%;
  max-width: 900px; /* Match your .content-box width */
  margin: 2rem auto 1rem auto;
  padding: 1.5rem 0;
  border-top: 1px solid #333;
  text-align: center;
  color: #888;
  font-size: 0.9rem;
}

.app-footer nav {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 0.5rem;
}

.app-footer nav a {
  color: #aaa;
  text-decoration: none;
  transition: color 0.2s;
}

.app-footer nav a:hover {
  color: #00aaff;
  text-decoration: underline;
}

/* --- Account Page Styles --- */

.account-section {
  margin-bottom: 30px;
}

.account-form {
  display: flex;
  flex-direction: column;
  max-width: 400px;
  margin-bottom: 20px;
}

.account-form label {
  margin-bottom: 5px;
  font-weight: bold;
  color: #eee;
}

.account-form input[type="email"],
.account-form input[type="password"],
.account-form input[type="url"] {
  padding: 10px;
  font-size: 16px;
  border: 1px solid #555;
  border-radius: 5px;
  background: #3e3e3e;
  color: #fff;
  margin-bottom: 15px;
}

.password-input-group {
  position: relative;
  display: flex;
}

.password-input-group input {
  flex-grow: 1;
  margin-bottom: 15px; /* Match other inputs */
}

.toggle-password-btn {
  position: absolute;
  right: 1px;
  top: 1px;
  bottom: 16px; /* Align with input */
  background: #555;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 0 12px;
  border-top-right-radius: 5px;
  border-bottom-right-radius: 5px;
}
.toggle-password-btn:hover {
  background: #666;
}
.toggle-password-btn .fa-eye-slash {
  display: none; /* Hide slash icon by default */
}

.form-message {
  margin-top: 10px;
  font-size: 14px;
}
.form-message.success {
  color: #2ecc71;
}
.form-message.error {
  color: #e74c3c;
}

/* --- Account Page Centering Fix --- */

/* This targets the new class we just added */
.profile-section {
  text-align: center;
}

/* This overrides the global h3 style for this section ONLY */
.profile-section h3 {
  text-align: center;
  border-bottom: none; /* Removes the left-aligned border */
}

/* This centers the forms themselves */
.profile-section .account-form {
  margin-left: auto;
  margin-right: auto;
}

/* --- Channel List Styles --- */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.small-button {
  padding: 8px 12px;
  font-size: 14px;
}

.channel-item {
  display: flex;
  align-items: center;
  justify-content: space-between; /* <-- ADD THIS */
  position: relative; /* <-- ADD THIS */
  background: #3e3e3e;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 15px;
}

.channel-item .channel-icon {
  width: 50px;
  height: 50px;
  border-radius: 5px;
  object-fit: cover;
  /* margin-right: 15px; <-- REMOVED */
}

.channel-details {
  /* flex-grow: 1; <-- REMOVED */
  text-align: center;

  /* ADD THESE 3 LINES */
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.channel-details strong {
  display: block;
  font-size: 18px;
  margin-bottom: 10px;
}

.channel-actions {
  display: flex;
  gap: 10px;
}

.edit-btn {
  background: #3498db;
  text-decoration: none;
  line-height: 1.5; /* Align with buttons */
}
.edit-btn:hover {
  background: #2980b9;
}

/* --- Account Page My Channels Fix --- */

/* This targets the new class we added */
.my-channels-section .section-header {
  justify-content: center; /* This centers the h3 */
}

/* This overrides the global h3 style for this section ONLY */
.my-channels-section h3 {
  text-align: center;
  border-bottom: none; /* Removes the left-aligned border */
}

/* --- Danger Zone --- */
.danger-zone {
  border: 2px solid #e74c3c;
  border-radius: 8px;
  padding: 20px;
  background: rgba(231, 76, 60, 0.1);
}
.danger-zone p {
  color: #f0f0f0;
}
.danger-button {
  background: #e74c3c;
}
.danger-button:hover {
  background: #c0392b;
}

/* --- Account Page Danger Zone Fix --- */

/* This centers the 'Danger Zone' h3 */
.danger-zone-section h3 {
  text-align: center;
  border-bottom: none;
}

/* --- Edit Channel Page Styles --- */

.back-link {
  display: inline-block;
  color: #aaa;
  text-decoration: none;
  margin-bottom: 20px;
}
.back-link:hover {
  color: #fff;
}

/* --- Newscaster Card Styles --- */
.newscaster-card {
  background: #3e3e3e;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid #555;
}

.newscaster-grid {
  display: grid;
  grid-template-columns: 200px 1fr; /* Column for thumbnail, column for details */
  gap: 20px;
  margin-bottom: 20px;
}

.newscaster-details {
  display: flex;
  flex-direction: column;
}

/* Drag & Drop Thumbnail */
.drop-zone {
  width: 200px;
  height: 200px;
  border: 2px dashed #777;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  background: #2c2c2c;
  color: #aaa;
  position: relative;
  cursor: pointer;
  overflow: hidden; /* Hide the file input */
}
.drop-zone.drag-over {
  background: #444;
  border-color: #fff;
}
.drop-zone .thumb-preview {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none; /* Hidden by default */
}
.drop-zone .thumb-preview.active {
  display: block; /* Show if an image is present */
}
.drop-zone span {
  padding: 10px;
  z-index: 1; /* Stay on top of image */
}
.drop-zone .thumb-upload-input {
  /* Hide the actual file input */
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* Intro/Outro Section */
.intro-outro-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.intro-outro-section video {
  width: 100%;
  border-radius: 5px;
  background: #2c2c2c;
  margin-bottom: 10px;
}

.newscaster-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.newscaster-actions .form-message {
  margin: 0;
}

/* --- Welcome Page Additions --- */
.credit-info {
  font-size: 1.1rem;
  color: #ccc;
  margin: 20px 0;
}
.credit-info strong {
  color: #fff;
}
.logout-link {
  display: inline-block;
  color: #aaa;
  margin-top: 30px;
  text-decoration: none;
  cursor: pointer;
}
.logout-link:hover {
  color: #fff;
  text-decoration: underline;
}

/* This targets the new class we just added */
.newscaster-edit-section .section-header {
  justify-content: center; /* This centers the h3 */
}

/* This overrides the global h3 style for this section ONLY */
.newscaster-edit-section h3 {
  text-align: center;
  border-bottom: none; /* Removes the left-aligned border */
}

textarea.sentence-editor {
  width: 100%;
  min-height: 150px;
  padding: 1rem;
  border: 1px solid #444;
  border-radius: 8px;
  background-color: #2a2a2a;
  color: #e0e0e0;
  font-size: 1rem;
  line-height: 1.6;
  box-sizing: border-box;
  resize: vertical;
}

textarea.sentence-editor:focus {
  outline: none;
  border-color: #00aaff;
  box-shadow: 0 0 0 3px rgba(0, 170, 255, 0.2);
}

/* --- Fix for Textarea Dark Mode --- */

textarea {
  width: 100%;
  min-height: 80px; /* You can adjust this height */
  padding: 0.75rem;
  border: 1px solid #444;
  border-radius: 8px;
  background-color: #2a2a2a;
  color: #e0e0e0;
  font-size: 1rem;
  box-sizing: border-box;
  font-family: inherit; /* Makes it use the same font as your site */
  transition: border-color 0.3s, box-shadow 0.3s;
  resize: vertical;
}

textarea:focus {
  outline: none;
  border-color: #00aaff;
  box-shadow: 0 0 0 3px rgba(0, 170, 255, 0.2);
}

/* Add this to style.css */
.video-upload-input {
    display: none;
}

/* --- Password Toggle Eye --- */
.password-wrapper {
  position: relative;
}

/* Make space for the icon */
.password-wrapper input[type="password"],
.password-wrapper input[type="text"] {
  padding-right: 40px; 
}

.toggle-password {
  position: absolute;
  top: 50%;
  right: 15px;
  transform: translateY(-50%);
  cursor: pointer;
  user-select: none; /* Prevents text selection */
  font-size: 1.2rem;
}

/* --- Subscription Button Visibility --- */
.subscribe-btn {
  margin-top: -1rem;
  margin-bottom: 2rem;
  display: block; /* default: visible */
}

.subscribe-btn.hidden {
  display: none;
}

/* --- Manage Billing Button Visibility --- */
.manage-billing-btn {
  margin-top: -1rem;
  margin-bottom: 2rem;
  display: block; /* default: visible */
}

.manage-billing-btn.hidden {
  display: none;
}

/* ---- CENTRE THE ACTIVE BILLING BUTTON ---- */
.billing-button-wrapper {
  display: flex;
  justify-content: center;   /* horizontal centre */
  align-items: center;       /* vertical centre (optional) */
  margin-top: -1rem;         /* keep your original top spacing */
  margin-bottom: 2rem;       /* keep your original bottom spacing */
}

/* Keep the same margins on the buttons themselves (so they behave like before) */
.subscribe-btn,
.manage-billing-btn {
  margin: 0;                 /* reset any inherited margins */
}

/* Remove gap between "What would you like to do today?" and the big button */
.no-bottom-margin {
  margin-bottom: 0 !important;
}


/* --- Add This Modal CSS --- */

/* The Modal (background) */
.modal {
  display: none; /* Hidden by default */
  position: fixed; /* Stay in place */
  z-index: 1000; /* Sit on top */
  left: 0;
  top: 0;
  width: 100%; /* Full width */
  height: 100%; /* Full height */
  overflow: auto; /* Enable scroll if needed */
  background-color: rgb(0, 0, 0); /* Fallback color */
  background-color: rgba(0, 0, 0, 0.6); /* Black w/ opacity */
  padding-top: 60px;
}

/* Modal Content/Box */
.modal-content {
  background-color: #1e1e1e; /* Dark background for the box */
  margin: 5% auto; /* 5% from the top and centered */
  padding: 2rem;
  border: 1px solid #444;
  width: 90%;
  max-width: 500px; /* Max width */
  border-radius: 8px;
  position: relative;
  color: #eee;
}

/* The Close Button */
.close-button {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  position: absolute;
  top: 10px;
  right: 20px;
}

.close-button:hover,
.close-button:focus {
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}

/* Plan categories inside modal */
.plan-category {
  margin-top: 1.5rem;
}
.plan-category h3 {
  margin-bottom: 0.5rem;
  color: #fff;
}

.billing-section {
  text-align: center; /* This will center the <p> and <button> inside it */
}

/* Fix for long voice names in the edit-channel dropdown */
.voice-code-select {
  min-width: 300px;
  max-width: 100%; /* Ensures it doesn't break your layout on small screens */
  
  /* This will show '...' if the text is still somehow too long */
  text-overflow: ellipsis; 
}

/* Intro / Outro video previews */
.video-preview-container {
    margin: 10px 0;
    min-height: 100px;
    background: #2c2c2c;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.intro-outro-preview {
    width: 100%;
    max-height: 180px;
    object-fit: contain;
    background: #000;
}

.no-video {
    color: #888;
    font-style: italic;
    margin: 0;
    padding: 2rem 0;
    text-align: center;
}

.no-video.error {
    color: #e74c3c;
}

/* Make the Replace buttons full width under the preview */
.replace-intro-btn,
.replace-outro-btn {
    width: 100%;
    margin-top: 8px;
}

/* --- FIX FOR PLANS MODAL LAYOUT --- */

/* 1. Make the modal wider to fit the cards */
.modal-content {
  max-width: 1000px !important; /* Increased from 500px */
  width: 95%;
}

/* 2. Allow the buttons/cards to wrap to the next line */
.plan-category .button-group {
  display: flex;
  flex-wrap: wrap; /* CRITICAL: Allows items to drop to next line */
  justify-content: center;
  gap: 1.5rem; /* Space between cards */
}

/* 3. Style the Plan Buttons to look like "Cards" */
.plan-btn {
  /* Flex grow, shrink, basis */
  flex: 1 1 200px; 
  
  /* Ensure they don't get too small or too huge */
  min-width: 200px; 
  max-width: 280px;
  
  /* Card styling */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
  height: 100%; /* Make them same height in a row */
  
  /* Reset margin issues */
  margin: 0 !important; 
  
  /* Visual polish */
  background-color: #2a2a2a;
  border: 1px solid #444;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.plan-btn:hover {
  transform: translateY(-2px);
  border-color: #00aaff;
  box-shadow: 0 6px 12px rgba(0, 170, 255, 0.2);
}

.plan-btn strong {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  display: block;
}

/* Make the credits text pop */
.credits-info {
  display: block;
  margin-top: 0.5rem;
  font-weight: bold;
  background: rgba(76, 175, 80, 0.1); /* Subtle green bg */
  color: #4caf50;
  padding: 4px 8px;
  border-radius: 4px;
}

/* --- Center Plans Modal Headings --- */
.plan-category h3 {
  text-align: center;
  margin-top: 0; /* Optional: Removes extra space above */
}

/* Add to bottom of style.css */

.btn-loader {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite; /* Reuses your existing spin keyframe */
  vertical-align: middle;
  margin-left: 10px;
}

/* Highlight the selected image */
.selected-for-paste {
    outline: 4px solid #007bff; /* Bright blue outline */
    outline-offset: 2px;
    border-radius: 4px;
    transform: scale(1.02);
    transition: transform 0.2s ease;
}

/* Optional: change cursor to show it's "placeable" */
.image-item.ready-to-receive {
    cursor: cell;
    background-color: rgba(0, 123, 255, 0.1);
}

      /* --- NEW STYLES FOR SELECTION FEATURE --- */
      .selected-for-paste {
        outline: 4px solid #007bff !important;
        outline-offset: -4px;
        box-shadow: 0 0 15px rgba(0, 123, 255, 0.6);
        transform: scale(0.98);
        transition: all 0.2s ease;
      }
      .unused-img, .image-item { cursor: pointer; }
      
      /* Visual cue when hovering over a drop zone while holding an image */
      body.has-selection .image-item:hover {
        border: 2px dashed #007bff;
        background-color: rgba(0, 123, 255, 0.1);
      }