/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* Keyframe animations */
@keyframes fadeInUp {
   0% {
      opacity: 0;
      transform: translateY(20px);
   }
   100% {
      opacity: 1;
      transform: translateY(0);
   }
}

@keyframes fadeIn {
   0% { opacity: 0; }
   100% { opacity: 1; }
}

/* Glassmorphic floating animation */
@keyframes float {
   0%, 100% { transform: translateY(0px); }
   50% { transform: translateY(-4px); }
}

.float-animation {
   animation: float 3s ease-in-out infinite;
}

/* Stagger animation delays for each card */
.float-delay-1 { animation-delay: 0s; }
.float-delay-2 { animation-delay: 0.5s; }
.float-delay-3 { animation-delay: 1s; }
.float-delay-4 { animation-delay: 1.5s; }
.float-delay-5 { animation-delay: 2s; }

/* Custom backdrop blur for better browser support */
.glass-card {
   backdrop-filter: blur(16px);
   -webkit-backdrop-filter: blur(16px);
}

/* Set root font size to respect user preferences */
html {
   font-size: 100%; /* Allows users to adjust base font size in browser settings */
}

body {
   /* Subtle gradient background for glassmorphic effect */
   background: linear-gradient(135deg,
   #ffffff 0%,
   #ebf5fb 25%,
   #ffffff 50%,
   #e7e3f5 75%,
   #def9e3 100%);
   background-size: 300% 100%;
   animation: gradientShift 20s ease-in-out infinite;

   color: #1f2937; /* Dark text color */
   font-family: 'Inter', sans-serif;
   font-size: 1rem; /* Base font size using relative units */
   line-height: 1.5; /* Improved line height for readability */
   margin: 0;
   padding: 0;
   overflow: hidden;
   height: 100vh;
   display: flex;
   flex-direction: column;
   position: relative;
}

/* Subtle background animation for depth */
@keyframes gradientShift {
   0% { background-position: 0% 50%; }
   50% { background-position: 100% 50%; }
   100% { background-position: 0% 50%; }
}

/* Add a subtle overlay for better glass effect visibility */
body::before {
   content: '';
   position: fixed;
   top: 0;
   left: 0;
   right: 0;
   bottom: 0;
   background: rgba(255, 255, 255, 0.02);
   pointer-events: none;
   z-index: 0;
}

/* Global link styling - no underlines */
a, a:hover, a:visited, a:active {
   text-decoration: none;
}

#app {
   display: flex;
   flex-direction: column;
   height: 100%;
   overflow: hidden;
}

#main-app {
   display: flex;
   width: 100%;
   height: 100vh;
   overflow: hidden;
   justify-content: center;
   align-items: center;
   padding: 20px;
   transition: all 0.3s ease-in-out;
}

#main-app.player-visible {
   justify-content: flex-start;
   padding: 0;
}

.hidden {
   display: none !important;
}

/* Interaction Area - Glassmorphic Design */
#interaction-area {
   width: 1200px;
   max-width: 1200px;
   height: 100vh;
   background: rgba(255, 255, 255, 0.1);
   backdrop-filter: blur(20px);
   -webkit-backdrop-filter: blur(20px);
   border: 1px solid rgba(255, 255, 255, 0.2);
   border-radius: 16px;
   display: flex;
   flex-direction: column;
   min-width: 400px;
   box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
   overflow: auto;
   position: relative;
   transition: all 0.3s ease-in-out;
   margin: auto;
   z-index: 1;
}

#main-app.player-visible #interaction-area {
   width: 400px;
   min-width: 400px;
   max-width: 600px;
   height: 100vh;
   margin: 20px;
   top: 30px;
}

/* Adjust vertical alignment of the logo */
#screencast-logo {
   transform: translateY(-4px); /* Fine-tune alignment */
   transition: fill 0.5s ease-in-out; /* Smooth transition for color changes */
}

#screencast-logo.loading #logo-black {
   fill: url(#gradient-animation); /* Apply gradient during loading */
}

#screencast-logo.loading #logo-gold {
   fill: url(#gradient-animation); /* Apply gradient during loading */
}

@keyframes gradient-animation {
   0% {
      stop-color: #ff00f7;
   }
   50% {
      stop-color: #ffd900;
   }
   100% {
      stop-color: #ff00cc;
   }
}

/* SVG Gradient Definition */
#screencast-logo defs {
   animation: gradient-animation 0.2s infinite;
}

.area-title {
   padding: 20px 20px 0px 20px;
   display: flex;
   align-items: center;
   justify-content: space-between;
   position: relative;
   border-top-left-radius: 12px;
   border-top-right-radius: 12px;
   animation: fadeIn 0.8s ease-out;
}

.area-title .logo-container {
   display: flex;
   align-items: center;
   gap: 8px;
   animation: fadeInUp 0.8s ease-out;
}

.area-title span {
   font-size: 18px;
   font-weight: 600;
   color: #111827;
}

.header-controls {
   display: flex;
   gap: 8px;
   align-items: center;
}

.header-controls button {
   background: none;
   border: none;
   cursor: pointer;
   font-size: 16px;
   color: #6b7280;
   transition: color 0.2s ease;
   padding: 6px;
   border-radius: 6px;
   display: flex;
   align-items: center;
   justify-content: center;
}

.header-controls button:hover {
   color: #111827;
   background: rgba(0, 0, 0, 0.05);
}

.header-controls input[type="checkbox"] {
   margin: 0 4px;
}

.header-controls label {
   font-size: 0.875rem; /* 14px at default size, but scalable */
   color: #6b7280;
}

#chat-area {
   flex: 1;
   display: flex;
   flex-direction: column;
   margin-bottom: 16px;
   overflow-y: hidden;
   background: rgba(255, 255, 255, 0.7);
}

/* #chat-history {
    flex: 1 1 auto;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow-y: auto;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    position: relative;
    width: 100%;
    height: 100%;
} */

.chat-message {
   background: #ffffff;
   border-radius: 8px;
   padding: 8px;
   box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
   font-family: 'Inter', sans-serif;
   font-size: 0.875rem; /* 14px at default size, but scalable */
   line-height: 1.6; /* Improved line height for readability */
}

.chat-message pre {
   background: #f9fafb;
   border-radius: 4px;
   padding: 6px;
   overflow-x: auto;
   font-family: 'Inter', sans-serif;
}

#chat-message {
   width: 100%;
   background: transparent;
   border: none;
   border-radius: 20px;
   padding: 20px;
   font-size: 20px;
   font-weight: 400;
   color: #1f2937;
   resize: none;
   height: 100px;
   box-sizing: border-box;
   transition: all 0.2s ease;
   font-family: 'Inter', sans-serif;
}

#chat-message::placeholder {
   color: #9ca3af;
   font-size: 20px;
   font-weight: 400;
   font-family: 'Inter', sans-serif;
}

#chat-message:focus {
   outline: none;
   background: #ffffff;
}

.upload-image-button {
   min-width: 160px;
   background: #ffffff;
   color: #6B7280;
   display: flex;
   align-items: center;
   gap: 8px;
   padding: 12px 20px;
   font-size: 14px;
   cursor: pointer;
   transition: all 0.2s ease;
   border: 1px solid #e5e7eb;
   border-radius: 8px;
   white-space: nowrap;
}

.upload-image-button:hover {
   background: #f9fafb;
   color: #111827;
}

.button-list {
   display: flex;
   gap: 8px;
   flex-wrap: wrap;
   align-items: center;
}

button {
   background: #1f2937; /* Dark button background */
   border: none;
   color: white;
   font-size: 14px;
   font-weight: 500;
   padding: 8px 16px;
   border-radius: 8px;
   cursor: pointer;
   transition: background 0.2s ease;
}

button:hover {
   background: #111827; /* Darker on hover */
}

button:disabled {
   background: #9ca3af;
   cursor: not-allowed;
}

#library-area {
   display: flex;
   flex-direction: column;
   gap: 12px;
   padding: 16px;
   border-top: 1px solid #e5e7eb;
   background: #ffffff;
}

#library-area select {
   width: 100%;
   padding: 8px;
   border: 1px solid #e5e7eb;
   border-radius: 8px;
   background: #f9fafb;
}

#library-area button {
   align-self: flex-start;
}

/* Player Area */
#player-area {
   flex: 1;
   display: flex;
   flex-direction: column;
   overflow: hidden;
   padding: 1.5rem;
   transform: translateX(100%);
   opacity: 0;
   transition: all 0.3s ease-in-out;
   display: none;
}

#main-app.player-visible #player-area {
   transform: translateX(0);
   opacity: 1;
   display: flex;
   height: 100vh;
}

.canvas-container {
   position: relative;
   width: 100%;
   flex: 1;
   min-height: 0;
   border-top-left-radius: 12px;
   border-top-right-radius: 12px;
   overflow: hidden;
   display: flex;
   justify-content: center;
   align-items: center;
   background: #000000;
   /* Dynamic height: viewport minus sticky header and controls */
   max-height: calc(100vh - 100px - 80px - 20px);
}

#demoCanvas {
   display: block;
   max-width: 100%;
   max-height: 100%;
   height: auto;
   border-radius: 8px;
}

/* Playback Controls */
.playback-controls {
   position: sticky;
   bottom: 0;
   padding: 16px;
   background: rgba(255, 255, 255, 0.95);
   backdrop-filter: blur(8px);
   -webkit-backdrop-filter: blur(8px);
   border-radius: 0 0 20px 20px;
   border-top: 1px solid rgba(0, 0, 0, 0.1);
   z-index: 100;
   min-height: 64px;
}

/* Progress Bar Styles */
.progress-bar {
   position: relative;
   width: 100%;
   height: 4px;
   margin-bottom: 24px;
   display: flex;
   align-items: center;
   gap: 8px;
}

.progress-bar .control-button {
   flex-shrink: 0;
}

.video-duration {
   flex-shrink: 0;
   font-size: 14px;
   color: #666;
   font-family: monospace;
   min-width: 40px;
   text-align: right;
}

.slider {
   flex-grow: 1;
   -webkit-appearance: none;
   appearance: none;
   height: 4px;
   background: #e0e0e0;
   outline: none;
   border-radius: 2px;
   transition: background 0.2s;
}

.slider::-webkit-slider-thumb {
   -webkit-appearance: none;
   width: 16px;
   height: 16px;
   border-radius: 50%;
   background: white;
   border: 2px solid #333;
   cursor: pointer;
   transition: all 0.2s;
}

.slider::-webkit-slider-thumb:hover {
   transform: scale(1.2);
}

