/**
 * ProEdit Standalone Software Frames Design
 * إطارات شاشات البرنامج المستقلة بالوضع النهاري الفاتح
 * مستوحاة بدقة من واجهة ProEdit الأصلية
 */

/* Container for standalone program frame */
.app-frame-wrapper {
  margin: 40px auto 60px auto;
  max-width: 1140px;
  position: relative;
}

/* Standalone Desktop Window Frame */
.software-window {
  background: #e9eff7;
  border: 1px solid #c2d0e2;
  border-radius: 16px;
  box-shadow: 0 25px 65px -10px rgba(21, 34, 56, 0.18),
              0 0 0 1px rgba(255, 255, 255, 0.8) inset;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.35s ease;
}

.software-window:hover {
  box-shadow: 0 30px 80px -10px rgba(21, 34, 56, 0.22),
              0 0 0 1px rgba(255, 255, 255, 0.9) inset;
}

/* Window Titlebar */
.window-titlebar {
  background: linear-gradient(180deg, #f4f8fd 0%, #e5edf7 100%);
  border-bottom: 1px solid #c4d2e4;
  padding: 11px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.window-controls-dots {
  display: flex;
  align-items: center;
  gap: 7px;
}

.win-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.win-dot.red { background: #ff5f56; border-color: #e0443e; }
.win-dot.yellow { background: #ffbd2e; border-color: #dea123; }
.win-dot.green { background: #27c93f; border-color: #1aab29; }

.window-title-text {
  font-size: 0.85rem;
  font-weight: 700;
  color: #31445f;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-ar);
}

.window-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #c7d4e4;
  color: #152238;
}

.status-dot-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #108e5e;
  box-shadow: 0 0 0 2px rgba(16, 142, 94, 0.25);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* Software Top Ribbon / Tabs */
.software-ribbon-bar {
  background: #dbe4f0;
  border-bottom: 1px solid #c1d0e2;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
}

.ribbon-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #4b5f7a;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.ribbon-tab:hover {
  background: rgba(255, 255, 255, 0.5);
  color: #152238;
}

.ribbon-tab.active {
  background: #ffffff;
  color: #ff5512;
  box-shadow: 0 2px 6px rgba(21, 34, 56, 0.08);
}

.ribbon-badge-pill {
  font-size: 0.65rem;
  padding: 1px 5px;
  border-radius: 4px;
  background: #ff5512;
  color: white;
}

/* Software Main Body - Split Panes */
.software-body-grid {
  display: grid;
  grid-template-columns: 280px 1fr 280px;
  min-height: 480px;
  background: #f1f5fa;
}

.pane-column {
  border-left: 1px solid #c8d5e4;
  display: flex;
  flex-direction: column;
  background: #edf2f8;
}

.pane-column.left-pane {
  border-left: 1px solid #c8d5e4;
  border-right: none;
}

.pane-column.right-pane {
  border-left: none;
  border-right: 1px solid #c8d5e4;
}

.pane-header {
  padding: 10px 14px;
  background: #e3ecf6;
  border-bottom: 1px solid #c9d6e4;
  font-size: 0.8rem;
  font-weight: 800;
  color: #2c405a;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pane-content-body {
  padding: 14px;
  overflow-y: auto;
  flex: 1;
}

/* Center Work Area (Preview + Timeline) */
.center-work-pane {
  display: flex;
  flex-direction: column;
  background: #e7eef7;
}

/* Video Monitor / Canvas */
.video-preview-canvas {
  flex: 1.1;
  background: #111824;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 270px;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.video-screen-content {
  width: 90%;
  height: 82%;
  background: linear-gradient(135deg, #1b263b, #0d1b2a);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-screen-bg-graphic {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 60% 40%, rgba(255, 85, 18, 0.25), transparent 50%),
              radial-gradient(circle at 30% 70%, rgba(28, 100, 194, 0.25), transparent 50%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-actor-mockup {
  position: relative;
  z-index: 2;
  text-align: center;
}

.actor-face-box {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: #2b394e;
  border: 2px dashed #ff5512;
  margin: 0 auto 10px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ff8c5a;
  position: relative;
}

.retouch-tag {
  position: absolute;
  top: -8px;
  right: -10px;
  background: #108e5e;
  color: white;
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}

/* Word-Level Captions Overlay */
.video-subtitle-overlay {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  background: rgba(12, 20, 32, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 8px 18px;
  border-radius: 8px;
  backdrop-filter: blur(8px);
  white-space: nowrap;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}

.caption-word {
  display: inline-block;
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0 4px;
}

.caption-word.highlight {
  color: #ff5512;
  transform: scale(1.1);
  text-shadow: 0 0 12px rgba(255, 85, 18, 0.8);
}

/* Playback Control Bar */
.playback-controls-bar {
  background: #e2ebf5;
  border-top: 1px solid #c6d4e4;
  border-bottom: 1px solid #c6d4e4;
  padding: 7px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: #3b506d;
}

.timecode-display {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.92rem;
  color: #152238;
  background: #ffffff;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid #c4d3e3;
}

/* Timeline Panel */
.timeline-panel-wrap {
  flex: 1;
  background: #e8f0f8;
  display: flex;
  flex-direction: column;
  min-height: 190px;
}

.timeline-ruler {
  height: 24px;
  background: #dce6f2;
  border-bottom: 1px solid #c4d3e3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: #647892;
}

.timeline-tracks-area {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  position: relative;
  overflow-x: auto;
}

/* Timeline Playhead line */
.timeline-playhead-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 45%;
  width: 2px;
  background: #ff5512;
  z-index: 10;
  box-shadow: 0 0 8px rgba(255, 85, 18, 0.8);
}

.playhead-head {
  position: absolute;
  top: 0;
  left: -5px;
  width: 12px;
  height: 10px;
  background: #ff5512;
  clip-path: polygon(0% 0%, 100% 0%, 50% 100%);
}

.track-row {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 32px;
}

.track-header-label {
  width: 52px;
  font-size: 0.7rem;
  font-weight: 800;
  color: #4c6280;
  background: #d4e0ee;
  border-radius: 4px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.track-clips-container {
  flex: 1;
  background: #dbe5f2;
  border-radius: 4px;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  padding: 2px 4px;
  gap: 4px;
}

.timeline-clip {
  height: 26px;
  border-radius: 4px;
  padding: 0 8px;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.clip-video {
  background: #c2daf8;
  border: 1px solid #94bcf0;
  color: #124180;
}

.clip-cut-silence {
  background: #ffdfd4;
  border: 1px dashed #ff845a;
  color: #a82e04;
}

.clip-subtitle {
  background: #fbf0b5;
  border: 1px solid #e2cf6c;
  color: #63530a;
}

.clip-audio {
  background: #bbf0dc;
  border: 1px solid #7de3be;
  color: #0c6140;
}

.clip-sfx {
  background: #e2d2fd;
  border: 1px solid #be9efc;
  color: #4b1bad;
}

/* Chat Prompt Box in Left Pane */
.chat-agent-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
}

.agent-msg-bubble {
  background: #ffffff;
  border: 1px solid #cad7e6;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.82rem;
  color: #1a2c44;
  line-height: 1.5;
}

.agent-msg-bubble.user {
  background: #e3effd;
  border-color: #bad3f5;
  align-self: flex-start;
}

.agent-prompt-input-group {
  margin-top: auto;
  position: relative;
}

.agent-prompt-input {
  width: 100%;
  background: #ffffff;
  border: 1px solid #c2d1e2;
  border-radius: 8px;
  padding: 10px 38px 10px 12px;
  font-size: 0.82rem;
  color: #152238;
  outline: none;
}

.agent-prompt-input:focus {
  border-color: #ff5512;
  box-shadow: 0 0 0 2px rgba(255, 85, 18, 0.15);
}

.agent-send-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: 8px;
  background: #ff5512;
  color: white;
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Right Pane Inspector Controls */
.inspector-control-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.inspector-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #3b506c;
  font-weight: 600;
}

.inspector-slider {
  width: 110px;
  height: 5px;
  -webkit-appearance: none;
  background: #cbd8e8;
  border-radius: 3px;
  outline: none;
}

.inspector-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ff5512;
  cursor: pointer;
}

/* Frame Switcher Bar on Website */
.frame-switcher-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.frame-switch-btn {
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border-line);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--txt-dim);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.frame-switch-btn:hover {
  background: var(--surface-panel);
  color: var(--txt-main);
  transform: translateY(-1px);
}

.frame-switch-btn.active {
  background: var(--acc-primary);
  color: white;
  border-color: var(--acc-primary);
  box-shadow: 0 4px 16px rgba(255, 85, 18, 0.35);
}

/* Responsive adjustment for frames */
@media (max-width: 900px) {
  .software-body-grid {
    grid-template-columns: 1fr;
  }
  .pane-column {
    display: none;
  }
}
