/* The Royal Postcard - Wedding Invitation Video Maker Styles */

:root {
    --royal-maroon: #5c1020;
    --royal-burgundy: #420815;
    --vermilion-red: #c8232c;
    --antique-gold: #c59b3f;
    --bright-gold: #e4b85d;
    --deep-gold: #967024;
    --sage-green: #3f664a;
    --emerald-green: #1d4d31;
    --dusty-rose: #c76b7b;
    --ivory-cream: #fbf7ee;
    --warm-cream: #f4ecdc;
}

/* Tool Layout */
.wedding-tool-grid {
    display: grid;
    grid-template-columns: minmax(0, 440px) minmax(0, 1fr);
    gap: 1.75rem;
    align-items: start;
    margin-top: 1rem;
}

@media (max-width: 980px) {
    .wedding-tool-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Player Column */
.player-column {
    position: sticky;
    top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.canvas-preview-wrapper {
    position: relative;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    aspect-ratio: 9 / 16;
    background: #1a1617;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(197, 155, 63, 0.35);
}

#invitationCanvas {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

/* Player Controls Overlay & Bar */
.player-toolbar {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.timeline-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.timeline-slider {
    flex: 1;
    height: 6px;
    border-radius: 4px;
    background: var(--border-color);
    outline: none;
    cursor: pointer;
    accent-color: var(--vermilion-red);
}

.time-display {
    font-family: 'Manrope', monospace;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
    min-width: 78px;
    text-align: right;
}

.controls-actions-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.playback-buttons {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.player-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.player-btn:hover {
    border-color: var(--antique-gold);
    background: rgba(197, 155, 63, 0.08);
}

.player-btn.active {
    background: var(--vermilion-red);
    color: #ffffff;
    border-color: var(--vermilion-red);
}

.scene-chips {
    display: flex;
    gap: 0.35rem;
    overflow-x: auto;
    padding-bottom: 4px;
}

.scene-chip {
    padding: 3px 8px;
    font-size: 0.74rem;
    font-weight: 700;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.scene-chip:hover {
    border-color: var(--antique-gold);
    color: var(--text-main);
}

.scene-chip.active {
    background: #5c1020;
    color: #e4b85d;
    border-color: #c59b3f;
}

/* Editor Panel & Tabs */
.editor-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.editor-tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    gap: 0.5rem;
    overflow-x: auto;
}

.editor-tab-btn {
    padding: 0.65rem 1rem;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    margin-bottom: -2px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.editor-tab-btn:hover {
    color: var(--text-main);
}

.editor-tab-btn.active {
    color: var(--vermilion-red);
    border-bottom-color: var(--vermilion-red);
}

.tab-pane {
    display: none;
    flex-direction: column;
    gap: 1.2rem;
}

.tab-pane.active {
    display: flex;
}

/* Form Styles */
.form-group-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.25rem 0 0.5rem 0;
    padding-bottom: 0.4rem;
    border-bottom: 1px dashed var(--border-color);
}

.input-grid-2 {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.85rem;
}

@media (max-width: 640px) {
    .input-grid-2 {
        grid-template-columns: minmax(0, 1fr);
    }
}

.input-field-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.input-field-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
}

.text-input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-color);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.9rem;
    box-sizing: border-box;
    transition: border-color 0.15s ease;
}

.text-input:focus {
    outline: none;
    border-color: var(--antique-gold);
    box-shadow: 0 0 0 3px rgba(197, 155, 63, 0.15);
}

/* Photo Upload Cards */
.photo-upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.photo-card {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-color);
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    transition: border-color 0.15s ease;
}

.photo-card:hover {
    border-color: var(--antique-gold);
}

.photo-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.photo-card-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-main);
}

.photo-card-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(197, 155, 63, 0.15);
    color: #967024;
}

.photo-card-badge.uploaded {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.photo-thumbnail-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.photo-thumbnail-box {
    width: 64px;
    height: 80px;
    border-radius: 6px;
    border: 2px dashed var(--border-color);
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

.photo-thumbnail-box.has-image {
    border-style: solid;
    border-color: var(--antique-gold);
}

.photo-thumbnail-box.square {
    height: 64px;
}

.photo-thumbnail-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.photo-thumbnail-box.has-image img {
    display: block;
}

.photo-thumbnail-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--text-muted);
}

.photo-thumbnail-box.has-image .photo-thumbnail-placeholder {
    display: none;
}

.photo-file-controls {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.photo-actions-row {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.btn-upload-photo {
    font-size: 0.8rem;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--antique-gold);
    background: rgba(197, 155, 63, 0.1);
    color: var(--text-main);
    cursor: pointer;
    text-align: center;
    font-weight: 700;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.btn-upload-photo:hover {
    background: var(--antique-gold);
    color: #ffffff;
}

.btn-remove-photo {
    font-size: 0.75rem;
    padding: 5px 8px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: #ef4444;
    cursor: pointer;
    font-weight: 600;
    display: none;
    transition: all 0.15s ease;
}

.btn-remove-photo:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
}

.photo-card.has-photo .btn-remove-photo {
    display: inline-block;
}

.demo-photos-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.custom-file-btn {
    font-size: 0.8rem;
    padding: 5px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-main);
    cursor: pointer;
    text-align: center;
    font-weight: 600;
    transition: all 0.15s ease;
}

.custom-file-btn:hover {
    border-color: var(--antique-gold);
}

.photo-card.drag-over {
    border-color: var(--vermilion-red) !important;
    background: rgba(200, 35, 44, 0.06) !important;
}

.photo-thumbnail-box.drag-over {
    border-color: var(--vermilion-red) !important;
    background: rgba(200, 35, 44, 0.1) !important;
}

.photo-adjustments {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.45rem;
    font-size: 0.78rem;
    margin-top: 0.35rem;
}

.slider-group {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.slider-group label {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
}

.photo-slider {
    width: 100%;
    height: 4px;
    accent-color: var(--antique-gold);
}

/* Audio & Music Panel */
.audio-card {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-color);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.audio-track-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.65rem;
}

.audio-track-pill {
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-surface);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    transition: all 0.15s ease;
}

.audio-track-pill:hover {
    border-color: var(--antique-gold);
}

.audio-track-pill.active {
    border-color: var(--vermilion-red);
    background: rgba(200, 35, 44, 0.08);
    color: var(--vermilion-red);
}

/* Export Progress Modal */
.export-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

.export-modal {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    width: 90%;
    max-width: 480px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.export-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--vermilion-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

.export-progress-bar-bg {
    width: 100%;
    height: 10px;
    background: var(--border-color);
    border-radius: 5px;
    overflow: hidden;
}

.export-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--vermilion-red), var(--antique-gold));
    transition: width 0.1s linear;
}

/* Privacy & SEO Blocks */
.trust-badge-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 0.86rem;
    margin-top: 1rem;
}

.trust-badge-icon {
    width: 24px;
    height: 24px;
    color: #10b981;
    flex-shrink: 0;
}

.llm-context-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-muted);
}

.llm-context-card strong {
    color: var(--text-main);
}