/* Add Firefox support */
.slider::-moz-range-thumb {
   width: 16px;
   height: 16px;
   border-radius: 50%;
   background: white;
   border: 2px solid #333;
   cursor: pointer;
   transition: all 0.2s;
}

.slider::-moz-range-thumb:hover {
   transform: scale(1.2);
}

/* Control Buttons Styles */
.control-buttons {
   display: flex;
   justify-content: center;
   gap: 24px;
   margin-top: 16px;
}

.control-button {
   background: white;
   border: 1px solid #333;
   border-radius: 50%;
   width: 40px;
   height: 40px;
   display: flex;
   align-items: center;
   justify-content: center;
   cursor: pointer;
   transition: all 0.2s;
   padding: 0;
}

.control-button:hover {
   background: #f8f8f8;
}

.control-button i {
   font-size: 16px;
   color: #333;
}

#play-pause-button {
   width: 48px;
   height: 48px;
}

#play-pause-button i {
   font-size: 18px;
}

/* Progress dot animation */
.progress-dot {
   position: absolute;
   top: 0;
   left: 0;
   width: 4px;
   height: 4px;
   background: #666;
   border-radius: 50%;
   transform: translateX(-50%);
   pointer-events: none;
}

/* Lua Runner Console */
#lua-section {
   position: fixed;
   top: 50%;
   left: 50%;
   transform: translate(-50%, -50%);
   width: 80%;
   height: 80%;
   max-width: 1600px;
   background: #1e1e1e;
   border-radius: 8px;
   box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
   z-index: 9999;
   display: flex;
   flex-direction: column;
   transition: all 0.3s ease;
   overflow: hidden;
}

#lua-section.hidden {
   display: none !important;
}

.lua-overlay {
   position: fixed;
   top: 0;
   left: 0;
   right: 0;
   bottom: 0;
   background: rgba(0, 0, 0, 0.5);
   z-index: 999;
   backdrop-filter: blur(2px);
   display: none;
}

.lua-overlay.visible {
   display: block;
}

.lua-header {
   background: #252526;
   color: #ffffff;
   padding: 12px 20px;
   border-bottom: 1px solid #333333;
   display: flex;
   justify-content: space-between;
   align-items: center;
}

.lua-header h3 {
   margin: 0;
   font-size: 16px;
   font-weight: 500;
   color: #ffffff;
}

#running-lua {
   display: flex;
   flex-direction: column;
   flex: 1;
   overflow: hidden;
   gap: 8px;
   padding: 16px;
   height: calc(100% - 60px);
}

#lua-script {
   flex: 1;
   position: relative;
   width: 100%;
   height: 100%;
   min-height: 0;
}

#lua-output {
   height: 150px;
   background: #252526;
   border: 1px solid #333333;
   border-radius: 4px;
   color: #d4d4d4;
   font-family: 'Consolas', 'Monaco', monospace;
   padding: 12px;
   resize: vertical;
   min-height: 100px;
}

.lua-header .header-controls {
   display: flex;
   gap: 12px;
   align-items: center;
}

.lua-header .header-controls button {
   background: transparent;
   border: 1px solid #454545;
   color: #d4d4d4;
   padding: 6px 12px;
   border-radius: 4px;
   font-size: 13px;
   display: flex;
   align-items: center;
   gap: 6px;
   transition: all 0.2s ease;
}

.lua-header .header-controls button:hover {
   background: #454545;
   color: #ffffff;
}

.lua-header .header-controls button i {
   font-size: 14px;
}

/* Vim mode toggle styling */
.lua-header .header-controls .vim-toggle {
   display: flex;
   align-items: center;
   gap: 6px;
   color: #d4d4d4;
}

.lua-header .header-controls .vim-toggle input[type="checkbox"] {
   accent-color: #007acc;
}

/* Modern Glyph Buttons */
button.icon-button {
   display: inline-flex;
   align-items: center;
   justify-content: center;
   padding: 8px;
   width: 40px;
   height: 40px;
   background: #1f2937;
   color: white;
   border: none;
   border-radius: 50%;
   cursor: pointer;
   transition: background 0.2s ease;
}

button.icon-button:hover {
   background: #111827;
}

button.icon-button:disabled {
   background: #9ca3af;
   cursor: not-allowed;
}

/* Modern File Input Styling */
.modern-file-input {
   position: relative;
   display: inline-block;
   margin: 4px;
   min-width: 120px;
   height: 36px;
}

.modern-file-label {
   display: inline-flex;
   align-items: center;
   gap: 8px;
   padding: 8px 16px;
   background: #1f2937;
   color: white;
   border-radius: 8px;
   font-size: 14px;
   font-weight: 500;
   cursor: pointer;
   transition: all 0.2s ease;
   width: 100%;
   height: 100%;
}

.modern-file-label:hover {
   background: #111827;
   transform: translateY(-1px);
}

.modern-file-label svg {
   width: 16px;
   height: 16px;
}

#add-source-button {
   position: absolute;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
   opacity: 0;
   cursor: pointer;
   z-index: 1;
}

.upload-button-wrapper {
   position: absolute;
   right: 12px;
   bottom: 12px;
   width: 32px;
   height: 32px;
}

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

.upload-button {
   width: 36px;
   height: 36px;
   background: rgba(0, 0, 0, 0.071);
   border: none;
   cursor: pointer;
   padding: 4px;
   border-radius: 20px;
   color: #6B7280;
   display: flex;
   align-items: center;
   justify-content: center;
}

.upload-button:hover {
   background: rgba(0, 0, 0, 0.05);
   color: #374151;
}

.upload-button svg {
   width: 18px;
   height: 18px;
}
.upload-button-content {
   position: relative;
}

.upload-button-content:before {
   content: "Add Screenshots";
   position: absolute;
   bottom: 100%;
   left: 50%;
   transform: translateX(-120%) translateY(22px);
   padding: 5px 10px;
   background: rgba(0, 0, 0, 0.8);
   color: white;
   border-radius: 4px;
   font-size: 12px;
   white-space: nowrap;
   opacity: 0;
   visibility: hidden;
   transition: opacity 0.2s;
}

.upload-button-content:hover:before {
   opacity: 1;
   visibility: visible;
}

#chat-message {
   pointer-events: auto;
   z-index: auto;
}

.upload-button-wrapper {
   pointer-events: auto;
   z-index: auto;
}

/* Player controls header - contains export controls inside player area */
.player-controls-header {
   display: flex;
   justify-content: flex-end;
   align-items: center;
   gap: 12px;
   padding: 30px 10px;
   background: transparent;
   backdrop-filter: blur(8px);
   -webkit-backdrop-filter: blur(8px);
   flex-wrap: nowrap;
   position: sticky;
   top: 0;
   z-index: 100;
   min-height: 100px;
}

/* Ensure buttons stay grouped together on the right */
.player-controls-header > * {
   flex-shrink: 0;
}

/* Export dropdown styles */
.export-dropdown {
   position: relative;
   z-index: 1001;
}

.export-dropdown button {
   display: flex;
   align-items: center;
   gap: 10px;
   background: rgba(0, 0, 0, 0.8);
   backdrop-filter: blur(8px);
   -webkit-backdrop-filter: blur(8px);
   border: none;
   padding: 10px 16px;
   border-radius: 12px;
   font-size: 16px;
   font-weight: 500;
   color: white;
   cursor: pointer;
   transition: all 0.2s ease;
}

/* Update the lua header controls styling */
.lua-header .header-controls {
   display: flex;
   gap: 12px;
   align-items: center;
}

.lua-header .header-controls input[type="checkbox"] {
   margin: 0;
}

.lua-header .header-controls label {
   font-size: 14px;
   color: #6b7280;
   margin-right: 12px;
}
/* Loading indicator styles */
#loading-indicator {
   position: fixed;
   top: 0;
   left: 0;
   width: 100%;
   height: 88px;
   z-index: 0;
   background: linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.8) 0%,
      rgb(255, 0, 217, 0.8)  33%,
      rgba(255, 217, 0, 0.8) 77%,
      rgb(255, 255, 255) 100%
   );
   background-size: 300% 100%;
   animation: loading-gradient 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
   filter: blur(88px);
   opacity: 0;
   visibility: hidden;
   transition:
      opacity 1s ease-in-out,
      visibility 1s ease-in-out,
      transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

#loading-indicator.loading-progress {
   opacity: 1;
   visibility: visible;
}

#loading-indicator.loading-complete {
   opacity: 0;
   visibility: hidden;
   transform: translateY(-4px);
}

@keyframes loading-gradient {
   0% { background-position: 0% 50%; }
   50% { background-position: 100% 50%; }
   100% { background-position: 0% 50%; }
}

.bot-switch {
   display: none;
   gap: 8px;
   margin-bottom: 16px;
}

/* Show bot switch in debug mode */
body[data-debug="true"] .bot-switch {
   display: flex;
}

.switch-button {
   padding: 8px 16px;
   border: none;
   background: transparent;
   color: #6b7280;
   font-size: 14px;
   font-weight: 500;
   border-radius: 32px;
   cursor: pointer;
   transition: all 0.2s;
}

.switch-button.hidden {
   display: none;
}

.switch-button:not(.active) {
   background-color: transparent;
}

.switch-button:hover:not(.active) {
   background-color: rgba(0, 0, 0, 0.05);
}

.switch-button.active {
   background-color: #1f2937;
   color: white;
}

.switch-button:hover:not(.active) {
   background-color: #f3f4f6;
}

/* Update chat controls container to better align all elements */
.chat-controls {
   display: none; /* Hidden by default */
   flex-direction: column;
   gap: 8px;
   padding-bottom: 8px;
}

/* Show chat controls in debug mode */
body[data-debug="true"] .chat-controls {
   display: flex;
}

/* Hide debug-only menu items by default */
.debug-only {
   display: none !important;
}

/* Show debug-only menu items in debug mode */
body[data-debug="true"] .debug-only {
   display: flex !important;
}

.bot-switch {
   display: inline-flex;
   background-color: #f3f4f6;
   padding: 0.25rem;
   border-radius: 9999px;
   gap: 4px;
   margin: 0 auto;
}

/* Style the lua controls container */
.lua-controls {
   display: flex;
   gap: 8px;
   align-items: center;
   width: 100%;
}

.lua-controls select {
   flex: 1;
   min-width: 200px;
   padding: 8px;
   border: 1px solid #e5e7eb;
   border-radius: 8px;
   background: #f9fafb;
}

.lua-controls button {
   white-space: nowrap;
}

/* Simple hide/show for Lua bot elements */
.lua-only {
   display: none;
}

