/* ============================================
   GIŠHUR — Storyboard Builder Styles
   Matches the Urban Design Toolkit light theme
   ============================================ */

/* Layout */
.gsh-layout {
    display: flex;
    gap: 0;
    height: 100%;
    overflow: hidden;
    background: var(--bg-primary);
}

/* ---- Left Panel: Setup ---- */
.gsh-setup-panel {
    width: 300px;
    min-width: 280px;
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: var(--bg-secondary);
}

.gsh-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
    padding: 0 0 8px;
    border-bottom: 1px solid var(--border-color);
}

.gsh-panel-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.gsh-panel-subtitle {
    font-size: 10px;
    color: var(--text-muted);
}

.gsh-meaning-box {
    background: var(--warning-light);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    margin-bottom: 8px;
}

.gsh-meaning-en {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 6px;
}

.gsh-meaning-en strong {
    color: var(--text-primary);
}

.gsh-meaning-ar {
    font-size: 11px;
    color: var(--text-secondary);
    direction: rtl;
    text-align: right;
    line-height: 1.5;
}

.gsh-meaning-ar strong {
    color: var(--text-primary);
}

/* Sections */
.gsh-section {
    margin-bottom: 10px;
}

.gsh-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gsh-input {
    width: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    font-size: 12px;
    color: var(--text-primary);
    outline: none;
    transition: border-color var(--transition-normal);
    box-sizing: border-box;
    font-family: inherit;
}

.gsh-input:focus {
    border-color: var(--warning);
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.15);
}

.gsh-textarea {
    width: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    font-size: 12px;
    color: var(--text-primary);
    outline: none;
    resize: vertical;
    font-family: inherit;
    transition: border-color var(--transition-normal);
    box-sizing: border-box;
}

.gsh-textarea:focus {
    border-color: var(--warning);
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.15);
}

/* Mode Toggle */
.gsh-mode-toggle {
    display: flex;
    gap: 4px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 3px;
}

.gsh-mode-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    cursor: pointer;
    transition: all var(--transition-normal);
    font-family: inherit;
}

.gsh-mode-btn.active {
    background: var(--bg-secondary);
    color: var(--warning);
    box-shadow: var(--shadow-sm);
}

.gsh-mode-btn:hover:not(.active) {
    color: var(--text-primary);
    background: var(--bg-quaternary);
}

/* Pill Row */
.gsh-pill-row {
    display: flex;
    gap: 4px;
}

.gsh-pill {
    padding: 6px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-primary);
    cursor: pointer;
    transition: all var(--transition-normal);
    font-family: inherit;
}

.gsh-pill.active {
    background: var(--warning-light);
    border-color: var(--warning);
    color: #B45309;
}

.gsh-pill:hover:not(.active) {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Progression List */
.gsh-progression-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gsh-progression-btn {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    cursor: pointer;
    text-align: left;
    transition: all var(--transition-normal);
}

.gsh-progression-btn.active {
    background: var(--warning-light);
    border-color: var(--warning);
}

.gsh-progression-btn:hover:not(.active) {
    background: var(--bg-tertiary);
}

.gsh-prog-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.gsh-prog-desc {
    font-size: 10px;
    color: var(--text-muted);
}

.gsh-prog-shots {
    font-size: 12px;
    letter-spacing: 2px;
    margin-top: 2px;
}

/* Mood Grid */
.gsh-mood-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.gsh-mood-chip {
    padding: 5px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 11px;
    color: var(--text-secondary);
    background: var(--bg-primary);
    cursor: pointer;
    transition: all var(--transition-normal);
    font-family: inherit;
}

.gsh-mood-chip.active {
    background: color-mix(in srgb, var(--mood-color) 12%, white);
    border-color: var(--mood-color);
    color: color-mix(in srgb, var(--mood-color) 80%, black);
}

.gsh-mood-chip:hover:not(.active) {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Shot Grid */
.gsh-shot-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.gsh-shot-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 11px;
    color: var(--text-secondary);
    background: var(--bg-primary);
    cursor: pointer;
    transition: all var(--transition-normal);
    font-family: inherit;
}

.gsh-shot-chip.active {
    background: var(--warning-light);
    border-color: var(--warning);
    color: #B45309;
}

.gsh-shot-chip:hover:not(.active) {
    background: var(--bg-tertiary);
}

.gsh-shot-icon {
    font-size: 14px;
}

.gsh-shot-label {
    font-size: 10px;
}

/* Camera Movement */
.gsh-cam-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.gsh-cam-chip {
    padding: 5px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 11px;
    color: var(--text-secondary);
    background: var(--bg-primary);
    cursor: pointer;
    transition: all var(--transition-normal);
    font-family: inherit;
}

.gsh-cam-chip.active {
    background: var(--warning-light);
    border-color: var(--warning);
    color: #B45309;
}

.gsh-cam-chip:hover:not(.active) {
    background: var(--bg-tertiary);
}

/* Buttons */
.gsh-btn {
    padding: 10px 16px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    font-family: inherit;
}

.gsh-btn-generate {
    background: linear-gradient(135deg, #F59E0B, #D97706);
    color: #fff;
    margin-top: 8px;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.gsh-btn-generate:hover {
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
    transform: translateY(-1px);
}

.gsh-btn-generate:disabled {
    opacity: 0.6;
    transform: none;
    cursor: not-allowed;
}

.gsh-btn-sm {
    width: auto;
    padding: 6px 12px;
    font-size: 11px;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.gsh-btn-sm:hover {
    background: var(--bg-tertiary);
}

.gsh-btn-image {
    background: var(--warning-light) !important;
    border-color: var(--warning) !important;
    color: #B45309 !important;
}

.gsh-btn-image:hover {
    background: rgba(245, 158, 11, 0.2) !important;
}

.gsh-btn-danger {
    color: var(--danger) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
}

.gsh-btn-danger:hover {
    background: var(--danger-light) !important;
}

/* ---- Center Panel: Main ---- */
.gsh-main-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    background: var(--bg-primary);
}

/* Timeline Header */
.gsh-timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.gsh-timeline-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.gsh-frame-count {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 3px 10px;
    border-radius: var(--radius-full);
}

/* Timeline Filmstrip */
.gsh-timeline {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    overflow-x: auto;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    min-height: 100px;
    align-items: flex-start;
}

.gsh-timeline::-webkit-scrollbar {
    height: 4px;
}

.gsh-timeline::-webkit-scrollbar-track {
    background: transparent;
}

.gsh-timeline::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

.gsh-timeline-frame {
    flex-shrink: 0;
    width: 120px;
    cursor: pointer;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 2px solid transparent;
    transition: all 0.2s;
    background: var(--bg-secondary);
    box-shadow: var(--shadow-xs);
}

.gsh-timeline-frame:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-sm);
}

.gsh-timeline-frame.selected {
    border-color: var(--warning);
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2), var(--shadow-md);
}

