:root {
    --bg-color: #f5f5f8;
    --text-color: #222;
    --accent-color: #7b2cbf;
    --accent-gradient: linear-gradient(135deg, #7b2cbf, #9d4edd);
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(0, 0, 0, 0.1);
    --font-main: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-image: radial-gradient(circle at 10% 20%, rgba(123, 44, 191, 0.06) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(255, 100, 0, 0.03) 0%, transparent 20%);
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.container-fluid {
    width: 95%;
    margin: 0 auto;
    padding: 2rem;
}

.center-content {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

h1 {
    font-weight: 600;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.glass-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 400;
    color: #555;
}

textarea,
input[type="text"] {
    width: 100%;
    padding: 1rem;
    background: #fff;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: #222;
    font-family: inherit;
    font-size: 1rem;
    box-sizing: border-box;
}

textarea:focus {
    outline: none;
    border-color: #9d4edd;
}

.btn-primary {
    display: block;
    width: 100%;
    padding: 1rem;
    background: var(--accent-gradient);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: opacity 0.3s;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-secondary {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--glass-border);
    color: #555;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.3s;
}

.btn-secondary:hover {
    background: rgba(0, 0, 0, 0.05);
}

.file-upload-wrapper {
    background: rgba(0, 0, 0, 0.02);
    padding: 2rem;
    border-radius: 8px;
    border: 2px dashed var(--glass-border);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.file-upload-wrapper:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.2);
}

.file-upload-wrapper.highlight {
    border-color: var(--accent-color);
    background: rgba(123, 44, 191, 0.05);
    transform: scale(1.02);
}

.file-upload-wrapper input[type="file"] {
    display: none;
}

.preview-gallery {
    display: none;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 1rem;
}

.preview-thumb {
    height: 100px;
    width: auto;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Status Page */
.loader {
    border: 4px solid rgba(0, 0, 0, 0.08);
    border-top: 4px solid #9d4edd;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.error {
    color: #d32f2f;
}

/* Results Page */
.storyboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.scene-card {
    transition: transform 0.3s;
}

.scene-card:hover {
    transform: translateY(-5px);
}

.scene-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.badge {
    background: rgba(157, 78, 221, 0.1);
    color: #7b2cbf;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.frames-container {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.frame {
    flex: 1;
    min-width: 0;
}

.frame-label {
    display: block;
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 0.5rem;
}

.frame-img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.frame-prompt {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.4;
    max-height: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.scene-details p {
    font-size: 0.9rem;
    color: #555;
    margin: 0.2rem 0;
}

select.select-input {
    width: 100%;
    padding: 1rem;
    background: #fff;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: #222;
    font-family: inherit;
    font-size: 1rem;
    box-sizing: border-box;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.2rem;
    cursor: pointer;
}

select.select-input:focus {
    outline: none;
    border-color: #9d4edd;
}

select.select-input option {
    background-color: #fff;
    color: var(--text-color);
}

/* File Drop Zone Styles */
.file-drop-zone {
    border: 2px dashed rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.02);
    position: relative;
    cursor: pointer;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.file-drop-zone:hover, .file-drop-zone.highlight {
    border-color: #7b2cbf;
    background: rgba(123, 44, 191, 0.04);
}

.file-drop-zone input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.file-list {
    margin-top: 10px;
    font-size: 0.85em;
    color: #555;
    text-align: left;
    width: 100%;
}

/* Navigation Header */
.nav-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 0.2rem;
    padding: 0.6rem 1rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

body {
    padding-top: 48px;
}

.nav-header a {
    color: #666;
    text-decoration: none;
    padding: 0.35rem 0.65rem;
    border-radius: 8px;
    transition: all 0.3s;
    font-size: 0.82rem;
    white-space: nowrap;
}

.nav-header a:hover {
    color: #333;
    background: rgba(0, 0, 0, 0.05);
}

.nav-header a.active {
    background: var(--accent-gradient);
    color: white;
}

/* .nav-header-fixed no longer needed — nav is always fixed */

/* ======== Font Picker ======== */
.font-picker { position: relative; flex: 1; }
.fp-trigger {
    background: #fff; border: 1px solid rgba(0,0,0,0.15); border-radius: 4px;
    padding: 0.3rem 0.5rem; cursor: pointer; font-size: 0.8rem;
    display: flex; align-items: center; justify-content: space-between;
    min-height: 28px; overflow: hidden; white-space: nowrap;
}
.fp-trigger:hover { border-color: rgba(123,44,191,0.4); }
.fp-arrow { font-size: 0.55rem; color: #999; margin-left: 4px; flex-shrink: 0; }
.fp-dropdown {
    position: absolute; top: calc(100% + 2px); left: 0; z-index: 1000;
    background: #fff; border: 1px solid rgba(0,0,0,0.12); border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18); max-height: 340px;
    display: none; flex-direction: column; min-width: 240px; width: max-content;
}
.fp-dropdown.open { display: flex; }
.fp-search {
    padding: 0.5rem 0.6rem; border: none; border-bottom: 1px solid rgba(0,0,0,0.08);
    font-size: 0.8rem; outline: none; font-family: inherit;
    background: rgba(0,0,0,0.02); border-radius: 8px 8px 0 0;
}
.fp-search::placeholder { color: #aaa; }
.fp-list { overflow-y: auto; flex: 1; padding: 4px 0; }
.fp-group-label {
    padding: 0.35rem 0.6rem 0.2rem; font-size: 0.6rem; color: #999;
    text-transform: uppercase; letter-spacing: 0.8px; font-family: 'Outfit', sans-serif;
    font-weight: 600;
}
.fp-item {
    padding: 0.3rem 0.6rem; cursor: pointer; display: flex;
    align-items: center; gap: 0.6rem; transition: background 0.1s;
    border-radius: 4px; margin: 0 4px;
}
.fp-item:hover { background: rgba(123, 44, 191, 0.08); }
.fp-item.fp-selected { background: rgba(123, 44, 191, 0.12); }
.fp-preview {
    font-size: 1.15rem; line-height: 1.3; flex: 1;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fp-name {
    font-size: 0.6rem; color: #aaa; font-family: 'Outfit', sans-serif;
    flex-shrink: 0; min-width: 0; text-align: right;
}