/* Show when Lua bot is selected */
[data-active-bot="1"] .lua-only {
   display: flex;
}

/* Special case for buttons in flex containers */
[data-active-bot="1"] .button-list .lua-only {
   display: inline-flex;
}

/* Ensure select element appears properly when shown */
.button-list select.lua-only {
   flex: 1;
   min-width: 200px;
   padding: 8px;
   border: 1px solid #e5e7eb;
   border-radius: 8px;
   background: #f9fafb;
}

/* Hide the default text content */
#play-pause-button span {
   display: none;
}

/* Small control button style */
.small-control {
   background: transparent;
   border: none;
   width: 24px;
   height: 24px;
   padding: 0;
   display: flex;
   align-items: center;
   justify-content: center;
   cursor: pointer;
   color: #666;
   transition: opacity 0.2s;
   margin-right: 4px;
}

.small-control:hover {
   opacity: 0.7;
}

.small-control i {
   font-size: 0.875rem; /* 14px at default size, but scalable */
}

/* Ensure the ACE editor container sizes properly */
#lua-script .ace_editor {
   position: absolute !important;
   top: 0 !important;
   right: 0 !important;
   bottom: 0 !important;
   left: 0 !important;
   width: 100% !important;
   height: 100% !important;
}

/* System Message Editor Styles */
.system-message-editor {
   width: 100%;
   height: 200px;
   margin: 10px 0;
   background: #1e1e1e;
   border: 1px solid #333333;
   border-radius: 4px;
   transition: all 0.3s ease;
}

/* Large editor state for system messages */
.system-message-editor.large-editor {
   position: fixed;
   top: 50%;
   left: 50%;
   transform: translate(-50%, -50%);
   width: 80%;
   height: 80%;
   max-width: 1600px;
   z-index: 1002;
   box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

/* Settings area styles */
#settings-area {
   padding: 16px;
   background: #ffffff;
   border-top: 1px solid #e5e7eb;
}

.settings-area-bot-property {
   display: flex;
   align-items: center;
   gap: 8px;
   margin: 8px 0;
}

.settings-area-bot-property label {
   font-size: 14px;
   color: #374151;
   min-width: 60px;
}

.settings-area-bot-property input {
   width: 80px;
   padding: 4px 8px;
   border: 1px solid #e5e7eb;
   border-radius: 4px;
   font-size: 14px;
}

/* Header spacing for settings area */
.header-whitespace {
   flex: 1;
}

/* Ensure the ACE editor in system message fills the container */
.system-message-editor .ace_editor {
   position: absolute;
   top: 0;
   right: 0;
   bottom: 0;
   left: 0;
   font-family: 'Consolas', 'Monaco', monospace;
   font-size: 14px;
}

/* Add a divider in settings */
#settings-area hr {
   margin: 20px 0;
   border: none;
   border-top: 1px solid #e5e7eb;
}

/* Make sure settings buttons are properly spaced */
#settings-area button {
   margin: 8px 0;
}

/* Remove any opacity/visibility settings from the export dropdown itself */
.export-dropdown {
   position: relative;
}

.chevron {
   transition: transform 0.3s ease;
}

.export-dropdown.active .chevron {
   transform: rotate(180deg);
}

.export-dropdown .dropdown-panel {
   position: absolute;
   top: calc(100% + 8px);
   right: 0;
   background: rgba(255, 255, 255, 0.75);
   backdrop-filter: blur(12px);
   -webkit-backdrop-filter: blur(12px);
   border: 1px solid rgba(255, 255, 255, 0.2);
   border-radius: 8px;
   padding: 8px;
   display: flex;
   flex-direction: column;
   gap: 4px;
   min-width: 250px;
   box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12),
   0 2px 8px rgba(0, 0, 0, 0.08);
   opacity: 0;
   visibility: hidden;
   transform: translateY(-10px);
   transition: all 0.3s ease;
}

.export-dropdown.active .dropdown-panel {
   opacity: 1;
   visibility: visible;
   transform: translateY(0);
}

/* Base dropdown panel button styles - shared across all dropdowns */
.dropdown-panel button {
   background: transparent;
   color: #111827;
   text-align: left;
   padding: 10px 14px;
   border-radius: 6px;
   transition: all 0.2s ease;
   border: 2px solid transparent;
   font-weight: 500;
   font-size: 14px;
   line-height: 1.5;
   display: flex;
   align-items: center;
   gap: 8px;
   width: 100%;
   cursor: pointer;
}

.dropdown-panel button:hover:not(:disabled) {
   background: rgba(59, 130, 246, 0.1);
   color: #1d4ed8;
   border-color: rgba(59, 130, 246, 0.2);
}

.dropdown-panel button:focus {
   outline: none;
   background: rgba(59, 130, 246, 0.1);
   color: #1d4ed8;
   border-color: #3b82f6;
   box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.dropdown-panel button:focus-visible {
   outline: 2px solid #3b82f6;
   outline-offset: 2px;
}

.dropdown-panel button:disabled {
   opacity: 0.5;
   cursor: not-allowed;
}

/* Export dropdown specific overrides */
.export-dropdown .dropdown-panel button {
   font-size: 16px;
   white-space: nowrap;
}

.export-dropdown .dropdown-panel button .camtasia-icon {
   margin-right: 0;
   flex-shrink: 0;
   vertical-align: middle;
   display: inline-block;
}

/* Styling for export dropdown panel links to make them appear like buttons */
.export-dropdown .dropdown-panel a.dropdown-panel-link-button,
.export-dropdown .dropdown-panel a.dropdown-panel-link-button:hover,
.export-dropdown .dropdown-panel a.dropdown-panel-link-button:visited,
.export-dropdown .dropdown-panel a.dropdown-panel-link-button:active {
   text-decoration: none; /* Removes underline */
   color: inherit; /* Inherits text color from parent, avoids default link blue */
   display: block; /* Makes the anchor fill the width */
}

.export-dropdown .dropdown-panel a.dropdown-panel-link-button button {
   width: 100%; /* Make button take full width of the anchor */
   border: none; /* Remove default browser button border */
   /* Font, color, padding, text-align, display, align-items, gap
      will be inherited from the general .dropdown-panel button rule */
}

.dropdown-panel hr.dropdown-divider {
   border: none; /* Remove default hr border */
   border-top: 1px solid rgba(0, 0, 0, 0.1); /* Light gray line */
   margin: 4px 0; /* Space above and below the divider */
   width: 100%;
}

/* Update menu dropdown styles to match export dropdown exactly */
.menu-dropdown {
   position: relative;
   z-index: 1000;
   animation: fadeIn 0.8s ease-out 0.4s backwards;
}

#menu-dropdown-button {
   background: transparent;
   border: none;
   padding: 12px;
   border-radius: 12px;
   font-size: 16px;
   color: #6B7280;  /* Gray color for the icon */
   cursor: pointer;
   transition: all 0.2s ease;
   display: flex;
   align-items: center;
   justify-content: center;
   width: 42px;
   height: 42px;
}

#menu-dropdown-button:hover {
   background: rgba(0, 0, 0, 0.5);
   color: #ffffff;
}

/* Style for when dropdown is active */
.menu-dropdown.active #menu-dropdown-button {
   background: #696c71;  /* Dark background when active */
   color: white;  /* White icon when active */
}

/* Add styles to keep logo and text close together */
#screencast-logo {
   margin-right: 4px; /* Small gap between logo and text */
   vertical-align: middle;
   text-align: left;
}

.area-title span {
   vertical-align: middle;
   display: inline-block;
}

/* Outline button styles for Start Over buttons */
.btn-outline {
   background-color: transparent;
   color: #373737;
   border: 1px solid #696c716b;
   padding: 10px 16px;
   border-radius: 12px;
   font-size: 16px;
   font-weight: 500;
   cursor: pointer;
   transition: all 0.2s ease;
   display: inline-flex;
   align-items: center;
   gap: 10px;
}

.btn-outline:hover {
   background-color: #ffffff;
   border-color: #4d505c;
   color: #373737;
}

.btn-outline svg {
   flex-shrink: 0;
}

/* Start Over button in storyboard - hidden by default */
.start-over-btn {
   display: none;
   animation: fadeIn 0.8s ease-out 0.4s backwards;
}

/* Show the start over button when welcome content is NOT visible (i.e., when storyboard is active) */
#chat-area:not(:has(.welcome-content.visible)) .start-over-btn {
   display: inline-flex;
}

/* Hide the storyboard start over button in player-visible (narrow) mode since there's already one in player controls */
#main-app.player-visible #chat-reset-all-button {
   display: none;
}

/* Show the player area start over button when player is visible */
#main-app.player-visible #player-reset-all-button {
   display: inline-flex;
}

/* Header actions container for right-side elements */
.header-actions {
   display: flex;
   align-items: center;
   gap: 8px;
}

#user-profile {
   display: flex;
   flex-direction: column;
   align-items: center;
   gap: 8px;
   max-width: 200px;

   span {
      font-weight: 500;
      font-size: 14px;
      line-height: 1.5;
   }
}

/* User profile styling */
#user-profile.hidden {
   display: none;
   transition: transform 0.3s ease;
}

#authenticated-user-info {
   display: flex;
   align-items: center;
   gap: 8px;
   width: 100%;
}

.user-info {
   display: flex;
   align-items: center;
   gap: 8px;
}

.user-avatar {
   width: 24px;
   height: 24px;
   border-radius: 50%;
   object-fit: cover;
}

.user-name {
   font-size: 14px;
   font-weight: 500;
   width: 100%;
   overflow: hidden;
   text-overflow: ellipsis;
   white-space: nowrap;
}

#user-dropdown-button {
   background: none;
   border: none;
   cursor: pointer;
   padding: 2px 4px;
   border-radius: 4px;
   transition: background-color 0.2s ease;
   width: auto;
}

.dropdown-toggle {
   transition: transform 0.3s ease;
}

.dropdown-toggle.rotate {
   transform: rotate(180deg);
}

#menu-dropdown-button:hover {
   background: rgba(17, 24, 39, 0.9);
}

.menu-dropdown .dropdown-panel {
   position: absolute;
   top: calc(100% + 8px);
   right: 0;
   background: rgba(255, 255, 255, 0.75);
   backdrop-filter: blur(12px);
   -webkit-backdrop-filter: blur(12px);
   border: 1px solid rgba(255, 255, 255, 0.2);
   border-radius: 12px;
   padding: 8px;
   display: flex;
   flex-direction: column;
   gap: 4px;
   min-width: 200px;
   box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12),
   0 2px 8px rgba(0, 0, 0, 0.08);
   opacity: 0;
   visibility: hidden;
   transform: translateY(-10px);
   transition: all 0.3s ease;
}