.gsh-timeline-frame.generating {
    opacity: 0.6;
}

.gsh-timeline-thumb {
    width: 100%;
    height: 68px;
    overflow: hidden;
    background: var(--bg-quaternary);
}

.gsh-timeline-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gsh-timeline-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--text-muted);
}

.gsh-timeline-label {
    padding: 4px 6px;
    display: flex;
    gap: 4px;
    align-items: center;
}

.gsh-timeline-num {
    font-size: 10px;
    font-weight: 700;
    color: #B45309;
    background: var(--warning-light);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.gsh-timeline-title-text {
    font-size: 10px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gsh-timeline-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--text-muted);
    font-size: 12px;
}

/* Canvas */
.gsh-canvas {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--bg-primary);
    position: relative;
}

.gsh-canvas-frame {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

.gsh-canvas-image {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 12px;
}

.gsh-canvas-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.gsh-canvas-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 12px;
}

.gsh-canvas-icon {
    font-size: 48px;
    opacity: 0.5;
}

.gsh-canvas-info {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.gsh-canvas-num {
    font-size: 11px;
    font-weight: 600;
    color: #B45309;
}

.gsh-canvas-shot {
    font-size: 11px;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: var(--radius-xs);
}

.gsh-canvas-title {
    font-size: 12px;
    color: var(--text-primary);
    font-weight: 500;
}

.gsh-canvas-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    text-align: center;
}

.gsh-canvas-empty-icon {
    font-size: 48px;
    opacity: 0.3;
}

.gsh-canvas-empty h4 {
    margin: 0;
    font-size: 16px;
    color: var(--text-secondary);
}

.gsh-canvas-empty p {
    margin: 0;
    font-size: 12px;
    max-width: 280px;
}

/* ---- Right Panel: Detail ---- */
.gsh-detail-panel {
    width: 280px;
    min-width: 260px;
    border-left: 1px solid var(--border-color);
    overflow-y: auto;
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
}

.gsh-detail-panel .gsh-panel-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.gsh-detail-content {
    padding: 12px 16px;
    flex: 1;
}

.gsh-detail-frame {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gsh-detail-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gsh-detail-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gsh-detail-value {
    font-size: 12px;
    color: var(--text-primary);
}

.gsh-detail-desc {
    font-size: 11px;
}

.gsh-detail-prompt {
    font-size: 10px;
    color: var(--text-secondary);
}

.gsh-detail-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.gsh-detail-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-size: 12px;
    text-align: center;
    padding: 20px;
}

/* Spinners */
.gsh-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--warning-light);
    border-top-color: var(--warning);
    border-radius: 50%;
    animation: gsh-spin 0.8s linear infinite;
}

.gsh-spinner-lg {
    width: 32px;
    height: 32px;
    border: 3px solid var(--warning-light);
    border-top-color: var(--warning);
    border-radius: 50%;
    animation: gsh-spin 0.8s linear infinite;
}

@keyframes gsh-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Toast */
.gsh-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--text-primary);
    color: var(--text-inverse);
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 13px;
    z-index: var(--z-tooltip);
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-xl);
}

.gsh-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.gsh-toast-error {
    background: var(--danger);
}