/* Video Storyboard Generator specific styles */

/* Storyboard container */
.storyboard-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 20px;
}

.storyboard-sequence {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-between;
}

/* Workflow steps */
.workflow-steps {
  display: flex;
  gap: 15px;
  margin-top: 15px;
  margin-bottom: 20px;
  position: relative;
}

.workflow-step {
  flex: 1;
  padding: 10px;
  background-color: #f5f5f5;
  border-radius: 4px;
  font-size: 12px;
  text-align: center;
  position: relative;
  z-index:1;
}

.workflow-step.active {
  background-color: var(--brand-blue);
  color: white;
  font-weight: 500;
}

.workflow-step.completed {
  background-color: #d4edda;
  color: #28a745;
}

.workflow-connector {
  position: absolute;
  top: 50%;
  left: calc(25% - 10px);
  right: calc(25% + 10px);
  height: 2px;
  background-color: #e0e0e0;
  z-index: 0;
}

/* Story screen */
/* Note: .story-screen seems to be an old or different set of styles. 
   The JS code uses .screen-unit, .screen-content etc. 
   I will add/modify styles related to .screen-unit structure. */

.screen-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background-color: #f8f9fa;
    border-bottom: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 10px;
}

.story-screen {
  position: relative;
  width: 270px;
  height: 480px; /* 9:16 ratio */
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background-color: #f5f5f5;
  display: flex;
  flex-direction: column;
}

.story-header {
  padding: 10px;
  background-color: rgba(0,0,0,0.05);
  font-size: 12px;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
}

.story-duration {
  background-color: #e0e0e0;
  border-radius: 10px;
  padding: 2px 8px;
  font-size: 10px;
}

.story-content {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 15px;
}

.story-image-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  /* object-fit: cover; /* This should be on img/video, not container */
  position: relative; /* Added for positioning context for the logo */
}

.story-image-container video{
  object-fit: cover;
}

.story-preview-logo {
    position: absolute;
    top: 70px;
    left: 20px;
    width: 80px;
    height: auto;
    z-index: 5; 
    opacity: 0.9;
}

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

.story-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,0.7));
  z-index: 1;
  border-top: 0 solid transparent; /* Attempt to fix html2canvas line artifact */
}

.story-text {
  position: relative;
  z-index: 2;
  margin-top: auto;
  padding: 20px;
  position: absolute;
  bottom: 90px;
}

.story-headline {
  color: white;
  font-size: 30px;
  font-weight: 700;
  margin-bottom: 8px;
  line-height:38px;
}

.story-subline {
  color: rgba(255,255,255,0.9);
  font-size: 14px;
  margin-bottom: 12px;
}

.story-cta {
  display: inline-block;
  background-color: var(--brand-blue);
  color: white;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 20px;
}

/* Story placeholder */
.story-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #999;
  text-align: center;
  padding: 20px;
}

.story-placeholder svg {
  margin-bottom: 15px;
  opacity: 0.5;
}

/* Story actions */
.story-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}

.story-action-btn {
  font-size: 12px;
  padding: 6px 12px;
}

/* Motion indicators - now part of .screen-header */
.motion-indicators {
  /* position: absolute; top: 10px; right: 10px; z-index: 10; */ /* Removed absolute positioning */
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.motion-indicator {
  background-color: rgba(255,255,255,0.7);
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.motion-indicator svg {
  width: 12px;
  height: 12px;
}

/* Story elements for editing */
.story-element {
  position: relative;
  padding: 5px;
  border: 1px dashed transparent;
  transition: border-color 0.2s;
  cursor: pointer;
}

.story-element:hover {
  border-color: rgba(255,255,255,0.4);
}

.story-element.selected {
  border-color: var(--brand-blue);
}

/* Edit panel */
.edit-panel {
  background-color: #f5f5f5;
  border-radius: 8px;
  padding: 15px;
  margin-top: 20px;
}

.edit-panel h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 15px;
}

.edit-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  align-items: center;
}

.edit-row label {
  min-width: 120px;
}

/* Timeline view */
.timeline-container {
  margin-top: 20px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 15px;
  background-color: #f9f9f9;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
}

.timeline {
  display: flex;
  width: 100%;
  height: 80px;
  background-color: #e0e0e0;
  border-radius: 4px;
  position: relative;
}