.menu-dropdown.active .dropdown-panel {
   opacity: 1;
   visibility: visible;
   transform: translateY(0);
}

/* Menu dropdown inherits all base dropdown-panel button styles */

#screencast-logo{
   display: block;
   width: 24px;
   height: 24px;
}

#screencast-logo-text {
   font-size: 1.125rem; /* 18px at default size, but scalable */
   font-weight: 600;
   color: #111827;
   line-height: 1.4; /* Improved line height */
}

/* Welcome cards horizontal scroll */
.welcome-cards {
   display: flex;
   justify-content: center;
   gap: clamp(28px, 2vw, 8px);
   margin-bottom: 0;
   padding: 24px 16px; /* Increased vertical padding to accommodate shadows */
   min-width: min-content;
   animation: fadeIn 0.8s ease-out 0.6s backwards;
   scrollbar-width: thin; /* Thin scrollbar for Firefox */
   scrollbar-color: rgba(0, 0, 0, 0.1) transparent; /* Subtle scrollbar for Firefox */
   overflow-x: hidden;
}

/* Elegant scrollbar styling for webkit browsers */
.welcome-cards::-webkit-scrollbar {
   height: 4px; /* Thin scrollbar */
}

.welcome-cards::-webkit-scrollbar-track {
   background: rgba(255, 255, 255, 0.1); /* Nearly transparent track */
   border-radius: 2px;
}

.welcome-cards::-webkit-scrollbar-thumb {
   background: rgba(0, 0, 0, 0.1); /* Subtle gray thumb */
   border-radius: 2px;
   transition: background 0.3s ease;
}

.welcome-cards::-webkit-scrollbar-thumb:hover {
   background: rgba(0, 0, 0, 0.2); /* Slightly more visible on hover */
}

.welcome-card {
   flex: 0 0 min(300px, 80vw); /* Responsive card width */
   padding: clamp(12px, 3vw, 16px);
}

/* Mobile optimizations */
@media (max-width: 768px) {
   #interaction-area {
      width: 100%;
      max-width: 100%;
      height: 100vh;
      margin: 0;
      border-radius: 0;
      border: none;
   }

   .area-title {
      border-radius: 0;
   }

   .welcome-header h1 {
      font-size: min(48px, max(28px, 6vh));
      padding: 0 8px;
   }

   .welcome-header p {
      font-size: 14px;
      padding: 0 24px;
   }

   .welcome-header br {
      display: none; /* Remove line breaks on mobile */
   }

   .welcome-cards {
      gap: 24px;
      padding: 8px 12px; /* Reset centered padding on mobile */
      padding-left: 12px; /* Override the centering for mobile */
   }

   .welcome-card {
      padding: 12px;
   }

   .card-icon {
      width: 32px;
      height: 32px;
   }

   .card-content h3 {
      font-size: 15px;
   }

   .card-content p {
      font-size: 13px;
   }
}

/* Small mobile optimizations */
@media (max-width: 480px) {
   .welcome-header {
      padding: 16px 12px 12px;
   }

   .welcome-header h1 {
      font-size: min(36px, max(24px, 5vh));
   }

   .welcome-card {
      flex: 0 0 85vw;
      min-height: 80px;
   }
}

/* Individual card styling - Enhanced Glassmorphic Design */
.welcome-card {
   /* Position and sizing */
   flex: 0 0 300px; /* Fixed width, no growing or shrinking */
   display: flex;
   align-items: flex-start;
   padding: 20px;

   /* Enhanced Glassmorphic styling */
   background: linear-gradient(145deg, rgba(255,255,255,0.25), rgba(255,255,255,0.1));
   backdrop-filter: blur(20px);
   -webkit-backdrop-filter: blur(20px);
   border: 1px solid rgba(255, 255, 255, 0.2);
   border-radius: 16px;
   box-shadow:
      0 1px 2px rgba(0, 0, 0, 0.05),
      0 4px 6px rgba(0, 0, 0, 0.08),
      0 12px 24px rgba(0, 0, 0, 0.06);
   transform-style: preserve-3d;
   perspective: 1000px;

   /* Interaction */
   cursor: pointer;
   transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
   position: relative;

   /* Animation */
   animation: fadeInUp 0.8s ease-out backwards;
}

.welcome-card:nth-child(1) { animation-delay: 0.1s; }
.welcome-card:nth-child(2) { animation-delay: 0.2s; }
.welcome-card:nth-child(3) { animation-delay: 0.3s; }
.welcome-card:nth-child(4) { animation-delay: 0.4s; }
.welcome-card:nth-child(5) { animation-delay: 0.5s; }

.welcome-card:hover {
   /* Enhanced glassmorphic effect on hover with 3D motion */
   background: rgba(255, 255, 255, 0.15);
   border: 1px solid rgba(255, 255, 255, 0.9);
   box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
   transform: rotateX(2deg) rotateY(-2deg) scale(1.02);
}

.welcome-card:active {
   transform: translateY(-4px) scale(0.98);
   transition: all 0.1s ease;
}

/* Enhanced glow effect overlay */
.welcome-card::before {
   content: '';
   position: absolute;
   top: 0;
   left: 0;
   right: 0;
   bottom: 0;
   background: radial-gradient(circle at center, rgba(255, 255, 255, 0.2), transparent 70%);
   border-radius: 16px;
   opacity: 0;
   transition: opacity 0.3s ease;
   pointer-events: none;
   filter: blur(20px);
}

.welcome-card:hover::before {
   opacity: 1;
}

