:root {
    --primary-color: #3a86ff;
    --secondary-color: #8338ec;
    --accent-color: #ff006e;
    --background-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-color: #212529;
    --text-muted: #6c757d;
    --border-color: #dee2e6;
    --success-color: #38b000;
    --warning-color: #ffbe0b;
    --error-color: #ff5a5f;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1.5rem 2rem 1.5rem 4rem;
    text-align: center;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.logo h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(90deg, #ffffff, #f0f0f0);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tagline {
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 300;
    margin: 0;
}

/* Main Content */
main {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Stages Navigation */
.progress-indicator {
    margin: 2rem 0;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    margin-bottom: 2rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    transition: width 0.5s ease;
}

.stages-container {
    display: flex;
    justify-content: space-between;
    padding: 0 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.stage {
    flex: 1;
    min-width: 200px;
    display: flex;
    align-items: center;
    padding: 1rem;
    border-radius: 12px;
    background: #f8f9fa;
    color: #6c757d;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.stage-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 1rem;
    transition: all 0.3s ease;
}

.stage-info {
    flex: 1;
}

.stage-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.stage-desc {
    font-size: 0.8rem;
    opacity: 0.8;
}

.stage.active {
    background: #6366f1;
    color: white;
    border-color: #6366f1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.stage.active .stage-number {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.stage.completed {
    background: #10b981;
    color: white;
}

.stage.completed .stage-number {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.step-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fc, #e2e8f0);
    border-radius: 12px;
    border-left: 4px solid #6366f1;
}

.step-header h2 {
    color: #1e293b;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.step-instruction {
    color: #64748b;
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
}

@media (max-width: 768px) {
    .stages-container {
        flex-direction: column;
    }

    .stage {
        min-width: auto;
    }

    .step-header {
        padding: 1rem;
    }

    .step-header h2 {
        font-size: 1.25rem;
    }

    .step-instruction {
        font-size: 0.9rem;
    }
}


/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

input[type="text"] {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    font-size: 1rem;
    transition: var(--transition);
}

input[type="text"]:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(58, 134, 255, 0.2);
}

button {
    cursor: pointer;
    padding: 0.8rem 1.5rem;
    border-radius: 0.25rem;
    font-weight: 500;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #2d6ee4;
}

.btn-secondary {
    background-color: white;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-secondary:hover {
    background-color: #f0f8ff;
}

button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Section Styling */
section {
    background-color: var(--card-bg);
    border-radius: 0.5rem;
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

section h2 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.75rem;
}

/* Loading Animation */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 0;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top: 4px solid var(--primary-color);
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

/* Format Recommendation */
.recommendation-container {
    padding: 1rem;
}

.recommendation-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.book-title {
    font-size: 1.5rem;
    font-weight: 600;
}

.book-author {
    font-size: 1.1rem;
    color: var(--text-muted);
}

.recommendation-badge {
    background-color: var(--primary-color);
    color: white;
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    font-weight: 500;
    margin: 1rem 0;
}

.recommendation-badge span {
    font-weight: 700;
}

.recommendation-details {
    margin-bottom: 2rem;
}

.format-comparison {
    display: flex;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.format-card {
    flex: 1;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.25rem;
    transition: var(--transition);
}

.format-card.selected {
    border-color: var(--success-color);
    box-shadow: 0 0 0 1px var(--success-color);
}

.format-card h4 {
    margin-bottom: 1rem;
    text-align: center;
}

.metric {
    margin-bottom: 0.75rem;
}

.metric-label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.metric-bar {
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.metric-bar .fill {
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 4px;
}

.actions {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
}

/* Adaptation Preview */
.preview-container {
    padding: 1rem;
}

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

.adaptation-badge {
    background-color: var(--secondary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    font-weight: 500;
}

.preview-card {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.preview-card h3 {
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.character-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.character-preview {
    display: flex;
    gap: 1rem;
    width: 100%;
}

.character-avatar {
    flex-shrink: 0;
}

.character-details h4 {
    margin-bottom: 0.5rem;
}

/* Full Adaptation */
.adaptation-container {
    padding: 1rem;
}

.adaptation-header {
    text-align: center;
    margin-bottom: 2rem;
}

.adaptation-title {
    font-size: 2rem;
    font-weight: 700;
}

.adaptation-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.adaptation-author {
    font-size: 1rem;
    margin-top: 0.5rem;
}

.adaptation-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.tab {
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    font-weight: 500;
    transition: var(--transition);
}

.tab.active {
    border-bottom-color: var(--primary-color);
    color: var(--primary-color);
}

.tab-pane {
    padding: 1rem 0;
}

/* Synopsis Tab */
.synopsis-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.logline {
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-left: 4px solid var(--primary-color);
    border-radius: 0.25rem;
}

/* Characters Tab */
.characters-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.character-card {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    overflow: hidden;
}

.character-header {
    padding: 1rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid var(--border-color);
}

.character-role {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.character-body {
    padding: 1rem;
}

.character-profile {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.casting {
    flex: 1;
}

.casting h4 {
    margin-bottom: 0.5rem;
}

.casting ul {
    list-style-type: none;
    font-size: 0.9rem;
}

.character-arc {
    margin-top: 1rem;
}

/* Structure Tab */
.acts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.act-card {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.25rem;
}

.act-card h4 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.key-scenes {
    margin-top: 1rem;
}

.key-scenes ul {
    list-style-position: inside;
    font-size: 0.9rem;
}

.episodes-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.episode-card {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
}

.episode-header {
    display: flex;
    gap: 0.5rem;
    align-items: baseline;
    margin-bottom: 0.75rem;
}

.episode-number {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--primary-color);
}

/* Visual Style Tab */
.visual-style-container > div {
    margin-bottom: 2rem;
}

.palette-swatches {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.color-swatch {
    width: 80px;
    height: 80px;
    border-radius: 0.25rem;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 0.5rem;
}

.color-name {
    background-color: rgba(255, 255, 255, 0.8);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
}

.locations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.location-card {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.25rem;
}

.visual-references ul {
    list-style-type: none;
}

.visual-references li {
    margin-bottom: 0.75rem;
}

.reference-title {
    font-weight: 500;
}

/* Music Tab */
.themes-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.theme-item {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.25rem;
}

.music-references ul {
    list-style-type: none;
}

.music-references li {
    margin-bottom: 0.75rem;
}

.composer-name {
    font-weight: 500;
}

/* Footer */
footer {
    background-color: #212529;
    color: white;
    padding: 1.5rem;
    text-align: center;
    margin-top: auto;
}

.disclaimer {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-top: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    main {
        padding: 1rem;
    }

    .format-comparison {
        flex-direction: column;
    }

    .preview-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .stages-container {
        display: none;
    }

    /* Scale down large elements */
    .logo h1 {
        font-size: 1.8rem;
    }

    .tagline {
        font-size: 0.95rem;
    }

    section {
        padding: 1.5rem;
    }

    .book-info-form {
        padding: 1rem;
    }

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

    textarea {
        min-height: 80px;
    }

    .actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    .actions button {
        width: 100%;
        padding: 0.75rem;
    }
}

@media (max-width: 480px) {
    header {
        padding: 1rem 1rem 1rem 3rem;
    }

    .logo h1 {
        font-size: 1.5rem;
    }

    .tagline {
        font-size: 0.85rem;
    }

    main {
        padding: 0.75rem;
    }

    section {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .step-header {
        padding: 1rem;
    }

    .step-header h2 {
        font-size: 1.25rem;
    }

    .step-instruction {
        font-size: 0.9rem;
    }

    .form-group label {
        font-size: 0.9rem;
    }

    input[type="text"],
    textarea,
    select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.75rem;
    }

    .genre-selector,
    .themes-selector {
        font-size: 16px;
        padding: 0.75rem;
    }

    .book-info-card {
        padding: 1rem;
    }

    .book-info-card h3 {
        font-size: 1.2rem;
    }

    .book-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Book Information Form */
.book-info-form {
    max-width: 800px;
    margin: 0 auto;
}

.book-info-form .info-text {
    margin-bottom: 1.5rem;
    color: var(--text-muted);
}

.book-info-form textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    font-size: 1rem;
    transition: var(--transition);
    font-family: inherit;
    resize: vertical;
}

.book-info-form textarea:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(58, 134, 255, 0.2);
}

/* Book Found Confirmation */
.book-found-confirmation {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 700px;
    margin: 0 auto;
}

.book-info-card {
    background-color: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    width: 100%;
    margin-bottom: 1.5rem;
}

.book-info-card h3 {
    font-size: 1.4rem;
    margin-bottom: 0.25rem;
}

.book-info-card .author {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.book-info-card .description {
    line-height: 1.6;
    margin-bottom: 1rem;
}

.book-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.info-message {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

@media (max-width: 600px) {
    .actions {
        flex-direction: column;
        width: 100%;
    }

    .actions button {
        width: 100%;
    }
}

/* Genre Selector Styles */
.dropdown-container {
    width: 100%;
}

.genre-selector,
.themes-selector {
    width: 100%;
    padding: 0.8rem;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
    max-height: 300px;
}

.genre-selector:focus,
.themes-selector:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(58, 134, 255, 0.2);
}

.genre-selector optgroup,
.themes-selector optgroup {
    font-weight: bold;
    color: var(--primary-color);
    margin-top: 0.5rem;
}

.genre-selector option,
.themes-selector option {
    padding: 0.5rem;
    font-weight: normal;
    color: var(--text-color);
}

.genre-selector optgroup option,
.themes-selector optgroup option {
    padding-left: 1rem;
}

.help-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    display: block;
}

/* Script Generation & Viewing */
.script-selector {
    margin-bottom: 2rem;
}

.episode-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1.5rem 0;
}

.episode-selector-item {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.episode-selector-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.episode-selector-item.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.script-viewer {
    margin-top: 1.5rem;
}

.script-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.script-toolbar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.export-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.scenes-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.scene-card {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    overflow: hidden;
}

.scene-heading {
    background-color: #f8f9fa;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    cursor: pointer;
    font-weight: 500;
}

.scene-details {
    padding: 1rem;
}

.scene-description {
    margin-bottom: 1.25rem;
    line-height: 1.5;
    position: relative;
}

.dialogue-container {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.dialogue-entry {
    margin-bottom: 1.25rem;
}

.character-name {
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.parenthetical {
    font-style: italic;
    opacity: 0.8;
    margin-bottom: 0.25rem;
    padding-left: 1rem;
}

.dialogue-line {
    position: relative;
    padding-right: 2.5rem;
}

.scene-transition {
    text-align: right;
    font-weight: 500;
    margin-top: 1rem;
}

.edit-btn {
    position: absolute;
    right: 0;
    top: 0;
    background: transparent;
    border: none;
    color: var(--primary-color);
    font-size: 0.75rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}

.scene-description:hover .edit-btn,
.dialogue-line:hover .edit-btn {
    opacity: 1;
}

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

.edit-container {
    background-color: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    width: 80%;
    max-width: 600px;
}

.edit-container textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    font-size: 1rem;
    margin: 1rem 0;
    font-family: inherit;
}

.edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.music-note {
    margin-top: 1rem;
    padding: 0.75rem;
    background-color: #f8f9fa;
    border-left: 3px solid var(--accent-color);
    font-style: italic;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    background-color: #f8f9fa;
    border-radius: 0.5rem;
}

.save-download-panel {
    margin: 1rem 0;
    position: relative;
}

.panel-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.panel-buttons button svg {
    margin-right: 0.5rem;
    vertical-align: middle;
}

.history-btn {
    margin-left: auto;
}

.history-panel {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.history-panel h4 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.empty-history {
    color: var(--text-muted);
    font-style: italic;
    padding: 1rem 0;
}

.history-list {
    list-style-type: none;
}

.history-item {
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 0;
}

.history-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.history-name {
    font-weight: 500;
    margin: 0.25rem 0;
}

.history-formats {
    font-size: 0.9rem;
}

.close-history {
    margin-top: 1rem;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: var(--card-bg);
    border-radius: 0.5rem;
    padding: 1.5rem;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow);
}

.modal-content h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.saved-versions {
    margin: 1.5rem 0;
}

.versions-list {
    list-style-type: none;
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    padding: 0.5rem;
}

.versions-list li {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.versions-list li:last-child {
    border-bottom: none;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.download-options {
    margin: 1rem 0;
}

.option {
    margin-bottom: 1rem;
}

.option label {
    display: inline;
    margin-left: 0.5rem;
}

.option-description {
    margin-left: 1.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.home-icon {
    position: absolute;
    top: 1rem;
    left: 1rem;
    color: white;
    font-size: 1.5rem;
    text-decoration: none;
    padding: 0.5rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    z-index: 10;
}

.home-icon:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
    color: white;
}

.info-icon {
    position: absolute;
    top: 4.5rem;
    left: 1rem;
    color: white;
    font-size: 1.5rem;
    text-decoration: none;
    padding: 0.5rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    z-index: 10;
}

.info-icon:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
    color: white;
}

@media (max-width: 768px) {
    header {
        padding: 1rem 1rem 1rem 3rem;
    }

    .logo h1 {
        font-size: 1.8rem;
    }

    .tagline {
        font-size: 1rem;
    }

    .home-icon {
        top: 0.75rem;
        left: 0.75rem;
        font-size: 1.3rem;
        padding: 0.4rem;
    }
}

@media (max-width: 480px) {
    header {
        padding: 0.75rem 0.5rem 0.75rem 2.5rem;
    }

    .logo h1 {
        font-size: 1.5rem;
    }

    .tagline {
        font-size: 0.9rem;
    }

    .home-icon {
        top: 0.5rem;
        left: 0.5rem;
        font-size: 1.1rem;
        padding: 0.3rem;
    }
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.action-btn {
    background: rgba(58, 134, 255, 0.1);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.5rem;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 0.9rem;
}

.action-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(58, 134, 255, 0.3);
}

.action-btn:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .action-buttons {
        justify-content: center;
        margin: 1rem 0 1.5rem 0;
    }

    .action-btn {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
}

/* Save Download Panel and History */
.save-download-panel {
    margin: 1rem 0;
    position: relative;
}

/* Added styles for genre dropdown */
.genre-dropdown-container {
        margin-top: 1rem;
    }

    .genre-dropdown {
        width: 100%;
        padding: 0.75rem;
        border: 2px solid #e2e8f0;
        border-radius: 8px;
        font-size: 1rem;
        background: white;
        cursor: pointer;
        transition: border-color 0.2s ease;
    }

    .genre-dropdown:focus {
        outline: none;
        border-color: #60a5fa;
    }

    .selected-dropdown-genres {
        margin-top: 1rem;
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .dropdown-selected {
        position: relative;
        cursor: pointer;
        background: linear-gradient(135deg, #667eea, #764ba2) !important;
        color: white !important;
    }

    .dropdown-selected i {
        margin-left: 0.5rem;
        font-size: 0.8rem;
        opacity: 0.8;
    }

    .dropdown-selected:hover {
        background: linear-gradient(135deg, #5a6fd8, #6a4190) !important;
    }

    .story-direction-selector {
        width: 100%;
        padding: 0.75rem;
        border: 2px solid #e2e8f0;
        border-radius: 12px;
        font-size: 1rem;
        background: white;
        cursor: pointer;
        transition: all 0.3s ease;
        font-family: inherit;
    }

    .story-direction-selector:hover {
        border-color: #60a5fa;
    }

    .story-direction-selector:focus {
        outline: none;
        border-color: #60a5fa;
        box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
    }