.timeline-segment {
  height: 100%;
  background-color: var(--brand-blue);
  border-right: 1px solid white;
  position: relative;
  cursor: pointer;
}

.timeline-segment.selected {
  background-color: var(--orange);
}

.timeline-segment-label {
  position: absolute;
  bottom: -20px;
  left: 0;
  width: 100%;
  text-align: center;
  font-size: 10px;
  color: #666;
}

.timeline-marker {
  position: absolute;
  top: 0;
  width: 2px;
  height: 100%;
  background-color: red;
  z-index: 1;
}

/* Screen units */
.storyboard-screens {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 20px;
}

.screen-unit {
  width: 330px;
}

.screen-unit .layout-option.right-block-layout,.screen-unit .layout-option.left-block-layout{
  display: none;;
}


.screen-content {
  position: relative;
  width: 320px;
  height: 560px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background-color: #f5f5f5;
  margin-bottom: 10px;
}

.screen-actions {
  display: flex;
  justify-content: space-between;
  flex-direction: column;
}

.screen-number {
  background-color: var(--brand-blue);
  color: white;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  /* position: absolute; top: 10px; left: 10px; z-index: 10; */ /* Removed absolute positioning */
}

.sketch-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%; /* Ensure it fills the image container space */
    background-color: #f0f0f0; /* Light background for loading state */
}

.sketch-loading .loading-indicator {
    font-size: 14px;
    color: #555;
}


/* Styles moved from video-storyboard.html and not found in shared.css or existing video.css */

.image-generation-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.image-generation-modal.active {
  display: flex;
}

.modal-content { /* General modal content, might need scoping if other modals differ */
  background: white;
  border-radius: 8px;
  width: 90%;
  max-width: 600px; /* Max width for this modal type */
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
}

.close-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
}

.generated-image-preview { /* Preview for generated images in modal */
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  margin: 20px 0;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Styling for per-screen layout selectors */
.screen-unit .screen-actions .layout-selector-group {
  margin-bottom: 10px; /* Space below the layout selector */
  padding-bottom: 10px; /* Space below the layout selector */
  border-bottom: 1px solid var(--border-color-light); /* Separator line */
  width: 100%; /* Ensure it takes full width within actions */
}

.screen-unit .screen-actions .layout-selector-group label {
  font-size: 11px; /* Smaller label */
  font-weight: 500;
  margin-bottom: 4px;
  display: block; /* Ensure label is on its own line */
  color: #555;
}

.screen-unit .screen-actions .layout-options {
  justify-content: space-around; /* Distribute options evenly */
  gap: 5px; /* Smaller gap */
}

.screen-unit .screen-actions .layout-option {
  width: 40px; /* Smaller width */
  height: 30px; /* Smaller height */
  border-width: 1px; /* Thinner border */
}

.screen-unit .screen-actions .layout-option-label {
  font-size: 9px; /* Smaller text */
  bottom: 2px; /* Adjust position */
}

/* Adjustments for specific layout previews within the selector */
.screen-unit .screen-actions .layout-option.full-img-layout::before {
  height: 100%; /* Full height */
}
.screen-unit .screen-actions .layout-option.bottom-block-layout::before {
  height: 60%; /* Image part */
}
.screen-unit .screen-actions .layout-option.bottom-block-layout::after {
  height: 40%; /* Block part */
  bottom: 0;
}
.screen-unit .screen-actions .layout-option.right-block-layout::before {
  width: 60%; /* Image part */
  height: 100%;
  left: 0;
}
.screen-unit .screen-actions .layout-option.right-block-layout::after {
  width: 40%; /* Block part */
  height: 100%;
  right: 0;
}
.screen-unit .screen-actions .layout-option.left-block-layout::before {
  width: 60%; /* Image part */
  height: 100%;
  right: 0;
}
.screen-unit .screen-actions .layout-option.left-block-layout::after {
  width: 40%; /* Block part */
  height: 100%;
  left: 0;
}
.screen-unit .screen-actions .layout-option.full-color-layout::after {
  height: 100%; /* Full color block */
  width: 100%;
}

.screen-content.layout-bottom-block .story-text{
  bottom: 60px;
}

.screen-unit .screen-actions .layout-options{
  justify-content: flex-start;
}

.screen-unit .screen-actions .layout-option{
  width: 60px;
  height:50px;
}

.screen-unit .layout-option-label{
  top: 0;
  height: 20px;
  bottom:auto;
}