/* Enhanced icon styling with claymorphic effects */
.card-icon {
   flex-shrink: 0;
   width: 48px;
   height: 48px;
   background: rgba(255, 255, 255, 0.9);
   border-radius: 12px;
   display: flex;
   align-items: center;
   justify-content: center;
   margin-right: 16px;
   box-shadow:
      0 4px 12px rgba(0, 0, 0, 0.1),
      inset 0 1px 0 rgba(255, 255, 255, 0.8);
   position: relative;
   transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.welcome-card:hover .card-icon {
   transform: translateY(-2px);
   box-shadow:
      0 8px 24px rgba(0, 0, 0, 0.15),
      inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

/* Claymorphic icon colors based on card type */
.welcome-card:nth-child(1) .card-icon i { color: #FF6B9D; } /* Video - Pink */
.welcome-card:nth-child(2) .card-icon i { color: #10B981; } /* Social - Green */
.welcome-card:nth-child(3) .card-icon i { color: #8B5CF6; } /* Animation - Purple */
.welcome-card:nth-child(4) .card-icon i { color: #F59E0B; } /* Presentation - Amber */
.welcome-card:nth-child(5) .card-icon i { color: #06B6D4; } /* GIF - Cyan */

.card-icon i {
   font-size: 24px;
   transition: all 0.3s ease;
   filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.welcome-card:hover .card-icon i {
   transform: scale(1.1);
   filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

/* Enhanced typography */
.card-content h3 {
   margin: 0 0 8px 0;
   font-size: 18px;
   font-weight: 700;
   letter-spacing: -0.015em;
   color: #111827;
   line-height: 1.3;
   transition: color 0.3s ease;
}

.welcome-card:hover .card-content h3 {
   color: rgba(17, 24, 39, 1);
}

.card-content p {
   margin: 0;
   font-size: 15px;
   line-height: 1.6;
   color: #4B5563;
   transition: color 0.3s ease;
}

.welcome-card:hover .card-content p {
   color: rgba(107, 114, 128, 1);
}

/* Welcome message styles */
.welcome-message {
   text-align: center;
   padding-top: 70px;
   max-width: 600px;
   margin: 0 auto;
}

/* Update welcome header visibility */
.welcome-header {
   max-width: 800px;
   margin: 0 auto;
   order: 0;
   display: none; /* Hidden by default */
   animation: fadeInUp 0.8s ease-out;
   padding: min(40px, max(16px, 4vh)) 20px 16px; /* Reduced padding */
}

.welcome-header h1 {
   font-size: min(70px, max(32px, 7vh));
   font-weight: 1000;
   color: transparent;
   background-image: linear-gradient(135deg, #000000, #959595);
   -webkit-background-clip: text;
   background-clip: text; /* Add standard property */
   margin: 0 0 8px 0; /* Adjusted margins */
   animation: fadeInUp 1s ease-out 0.2s backwards;
   line-height: 1.1;
}

.welcome-header p {
   font-size: min(16px, max(14px, 1.8vh));
   color: #6b7280;
   line-height: 1.5;
   animation: fadeIn 1s ease-out 0.2s backwards;
   margin: 0;
   padding: 0 16px;
}

/* Card icon container */
.card-icon {
   flex-shrink: 0;
   width: 40px;
   height: 40px;
   background: #fff;
   border-radius: 8px;
   display: flex;
   align-items: center;
   justify-content: center;
   margin-right: 16px;
   box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.card-icon i {
   font-size: 20px;
   color: #666;
}

/* Card content styling */
.card-content h3 {
   margin: 0 0 8px 0;
   font-size: 16px;
   font-weight: 600;
   color: #333;
}

.card-content p {
   margin: 0;
   font-size: 14px;
   color: #666;
   line-height: 1.4;
}
/* Update the welcome content visibility rules */
.welcome-content {
   transition: opacity 0.3s ease-in-out;
   display: none; /* Hidden by default */
   padding: 8px;
   -webkit-overflow-scrolling: touch;
   overflow-x: auto;
}

/* Show welcome content only when it has the 'visible' class */
.welcome-content.visible {
   display: block;
}

#main-app.player-visible .welcome-content {
   display: none;
}

/* Add this style to hide chat history placeholder when welcome content is visible */
.welcome-content.visible ~ #chat-history .ace_content .ace_placeholder {
   display: none !important;
}

.welcome-content.visible ~ #chat-history {
   display: none !important;
}

.welcome-content.visible ~ .bot-switch {
   display: none;
}

.welcome-content.visible ~ .chat-controls .bot-switch {
   display: none !important;
}

/* Show welcome header when welcome content is visible */
#chat-area:has(.welcome-content.visible) .welcome-header {
   display: block;
}

/* Modal styles */
.screenshot-modal {
   display: none;
   position: fixed;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
   background-color: rgba(0, 0, 0, 0.5);
   z-index: 1000;
   backdrop-filter: blur(4px);
}

.modal-content {
   position: relative;
   background-color: #fff;
   margin: 40px auto;
   padding: 20px;
   width: 90%;
   max-width: 1200px;
   max-height: 90vh;
   border-radius: 12px;
   box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
   overflow: hidden;
   display: flex;
   flex-direction: column;
}

.modal-header {
   display: flex;
   justify-content: space-between;
   align-items: center;
   padding-bottom: 16px;
   border-bottom: 1px solid #e5e7eb;
   margin-bottom: 20px;
}

.modal-header h2 {
   margin: 0;
   font-size: 20px;
   font-weight: 600;
   color: #111827;
}

.close-modal {
   background: none;
   border: none;
   color: #000000;
   cursor: pointer;
   padding: 8px;
   border-radius: 6px;
   transition: all 0.2s ease;
   margin-left: auto;
   display: flex;
   align-items: center;
}

.close-modal:hover {
   background: #f3f4f6;
   color: #111827;
}

.modal-body {
   flex: 1;
   overflow-y: auto;
   padding-right: 8px;
}

.screenshot-grid {
   display: grid;
   grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
   gap: 16px;
   padding: 8px;
}

.screenshot-item {
   position: relative;
   aspect-ratio: 16/9;
   background: #f3f4f6;
   border-radius: 8px;
   overflow: hidden;
   cursor: pointer;
   transition: all 0.2s ease;
   box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.screenshot-item:hover {
   transform: scale(1.02);
   box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Keyboard focus indicators for screenshot items */
.screenshot-item:focus {
   outline: 2px solid #0066cc;
   outline-offset: 2px;
   box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.2);
}

.screenshot-item:focus-visible {
   outline: 2px solid #0066cc;
   outline-offset: 2px;
}

.screenshot-item img {
   width: 100%;
   height: 100%;
   object-fit: cover;
}

.screenshot-item .filename {
   position: absolute;
   bottom: 0;
   left: 0;
   right: 0;
   padding: 8px;
   background: rgba(0, 0, 0, 0.7);
   color: white;
   font-size: 0.75rem; /* 12px at default size, but scalable - minimum for accessibility */
   opacity: 0;
   transition: opacity 0.2s ease;
}

.screenshot-item:hover .filename {
   opacity: 1;
}

/* Snagit Library button styles */
.snagit-library-button {
   background: #ffffff;
   color: #6B7280;
   display: flex;
   align-items: center;
   gap: 8px;
   padding: 12px 20px;
   font-size: 14px;
   cursor: pointer;
   transition: all 0.2s ease;
   border: 1px solid #e5e7eb;
   border-radius: 8px;
   white-space: nowrap;
}

.snagit-library-button:hover {
   background: #f9fafb;
   color: #111827;
}

.snagit-library-button svg {
   width: 16px;
   height: 16px;
}

/* Update upload image button styles to match */
.upload-image-button {
   background: #ffffff;
   color: #6B7280;
   display: flex;
   align-items: center;
   gap: 8px;
   padding: 12px 20px;
   font-size: 14px;
   cursor: pointer;
   transition: all 0.2s ease;
   border: 1px solid #e5e7eb;
   border-radius: 8px;
   white-space: nowrap; /* Prevent text wrapping */
}

.upload-image-button:hover {
   background: #f9fafb;
   color: #111827;
}

/* Add these new styles for error states */
.no-screenshots,
.screenshot-error {
   display: flex;
   flex-direction: column;
   align-items: center;
   justify-content: center;
   padding: 40px;
   text-align: center;
   color: #6b7280;
   background: #f9fafb;
   border-radius: 8px;
   grid-column: 1 / -1;
}

.no-screenshots i,
.screenshot-error i {
   font-size: 48px;
   margin-bottom: 16px;
   opacity: 0.5;
}

.no-screenshots p,
.screenshot-error p {
   margin: 0;
   font-size: 14px;
}

.screenshot-error {
   color: #991b1b;
   background: #fee2e2;
}

.screenshot-item .screenshot-error {
   position: absolute;
   top: 0;
   left: 0;
   right: 0;
   bottom: 0;
   margin: 0;
   border-radius: 0;
}

.file-type {
   position: absolute;
   top: 8px;
   right: 8px;
   padding: 4px 8px;
   background: rgba(0, 0, 0, 0.7);
   color: white;
   font-size: 12px;
   border-radius: 4px;
   opacity: 0;
   transition: opacity 0.2s ease;
}

.screenshot-item:hover .file-type {
   opacity: 1;
}

.screenshot-buttons {
   display: flex;
   gap: 8px;
   justify-content: flex-start;
   width: 100%;
   box-sizing: border-box;
   padding: 12px;
}

.screenshot-buttons span {
   flex-grow: 0.9;
}

.chat-input-footer {
   background: #ffffff;
   border-top: 1px solid #e5e7eb;
   width: 100%;
   display: flex;
   width: 100%;
   justify-content: space-between;
   align-items: center;
   padding: 0px 20px;
}

/* Add these styles for the sequence selection UI */
.screenshot-item {
   position: relative;
}

.sequence-number {
   position: absolute;
   top: 8px;
   left: 8px;
   width: 42px;
   height: 42px;
   background: #FFC700;
   color: #000000;
   border-radius: 12px;
   display: flex;
   align-items: center;
   justify-content: center;
   font-size: 28px;
   font-weight: 600;
   opacity: 0;
   transition: opacity 0.2s ease;
   z-index: 2;
   box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.screenshot-item.selected .sequence-number {
   opacity: 1;
}

.screenshot-item.selected::after {
   content: '';
   position: absolute;
   inset: 0;
   border: 3px solid #FFC700;
   border-radius: 8px;
   pointer-events: none;
}

/* Modal header controls */
.modal-header {
   /* ... existing styles ... */
   padding: 16px 20px;
}

.modal-actions {
   display: flex;
   gap: 12px;
   align-items: center;
}

.attach-selected-button {
   background: #1f2937;
   color: white;
   border: none;
   padding: 8px 16px;
   border-radius: 6px;
   font-size: 14px;
   font-weight: 500;
   display: flex;
   align-items: center;
   gap: 8px;
   cursor: pointer;
   transition: all 0.2s ease;
}

.attach-selected-button:hover {
   background: #111827;
}

.attach-selected-button:disabled {
   background: #9ca3af;
   cursor: not-allowed;
}

.snagit-library-button.disabled {
   opacity: 0.6;
   cursor: not-allowed;
}

.snagit-library-button.disabled:hover {
   background-color: inherit;
}

/* Snagit onboarding modal specific styles */
.onboarding-steps {
   display: flex;
   flex-direction: column;
   gap: 24px;
   padding: 20px 0;
}

.step {
   display: flex;
   gap: 16px;
   align-items: flex-start;
}

.step-number {
   width: 32px;
   height: 32px;
   background: #5CA7DB;
   color: white;
   border-radius: 12px;
   display: flex;
   align-items: center;
   justify-content: center;
   font-weight: 600;
   flex-shrink: 0;
}

.step-content {
   flex: 1;
}

.step-content h3 {
   margin: 0 0 8px 0;
   font-size: 16px;
   color: #111827;
}

.step-content p {
   margin: 0;
   color: #6B7280;
}

.step-content code {
   display: block;
   background: #F3F4F6;
   padding: 12px;
   border-radius: 6px;
   margin-top: 8px;
   font-family: monospace;
   color: #111827;
}

.modal-footer {
   display: flex;
   justify-content: flex-end;
   gap: 12px;
   padding-top: 20px;
   border-top: 1px solid #E5E7EB;
}

.primary-button {
   background: #5CA7DB;
   color: white;
   border: none;
   padding: 8px 16px;
   border-radius: 6px;
   font-weight: 500;
   display: flex;
   align-items: center;
   gap: 8px;
   cursor: pointer;
   transition: background-color 0.2s;
}

.primary-button:hover {
   background: #4B95C9;
}

.secondary-button {
   background: transparent;
   color: #6B7280;
   border: 1px solid #E5E7EB;
   padding: 8px 16px;
   border-radius: 6px;
   font-weight: 500;
   cursor: pointer;
   transition: all 0.2s;
}

.secondary-button:hover {
   background: #F9FAFB;
   color: #111827;
}

/* Update modal styles */
#snagit-onboarding-modal.modal {
   display: none;
   position: fixed;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
   background: rgba(0, 0, 0, 0.5);
   z-index: 2000;
   backdrop-filter: blur(4px);
}

#snagit-onboarding-modal .modal-content {
   position: fixed;
   top: 50%;
   left: 50%;
   transform: translate(-50%, -50%);
   background: white;
   padding: 24px;
   border-radius: 12px;
   width: 90%;
   max-width: 600px;
   max-height: 90vh;
   overflow-y: auto;
   box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

/* Ensure modal buttons work properly */
#snagit-onboarding-modal .modal-footer {
   margin-top: 24px;
   display: flex;
   justify-content: flex-end;
   gap: 12px;
}

#snagit-onboarding-modal .close-modal {
   background: none;
   border: none;
   padding: 8px;
   cursor: pointer;
   color: #6B7280;
}

#snagit-onboarding-modal .close-modal:hover {
   color: #111827;
}

.screenshot-controls {
   padding: 16px;
   border-bottom: 1px solid #e5e7eb;
   display: flex;
   justify-content: flex-end;
}

.change-folder-button {
   background: #ffffff;
   border: 1px solid #e5e7eb;
   padding: 8px 16px;
   border-radius: 6px;
   display: flex;
   align-items: center;
   gap: 8px;
   cursor: pointer;
   transition: all 0.2s;
   color: #1f2937; /* Dark text for legibility */
   font-size: 14px;
   font-weight: 500;
}

.change-folder-button:hover {
   background: #f9fafb;
   border-color: #d1d5db;
}

.change-folder-button:focus {
   outline: 2px solid #0066cc;
   outline-offset: 2px;
   box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.2);
}

.change-folder-button i {
   color: #6b7280;
}

.images-grid {
   display: grid;
   grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
   gap: 16px;
   padding: 16px;
}

/* Update existing screenshot-grid styles */
.screenshot-grid {
   display: flex;
   flex-direction: column;
   height: 100%;
   overflow: hidden;
}

.screenshot-grid .images-grid {
   flex: 1;
   overflow-y: auto;
}

.screenshot-item.loading {
   display: flex;
   align-items: center;
   justify-content: center;
   background: #f3f4f6;
   min-height: 200px;
}

.loading-indicator {
   color: #6b7280;
   font-size: 24px;
}

.loading-indicator i {
   animation: spin 1s linear infinite;
}

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

/* Hide the preview completely when truly empty */
.loaded-media-preview:not(:has(.media-thumbnails *)) {
   display: none;
}

.media-thumbnails:empty ~ .loaded-media-preview {
   display: none;
   opacity: 0;
   transition: opacity 0.2s ease;
}

/* .loaded-media-preview.drag-over {
    display: flex;
    opacity: 1;
} */

/* .loaded-media-preview.drag-over {
    background: rgba(59, 130, 246, 0.05);
    border: 2px dashed rgba(59, 130, 246, 0.5);
    border-radius: 16px;
} */

.media-thumbnails {
   display: flex;
   gap: 8px;
   overflow-x: auto;
   scrollbar-width: thin;
   scroll-behavior: smooth;
   padding: 4px; /* Add padding on all sides to prevent focus outline clipping */
}

.media-thumbnail {
   position: relative;
   flex: 0 0 auto;
   width: 50px; /* Reduced width */
   height: 30px; /* Reduced height */
   border-radius: 4px; /* Adjusted border-radius */
   overflow: hidden;
   border: 1px solid #d1d5db; /* Adjusted border */
   transition: all 0.2s ease;
   background: white;
   cursor: grab; /* Show grab cursor for dragging, pointer cursor on hover */
   user-select: none;
}

/* Focus indicators for accessibility */
.media-thumbnail:focus {
   outline: 2px solid #0066cc;
   outline-offset: 2px;
   box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.2);
}

.media-thumbnail:focus-visible {
   outline: 2px solid #0066cc;
   outline-offset: 2px;
}

/* Hover effect for better visual feedback */
.media-thumbnail:hover {
   border-color: #9ca3af;
   transform: translateY(-1px);
   box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
   cursor: pointer; /* Show pointer cursor on hover to indicate clickability */
}

.media-thumbnail img {
   width: 100%;
   height: 100%;
   object-fit: cover;
}

.media-thumbnail .filename {
   position: absolute;
   bottom: 0;
   left: 0;
   right: 0;
   padding: 4px;
   background: rgba(0, 0, 0, 0.7);
   color: white;
   font-size: 0.75rem; /* Increased from 10px to 12px equivalent for better accessibility */
   text-overflow: ellipsis;
   overflow: hidden;
   white-space: nowrap;
   /* Ensure filename is hidden initially if remove button overlaps */
   opacity: 0;
   transition: opacity 0.2s ease;
}

.media-thumbnail:hover .filename {
   opacity: 0; /* Show filename on hover */
}

/* Update .remove-button styles (previously .remove-media maybe?) */
.media-thumbnail .remove-button {
   position: absolute;
   top: 2px; /* Adjusted for smaller size */
   right: 2px; /* Adjusted for smaller size */
   width: 16px; /* Adjusted for smaller size */
   height: 16px; /* Adjusted for smaller size */
   border-radius: 50%;
   background: rgba(0, 0, 0, 0.6);
   color: white;
   border: none; /* Ensure no border */
   padding: 0; /* Ensure no padding */
   display: flex;
   align-items: center;
   justify-content: center;
   cursor: pointer;
   opacity: 0; /* Hidden by default */
   transition: opacity 0.2s ease;
   z-index: 10; /* Ensure it's above other elements */
}

.media-thumbnail .remove-button:disabled {
   display: none;
}

/* Focus indicators for remove button */
.media-thumbnail .remove-button:focus {
   outline: 2px solid #0066cc;
   outline-offset: 2px;
   box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.2);
   opacity: 1; /* Show when focused */
}

.media-thumbnail .remove-button:focus-visible {
   outline: 2px solid #0066cc;
   outline-offset: 2px;
}

.media-thumbnail .remove-button i {
   font-size: 0.625rem; /* Increased from 8px to 10px equivalent for better visibility */
}

.media-thumbnail:hover .remove-button {
   opacity: 1; /* Show on hover */
}

/* Show remove button when thumbnail is focused via keyboard */
.media-thumbnail:focus .remove-button {
   opacity: 1;
}

/* Chat input area styles */
.chat-input-area {
   display: flex;
   flex-direction: column;
   border-radius: 16px; /* This was existing */
   /* overflow: hidden; */ /* User removed this */
   animation: fadeInUp 0.5s ease-out 1s backwards;

   /* Default width and centering */
   width: 70%;
   margin-left: auto;
   margin-right: auto;
   margin-bottom: 20px; /* Added for spacing */
   min-width: 450px;    /* Prevent from becoming too narrow */
}

/* Powered by text styling */
.powered-by-text {
   padding: 8px 20px;
   margin-bottom: 12px;
}

#main-app.player-visible .powered-by-text {
   padding: 4px 12px;
   margin-bottom: 20px;
}

/* Styles for when player is visible (narrow view) */
#main-app.player-visible .chat-input-area {
   width: 100%; /* Full width in narrow view */
   margin-left: 0;
   margin-right: 0;
   margin-bottom: 0; /* Reset or adjust as needed for narrow view */
   min-width: unset; /* Reset min-width for narrow view */
}

.chat-input-container {
   display: flex;
   flex-direction: column;
   background: white;
}


#chat-message::placeholder {
   color: #9ca3af;
   font-size: 16px;
}

#chat-message:focus {
   outline: none;
}

/* Media preview styles */
.loaded-media-preview {
   padding: 12px 20px;
   margin-bottom: 8px;
}

.loaded-media-preview:empty {
   display: none;
}







/* Image Preview Modal */
#image-preview-modal.modal {
   display: none;
   position: fixed;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
   z-index: 2000;
   background: rgba(0, 0, 0, 0.75);
   backdrop-filter: blur(4px);
}

.image-preview-content {
   position: fixed !important;
   top: 50% !important;
   left: 50% !important;
   transform: translate(-50%, -50%) !important;
   background: white;
   max-width: 95vw !important;
   max-height: 95vh !important;
   padding: 0 !important;
   width: auto !important;
   display: flex;
   justify-content: center;
   align-items: center;
}

.image-preview-container {
   position: relative;
   max-width: 100%;
   max-height: 95vh;
   display: flex;
   justify-content: center;
   align-items: center;
}

.image-preview-container img {
   max-width: 100%;
   max-height: 95vh;
   object-fit: contain;
   border-radius: 8px;
   box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.image-preview-filename {
   position: absolute;
   top: -32px;
   left: 50%;
   transform: translateX(-50%);
   color: rgb(0, 0, 0);
   padding: 8px 16px;
   font-size: 14px;
   white-space: nowrap;
   z-index: 2001;
}

.nav-button {
   position: absolute;
   top: 50%;
   transform: translateY(-50%);
   background: rgba(0, 0, 0, 0.7);
   color: white;
   border: none;
   width: 40px;
   height: 40px;
   border-radius: 50%;
   cursor: pointer;
   display: flex;
   align-items: center;
   justify-content: center;
   transition: all 0.2s;
}

.nav-button:hover {
   background: rgba(0, 0, 0, 0.9);
}

.prev-button {
   left: 16px;
}

.next-button {
   right: 16px;
}

/* Video creation modal */
#video-generation-modal.modal {
   display: none;
   position: fixed;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
   background: rgba(0, 0, 0, 0.5);
   z-index: 2000;
   backdrop-filter: blur(4px);
}

#video-generation-modal textarea {
   width: 100%;
   height: 120px;
   padding: 12px;
   border: 1px solid #e5e7eb;
   border-radius: 8px;
   font-size: 14px;
   resize: none;
}

/* Draggable thumbnails */
.media-thumbnails {
   display: flex;
   gap: 8px;
   overflow-x: auto;
   scrollbar-width: thin;
   scroll-behavior: smooth;
   padding: 4px 0;
}

/* Dragging-related styles for media thumbnails */
.media-thumbnail.dragging {
   opacity: 0.5;
   cursor: grabbing;
}

.media-thumbnail.drag-over {
   transform: translateX(4px);
}

.media-thumbnail.drag-target::before {
   content: '';
   position: absolute;
   left: -4px;
   top: 0;
   bottom: 0;
   width: 2px;
   background: #FFC700;
}

.image-wrapper {
   position: relative;
   width: 100%;
   height: 100%;
}

.image-wrapper img {
   width: 100%;
   height: 100%;
   object-fit: cover;
}

/* Reuse and extend existing loading animation for export state */
body.exporting #screencast-logo #logo-black,
body.exporting #screencast-logo #logo-gold {
   fill: url(#gradient-animation);
}

/* Export button states */
#export-button:disabled {
   opacity: 1;
   background: #f3f4f6;
   cursor: progress;
   position: relative;
   overflow: hidden;
}

#export-button:disabled::after {
   content: '';
   position: absolute;
   top: 0;
   left: -100%;
   width: 200%;
   height: 100%;
   background: linear-gradient(
      90deg,
      transparent 0%,
      rgba(255, 255, 255, 0.2) 25%,
      rgba(255, 255, 255, 0.2) 75%,
      transparent 100%
   );
   animation: loading-shimmer 2s infinite;
}

@keyframes loading-shimmer {
   0% { transform: translateX(0); }
   100% { transform: translateX(50%); }
}
/* Default/hidden state for download button - hidden until export is complete */
#download-mp4-button {
   display: none;
}

/* Show button when export is complete - controlled by JavaScript */
#download-mp4-button.export-complete {
   display: flex;
   align-items: center;
   gap: 8px;
   background: transparent;
   color: #111827;
   cursor: pointer;
}

#download-mp4-button.export-complete:hover {
   background: rgba(59, 130, 246, 0.1);
   color: #1d4ed8;
   border-color: rgba(59, 130, 246, 0.2);
}

/* Add these styles for template feedback */
.template-feedback {
   position: fixed;
   bottom: 20px;
   left: 50%;
   transform: translateX(-50%);
   padding: 12px 24px;
   border-radius: 8px;
   font-size: 14px;
   z-index: 9999;
   animation: feedbackAnimation 3s ease-in-out;
}

.template-feedback.success {
   background: rgba(0, 0, 0, 0.8);
   color: white;
}

.template-feedback.error {
   background: rgba(220, 38, 38, 0.9);
   color: white;
}

@keyframes feedbackAnimation {
   0% { opacity: 0; transform: translate(-50%, 20px); }
   15% { opacity: 1; transform: translate(-50%, 0); }
   85% { opacity: 1; transform: translate(-50%, 0); }
   100% { opacity: 0; transform: translate(-50%, -20px); }
}

/* Template switch button styles */
#swap-template-button {
   display: inline-flex;
   align-items: center;
   gap: 8px;
   padding: 8px 12px;
   font-size: 14px;
   transition: all 0.2s ease;
}

#swap-template-button .current-template {
   font-weight: 600;
   color: #111827;
}

#swap-template-button .template-arrow {
   color: #6B7280;
   font-size: 12px;
}

#swap-template-button .next-template {
   color: #6B7280;
}

#swap-template-button:hover .next-template {
   color: #111827;
}

#swap-template-button:hover .template-arrow {
   transform: translateX(2px);
   color: #111827;
}

/* Ensure animations only play on initial page load */
.preload * {
   animation: none !important;
   transition: none !important;
}

/* Add responsive welcome content behavior */
@media screen and (max-height: 600px) {
   .welcome-header {
      padding: min(20px, 2vh) 0px 12px;
      padding-bottom: 60px;
   }

   .welcome-header h1 {
      margin-bottom: 0px;
   }

   .welcome-header p {
      margin-bottom: -50px;
   }

   /* Hide recipe cards on very short screens */
   .welcome-cards {
      display: none;
   }
}

/* Show cards again when there's enough height */
@media screen and (min-height: 601px) {
   .welcome-cards {
      display: flex;
      margin-bottom: 4vh;
   }

   .welcome-header::after {
      display: none;
   }
}

/* Updated styles for the prompt box and its components */
.new-prompt-box {
   display: flex;
   /* align-items: flex-end; */ /* Reverting this for the new layout */
   flex-direction: column; /* Textarea on top, controls row below */
   background-color: #ffffff;
   border: 1px solid #d1d5db; /* Tailwind gray-300 */
   border-radius: 28px;
   padding: 8px;
   position: relative;
   gap: 8px; /* Space between textarea and controls row */
   margin: 20px;
}

.player-visible .new-prompt-box {
   min-height: 150px;
}

.new-prompt-box textarea#chat-message {
   flex-grow: 1;
   border: none;
   background-color: transparent;
   resize: none;
   outline: none;
   font-size: 16px;
   padding: 8px; /* Add some padding inside the textarea */
   min-height: 50px; /* Default minimum height */
   max-height: 300px;
   color: #1f2937; /* Tailwind gray-800 */
   width: 100%; /* Ensure it takes full width within its parent */
   box-sizing: border-box; /* Include padding and border in the element's total width and height */
}

.new-prompt-box textarea#chat-message::placeholder {
   font-size: 16px;
   color: #9ca3af;
}

/* Styles for the textarea when it's in the initial empty user experience (IUE) state */
.new-prompt-box textarea#chat-message.empty-iue-state {
   border: 2px dashed #d1d5db; /* Tailwind gray-300, similar to old drop zone */
   background-color: #f9fafb; /* Tailwind gray-50, similar to old drop zone */
   padding-top: 20px; /* More vertical padding for empty state */
   padding-bottom: 20px; /* More vertical padding for empty state */
   min-height: 70px; /* Make it a bit taller to feel like a drop zone */
   text-align: center; /* Center the placeholder text */
}

/* Hide the empty-iue-state styling when player is visible */
#main-app.player-visible .new-prompt-box textarea#chat-message.empty-iue-state {
   border: none;
   background-color: #ffffff; /* Reset to normal background */
   padding-top: 8px; /* Reset to normal padding */
   padding-bottom: 8px; /* Reset to normal padding */
   min-height: 50px; /* Reset to normal min-height */
   text-align: left; /* Reset to normal text alignment */
}

/* Styling for the new-prompt-box when a file is being dragged over it */
.new-prompt-box.drag-over-box {
   background-color: #eef2ff; /* Light indigo background */
   outline: 2px dashed #6366f1; /* Indigo outline */
   outline-offset: -2px; /* Outline inside padding */
}

.prompt-controls-row {
   display: flex;
   align-items: center;
   gap: 8px; /* Space between items in the row */
   width: 100%;
}

.new-prompt-box .media-thumbnails {
   display: flex;
   flex-grow: 1; /* Allow thumbnails area to take available space */
   gap: 6px; /* Slightly reduced gap for smaller thumbnails */
   overflow-x: auto; /* Enable horizontal scrolling */
   overflow-y: hidden;
   padding: 4px; /* Space for focus outlines on all sides */
   scrollbar-width: thin; /* For Firefox */
   scrollbar-color: #a0aec0 #e2e8f0; /* For Firefox */
   min-height: 36px; /* Adjust to fit smaller thumbnails + padding */
   align-items: flex-end; /* Align thumbnails to the bottom */
}

/* Webkit scrollbar styling */
.new-prompt-box .media-thumbnails::-webkit-scrollbar {
   height: 6px; /* Reduced scrollbar height */
}

.new-prompt-box .media-thumbnails::-webkit-scrollbar-track {
   background: #e2e8f0; /* Tailwind gray-200 */
   border-radius: 4px;
}

.new-prompt-box .media-thumbnails::-webkit-scrollbar-thumb {
   background: #a0aec0; /* Tailwind gray-400 */
   border-radius: 4px;
}

.new-prompt-box .media-thumbnails::-webkit-scrollbar-thumb:hover {
   background: #718096; /* Tailwind gray-500 */
}

.new-prompt-box .prompt-button {
   background-color: transparent;
   border: none;
   color: #6b7280; /* Tailwind gray-500 */
   padding: 8px 12px;
   border-radius: 50%;
   cursor: pointer;
   display: flex;
   align-items: center;
   justify-content: center;
   transition: background-color 0.2s ease, color 0.2s ease;
   flex-shrink: 0; /* Prevent buttons from shrinking */
   width: 36px; /* Explicit width for circle */
   height: 36px; /* Explicit height for circle */
}

.new-prompt-box .prompt-button:hover {
   background-color: #f3f4f6; /* Tailwind gray-100 */
   color: #1f2937; /* Tailwind gray-800 */
}

.new-prompt-box .prompt-button.add-button {
   border: 1px solid #d1d5db; /* Tailwind gray-300, matches prompt box border */
}

.new-prompt-box .prompt-button.send-button {
   background-color: #1f2937; /* Tailwind gray-800 */
   color: #ffffff;
}

.new-prompt-box .prompt-button.send-button:hover:not(.disabled) {
   background-color: #111827; /* Tailwind gray-900 */
}

.new-prompt-box .prompt-button.send-button.disabled, .new-prompt-box .prompt-button.add-button:disabled {
   opacity: 0.5;
   cursor: not-allowed;
}

.new-prompt-box .sign-in-button {
   display: flex;
   align-items: center;
   gap: 8px;
   border-radius: 20px;
}

.new-prompt-box .sign-in-button:disabled .sign-in-loaded,
.new-prompt-box .sign-in-button:not(:disabled) .sign-in-loading {
   display: none;
}

.new-prompt-box .prompt-button.sign-in-button:hover {
   background-color: #005a9e;
}

.new-prompt-box .prompt-button i {
   font-size: 16px; /* Adjust icon size if needed */
}

/* Styles for the new Add (+) button dropdown menu */
.add-menu-dropdown {
   position: relative; /* Needed for absolute positioning of the panel */
   z-index: 999; /* Ensure it appears above other elements */
}

.dropdown-like-menu .dropdown-panel {
   position: absolute;
   /* bottom: calc(100% + 8px); */ /* Commented out: Old upward positioning */
   top: calc(100% + 4px); /* New: Position below the button with a smaller gap */
   left: 0; /* Align with the left of the button */
   background: rgba(255, 255, 255, 0.9);
   backdrop-filter: blur(8px);
   -webkit-backdrop-filter: blur(8px);
   border-radius: 8px;
   padding: 8px;
   display: flex;
   flex-direction: column;
   gap: 4px;
   min-width: 240px;
   box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.15),
   0 2px 8px -2px rgba(0, 0, 0, 0.1);
   opacity: 0;
   visibility: hidden;
   /* transform: translateY(10px); */ /* Commented out: Old animation transform */
   transform: translateY(-10px); /* New: Start slightly higher for downward opening */
   transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out, transform 0.2s ease-in-out;
}

.add-menu-dropdown.active .dropdown-panel {
   opacity: 1;
   visibility: visible;
   transform: translateY(0); /* End at its natural position */
}

/* Dropdown-like-menu specific overrides */
.dropdown-like-menu .dropdown-panel button {
   color: #1f2937;
   gap: 10px;
   border: none;
   transition: background-color 0.2s ease, color 0.2s ease;
}

.dropdown-like-menu .dropdown-panel button:hover {
   background: rgba(31, 41, 55, 0.05);
   color: #111827;
   border-color: transparent;
}

.dropdown-like-menu .dropdown-panel button i {
   font-size: 14px; /* Icon size */
   color: #4b5563; /* Tailwind gray-600 for icons */
   transition: color 0.2s ease;
}

.dropdown-like-menu .dropdown-panel button:hover i {
   color: #1f2937; /* Darker icon on hover */
}

/* Style for the Add button when its menu is active */
.add-menu-dropdown.active .prompt-button.add-button {
   background-color: #e5e7eb; /* Tailwind gray-200 */
   border-color: #adb5bd; /* A bit darker to match hover/active states */
   color: #1f2937; /* Darker icon */
}

/* Styles for when the dropdown needs to open upwards */
.add-menu-dropdown.open-upward .dropdown-panel {
   top: auto; /* Reset top positioning */
   bottom: calc(100% + 4px); /* Position above the button */
   transform: translateY(10px); /* Start slightly lower for upward opening animation */
   /* Ensure other properties like left, background, etc., are inherited or explicitly set if needed */
}

.add-menu-dropdown.open-upward.active .dropdown-panel {
   transform: translateY(0); /* End at its natural position when opening upwards */
}

.new-prompt-box .prompt-button i {
   font-size: 16px; /* Adjust icon size if needed */
}

/* Style for the Generate Video button and other similar prominent action buttons */
#generate-video {
   background-color: #ffc703; /* Gold background */
   color: #000000; /* Black text */
   border: none;
   border-radius: 8px;
   padding: 10px 15px;
   font-weight: 500;
   font-size: 14px;
   cursor: pointer;
   transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
   box-shadow: 0 2px 4px rgba(0,0,0,0.1);
   display: flex; /* Use inline-flex for layout with other items or flex if standalone */
   align-items: center;
   justify-content: center;
   gap: 8px;
   text-decoration: none; /* In case it's an <a> tag styled as a button */
   min-width: 120px;
}

#generate-video:hover:not(:disabled) {
   background-color: #ffe283; /* Slightly darker gold on hover */
   transform: translateY(-1px); /* Subtle lift effect */
   box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

#generate-video:active:not(:disabled) {
   transform: translateY(0px); /* Button press effect */
   box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* Revert to base shadow */
}

#generate-video:disabled {
   opacity: 0.5;
   cursor: not-allowed;
}

#generate-video i { /* If an icon is used */
   font-size: 16px; /* Adjust as needed */
   color: #000000; /* Ensure icon color is black */
}

/* Apply same prominent style to Start Creation button in the modal */
#start-video-generation-button {
   background-color: #ffc703; /* Gold background */
   color: #000000 !important; /* Black text, !important to override existing .primary-button color */
   border: none;
   border-radius: 8px;
   padding: 10px 15px;
   font-weight: 500; /* More prominent */
   font-size: 14px;
   cursor: pointer;
   transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
   box-shadow: 0 2px 4px rgba(0,0,0,0.1);
   display: inline-flex;
   align-items: center;
   justify-content: center;
   gap: 8px;
   text-decoration: none;
}

#start-video-generation-button:hover {
   background-color: #f0b900 !important; /* Slightly darker gold on hover, !important to override existing .primary-button hover */
   transform: translateY(-1px);
   box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

#start-video-generation-button:active {
   transform: translateY(0px);
   box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#start-video-generation-button i { /* If an icon is used */
   font-size: 16px; /* Adjust as needed */
   color: #000000; /* Ensure icon color is black */
}

/* End of #generate-video styles, ensure no following relevant rules were removed if they were outside lines 2837-2864 */

/* When player is visible, hide media thumbnails and reorganize layout */
#main-app.player-visible .new-prompt-box .media-thumbnails {
   display: none; /* Hide thumbnails when player is visible */
}

/* When player is visible, restructure the prompt box */
#main-app.player-visible .new-prompt-box {
   flex-direction: column;
}

#main-app.player-visible .new-prompt-box #generate-video {
   /* Remove order and flex-basis properties since we want it to stay inline */
   flex-grow: 1; /* Expand to fill available space between + and send buttons */
   width: auto; /* Let it size based on flex-grow */
   margin: 0 8px; /* Keep horizontal margins for spacing */
   border-radius: 12px; /* Slightly larger border radius for full-width appearance */
   padding: 12px 20px; /* Increase padding for larger button */
   font-size: 16px; /* Larger font size */
   font-weight: 500; /* Bolder text */
   justify-content: center; /* Center the content */
   min-width: unset; /* Remove min-width constraint */
}

#main-app.player-visible .new-prompt-box #generate-video:hover {
   transform: translateY(-2px); /* Slightly more pronounced hover effect */
   box-shadow: 0 6px 12px rgba(0,0,0,0.15); /* Enhanced shadow on hover */
}

@keyframes loading-gradient {
   0% { background-position: 0% 50%; }
   50% { background-position: 100% 50%; }
   100% { background-position: 0% 50%; }
}

/* Progress overlay for video generation */
#progress-overlay {
   position: fixed;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
   /* background: rgba(0, 0, 0, 0.8); */
   backdrop-filter: blur(4px);
   -webkit-backdrop-filter: blur(4px);
   z-index: 2000;
   display: none;
   justify-content: center;
   align-items: center;
}

.progress-content {
   background: white;
   padding: 32px;
   border-radius: 12px;
   max-width: 500px;
   width: 90%;
   box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
   text-align: center;
}

.progress-content h3 {
   margin: 0 0 24px 0;
   font-size: 20px;
   font-weight: 600;
   color: #111827;
   text-align: center;
}

.progress-text {
   background: #f9fafb;
   border: 1px solid #e5e7eb;
   border-radius: 8px;
   padding: 16px;
   height: 200px;
   overflow-y: auto;
   overflow-x: hidden;
   white-space: pre-wrap;
   word-wrap: break-word;
   word-break: break-word;
   font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
   font-size: 14px;
   line-height: 1.4;
   color: #374151;
   margin-top: 16px;
   text-align: left;
   box-sizing: border-box;
}

.lottie-animation {
   width: 200px;
   height: 200px;
   margin: 0 auto 16px auto;
}

/* Loading spinner for generate button */
.fa-spinner {
   animation: spin 1s linear infinite;
}

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

#main-app.player-visible .header-actions .start-over-btn {
   display: none;
}

/* Moved from index.html */
.image-preview-container {
   text-align: center;
   max-width: 100%;
   max-height: 80vh;
   overflow: auto;
}

.image-preview-container img {
   max-width: 100%;
   max-height: 70vh;
   object-fit: contain;
}

.text-preview {
   width: 100%;
   height: 70vh;
   padding: 12px;
   border: 1px solid #ccc;
   border-radius: 4px;
   font-family: monospace;
   font-size: 14px;
   white-space: pre-wrap;
   overflow: auto;
   background-color: #f8f8f8;
   color: #333;
   resize: none;
}

.text-preview-stats {
   font-size: 12px;
   color: #666;
   margin: 8px 0;
   text-align: right;
   font-family: monospace;
}

.image-preview-filename {
   margin-top: 10px;
   font-size: 14px;
   color: #666;
}

.image-preview-modal .modal-content.image-preview-content {
   max-width: 90%;
   width: 90%;
}

/* Remove underlines from all links */
a {
   text-decoration: none !important;
}
a:hover {
   text-decoration: none !important;
}

/* Accessibility Styles */
.sr-only {
   position: absolute;
   width: 1px;
   height: 1px;
   padding: 0;
   margin: -1px;
   overflow: hidden;
   clip: rect(0, 0, 0, 0);
   white-space: nowrap;
   border: 0;
}

/* Skip link styles */
.skip-link {
   position: absolute;
   top: -40px;
   left: 6px;
   background: #000;
   color: #fff;
   padding: 8px;
   text-decoration: none;
   border-radius: 4px;
   z-index: 9999;
   font-weight: bold;
}

.skip-link:focus {
   top: 6px;
}

/* Enhanced focus indicators */
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
   outline: 2px solid #0066cc;
   outline-offset: 2px;
}

/* Enhanced focus indicators for dropdown menu items */
.dropdown-panel button:focus {
   outline: 2px solid #0066cc;
   outline-offset: 1px;
   background: rgba(0, 102, 204, 0.1);
}

/* Enhanced focus indicators for btn-outline elements */
.btn-outline:focus-visible,
a.btn-outline:focus-visible {
   outline: 2px solid #0066cc;
   outline-offset: 2px;
}

/* Logo styling to preserve height */
.logo-container img {
   height: 34px;
   width: auto;
   object-fit: contain;
}

.header {
   font-size: 1.5em;
}

/* New styles for the labs sticker container */
.labs-sticker-container {
   position: absolute;
   top: 87%; /* Position directly below the logo */
   left: 0;
   transform: translateX(10px);
   z-index: 1; /* Ensure it's above other elements if needed */
   pointer-events: none; /* Prevent interaction if not needed */
   animation: slideInSticker 1.5s ease-in-out 2s forwards; /* Increased delay */
   opacity: 0; /* Start hidden */
}

.labs-sticker-container img {
   width: 230px;
   height: auto;
   object-fit: contain;
}

/* Animation for sliding in the sticker */
@keyframes slideInSticker {
   0% {
      opacity: 0;
      transform: translateX(-50%) translateY(-10px) scale(1.5); /* Start from left */
   }
   100% {
      opacity: 1;
      transform: translateX(10px) translateY(0); /* End at natural position */
   }
}

/* Adjustments for narrow view */
@media (max-width: 768px) {
   .labs-sticker-container {
      transform: translateX(0);
   }
   .labs-sticker-container img {
      width: 180px;
      height: auto;
   }
   @keyframes slideInSticker {
      100% {
         transform: translateX(0) translateY(0);
      }
   }
}

#main-app.player-visible .labs-sticker-container {
   position: absolute; /* Maintain absolute positioning */
   top: 100%;
   left: 0;
   transform: translateX(0);
   /* Ensure it doesn't get cut off; adjust if necessary */
}

@media (max-width: 768px) {
   #main-app.player-visible .labs-sticker-container {
      transform: translateX(0);
   }
   #main-app.player-visible .labs-sticker-container img {
      width: 150px;
      height: auto;
   }
}

/* Image required notification */
.image-required-notification {
   background-color: #fef3cd;
   border: 1px solid #ffd60a;
   border-radius: 22px;
   color: #856404;
   padding: 8px 12px;
   margin-top: 8px;
   font-size: 0.875rem;
   display: flex;
   align-items: center;
   gap: 8px;
   animation: slideDown 0.3s ease-out;
}

.image-required-notification.hidden {
   display: none;
}

.image-required-notification i {
   color: #f59e0b;
}

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

/* Height-constrained layout adjustments for player mode */
@media screen and (max-height: 1200px) {
   #main-app.player-visible .player-controls-header {
      padding: 8px 12px;
      min-height: 44px;
   }

   #main-app.player-visible .playback-controls {
      padding: 12px;
      min-height: 56px;
   }

   #main-app.player-visible .canvas-container {
      max-height: calc(100vh - 44px - 56px - 16px);
   }
}

@media screen and (max-height: 1080px) {
   #main-app.player-visible .player-controls-header {
      padding: 8px 12px;
      min-height: 22px;
   }
   #main-app.player-visible .playback-controls {
      padding: 10px;
      min-height: 50px;
   }

   #main-app.player-visible .canvas-container {
      max-height: calc(100vh - 22px - 50px - 12px);
   }
}

@media screen and (max-height: 900px) {
   #main-app.player-visible .player-controls-header {
      padding: 6px 8px;
      min-height: 36px;
      gap: 8px;
   }

   #main-app.player-visible .playback-controls {
      padding: 8px;
      min-height: 44px;
   }

   #main-app.player-visible .canvas-container {
      max-height: calc(100vh - 36px - 44px - 8px);
   }

   /* Make buttons more compact on very short screens */
   #main-app.player-visible .btn-outline {
      padding: 6px 12px;
      font-size: 14px;
   }

   #main-app.player-visible .export-dropdown button {
      padding: 6px 12px;
      font-size: 14px;
   }
}

/* Ultra-wide screen support for enhanced storyboard visibility */
@media screen and (min-width: 1600px) {
   #interaction-area {
      width: 1400px;
      max-width: 1400px;
   }
}

@media screen and (min-width: 2560px) {
   #interaction-area {
      width: 1800px;
      max-width: 1800px;
   }
}

@media screen and (min-width: 3440px) {
   #interaction-area {
      width: 2200px;
      max-width: 2200px;
   }
}

@media screen and (min-width: 3840px) {
   #interaction-area {
      width: 2600px;
      max-width: 2600px;
   }
}