/* file: /css/storybot-generate-story-style.css */
/* -------------------------------------------- */

/* Theme Variables */
:root {
    /* Dark Theme (Default) */
    --storybot-bg-primary: #1a1a1a;
    --storybot-bg-secondary: #2a2a2a;
    --storybot-bg-tertiary: #3a3a3a;
    --storybot-bg-form: #3a3a3a;
    --storybot-bg-input: #2a2925;
    --storybot-bg-overlay: rgba(255, 255, 255, 0.05);
    --storybot-bg-hover: rgba(255, 255, 255, 0.1);
    --storybot-bg-accent: rgba(92, 107, 192, 0.15);
    --storybot-bg-accent-hover: rgba(92, 107, 192, 0.2);
    --storybot-bg-accent-active: rgba(92, 107, 192, 0.4);
    
    --storybot-text-primary: #e0e0e0;
    --storybot-text-secondary: #b5afa9;
    --storybot-text-muted: #9d938e;
    --storybot-text-accent: #5c6bc0;
    --storybot-text-light: #f1f1f1;
    --storybot-text-icons: #95a0e1;
    
    --storybot-border-primary: #4b4a46;
    --storybot-border-secondary: #6b6960;
    --storybot-border-accent: #5c6bc0;
    --storybot-border-overlay: rgba(255, 255, 255, 0.1);
    --storybot-border-hover: rgba(255, 255, 255, 0.2);
    
    --storybot-accent-primary: #5c6bc0;
    --storybot-accent-hover: #4a59b2;
    --storybot-accent-active: #3f4ea0;
    --storybot-accent-secondary: #007cba;
    --storybot-accent-secondary-hover: #006ba1;
    
    --storybot-shadow-light: rgba(0, 0, 0, 0.2);
    --storybot-shadow-medium: rgba(0, 0, 0, 0.3);
    --storybot-shadow-heavy: rgba(0, 0, 0, 0.8);
}

/* Light Theme */
.storybot-theme-light {
    --storybot-bg-primary: #ffffff;
    --storybot-bg-secondary: #f8f9fa;
    --storybot-bg-tertiary: #e9ecef;
    --storybot-bg-form: #ffffff;
    --storybot-bg-input: #f8f9fa;
    --storybot-bg-overlay: rgba(0, 0, 0, 0.05);
    --storybot-bg-hover: rgba(0, 0, 0, 0.08);
    --storybot-bg-accent: rgba(92, 107, 192, 0.08);
    --storybot-bg-accent-hover: rgba(92, 107, 192, 0.12);
    --storybot-bg-accent-active: rgba(92, 107, 192, 0.2);
    
    --storybot-text-primary: #212529;
    --storybot-text-secondary: #495057;
    --storybot-text-muted: #6c757d;
    --storybot-text-accent: #4a59b2;
    --storybot-text-light: #333333;
    --storybot-text-icons: #4a59b2;
    
    --storybot-border-primary: #dee2e6;
    --storybot-border-secondary: #ced4da;
    --storybot-border-accent: #5c6bc0;
    --storybot-border-overlay: rgba(0, 0, 0, 0.1);
    --storybot-border-hover: rgba(0, 0, 0, 0.15);
    
    --storybot-accent-primary: #5c6bc0;
    --storybot-accent-hover: #4a59b2;
    --storybot-accent-active: #3f4ea0;
    --storybot-accent-secondary: #007cba;
    --storybot-accent-secondary-hover: #006ba1;
    
    --storybot-shadow-light: rgba(0, 0, 0, 0.1);
    --storybot-shadow-medium: rgba(0, 0, 0, 0.15);
    --storybot-shadow-heavy: rgba(0, 0, 0, 0.6);
}

/* Form Container & General Layout */
.storybot-form-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.storybot-form-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
}

.story-form-content-group {
    grid-column: span 12;
    margin-bottom: 15px;
}

.full-width {
    grid-column: span 12;
}

.half-width {
    grid-column: span 6;
}

.third-width {
    grid-column: span 4;
}

/* Form Styling */
#storybot-form {
    font-size: 0.9em;
    background-color: var(--storybot-bg-form);
    color: var(--storybot-text-muted);
    border-radius: 10px;
    box-shadow: 0px 0px 20px var(--storybot-shadow-light);
    padding: 30px;
    box-sizing: border-box;
    overflow: auto;
    transition: background-color 0.3s ease, color 0.3s ease;
}

#storybot-form input[type=text],
#storybot-form textarea,
#storybot-form select {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid var(--storybot-border-primary);
    border-radius: 6px;
    font-size: 16px;
    background-color: var(--storybot-bg-input);
    color: var(--storybot-text-primary);
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    transition: border-color 0.3s, box-shadow 0.3s, background-color 0.3s ease;
}

#storybot-form input[type=text]:focus,
#storybot-form textarea:focus,
#storybot-form select:focus {
    border-color: var(--storybot-accent-primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(92, 107, 192, 0.2);
}

#storybot-form textarea {
    resize: vertical;
    line-height: 1.4;
    min-height: 100px;
}

#storybot-form select {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239d938e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    cursor: pointer;
    padding-right: 35px;
}

/* Light theme select arrow */
.storybot-theme-light #storybot-form select {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23495057' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

#storybot-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--storybot-text-secondary);
    transition: color 0.3s ease;
}

/* Submit Button */
.submit-container {
    margin-top: 10px;
    text-align: center;
}

#generate-story-submit {
    background-color: var(--storybot-accent-primary);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
    box-shadow: 0 2px 4px var(--storybot-shadow-light);
    width: auto;
    min-width: 250px;
}

#generate-story-submit:hover {
    background-color: var(--storybot-accent-hover);
}

#generate-story-submit:active {
    background-color: var(--storybot-accent-active);
    transform: translateY(1px);
}

#generate-story-submit i {
    margin-left: 8px;
}

/* GENDER Slider Styles */
.gender-selection-container {
    width: 100%;
    margin-bottom: 15px;
}

.gender-selection-slider {
    width: 90%;
    margin: 0 auto;
}

.gender-selection-slider input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
    margin: 15px 0;
}

/* For Webkit browsers like Chrome, Safari */
.gender-selection-slider input[type=range]::-webkit-slider-runnable-track {
    background: var(--storybot-border-primary);
    border-radius: 5px;
    height: 8px;
    transition: background 0.3s ease;
}

/* For Firefox */
.gender-selection-slider input[type=range]::-moz-range-track {
    background: var(--storybot-border-primary);
    border-radius: 5px;
    height: 8px;
}

/* For IE */
.gender-selection-slider input[type=range]::-ms-track {
    background: var(--storybot-border-primary);
    border-radius: 5px;
    height: 8px;
    border-color: transparent;
    color: transparent;
}

/* Slider thumb - enhancing the appearance */
.gender-selection-slider input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    border: none;
    height: 24px;
    width: 24px;
    border-radius: 50%;
    background: var(--storybot-accent-primary);
    margin-top: -8px;
    cursor: pointer;
    box-shadow: 0 1px 3px var(--storybot-shadow-medium);
    transition: background 0.3s ease;
}

.gender-selection-slider input[type=range]::-moz-range-thumb {
    border: none;
    height: 24px;
    width: 24px;
    border-radius: 50%;
    background: var(--storybot-accent-primary);
    cursor: pointer;
    box-shadow: 0 1px 3px var(--storybot-shadow-medium);
}

.gender-selection-slider input[type=range]::-ms-thumb {
    border: none;
    height: 24px;
    width: 24px;
    border-radius: 50%;
    background: var(--storybot-accent-primary);
    cursor: pointer;
    box-shadow: 0 1px 3px var(--storybot-shadow-medium);
}

/* Labels container */
.gender-icons {
    display: flex;
    justify-content: space-between;
    text-align: center;
    margin-top: 8px;
}

/* Individual labels */
.gender-icons span {
    flex: 1;
    width: 100%;
    text-align: center;
    font-size: 14px;
    color: var(--storybot-text-secondary);
    transition: color 0.3s ease;
}

/* Aligning the labels directly under the slider's endpoints */
.gender-icons span:first-child {
    text-align: left;
}

.gender-icons span:last-child {
    text-align: right;
}

/* Morale Styles */
.moral-proposals-container {
    margin-top: 10px;
    z-index: 1000;
}

#moral-tags-container {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

#moral-type-title {
    font-weight: bold;
    cursor: pointer;
    color: var(--storybot-text-primary);
    transition: color 0.3s ease;
}

.moral-type-tag, .moral-tag {
    display: inline-block;
    background-color: var(--storybot-bg-accent-active);
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    color: var(--storybot-text-primary);
    transition: background-color 0.2s, color 0.3s ease;
}

.moral-type-tag:hover, .moral-tag:hover {
    background-color: var(--storybot-accent-primary);
    color: white;
}

#next-moral-type {
    margin-top: 10px;
    background-color: var(--storybot-accent-secondary);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#next-moral-type:hover {
    background-color: var(--storybot-accent-secondary-hover);
}

/* Tool Tip Section */
.story-efficiency-tools {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
}

.efficiency-tool {
    display: flex;
    align-items: center;
    font-size: 14px;
    line-height: 1.4;
    color: var(--storybot-text-light);
    gap: 10px;
    flex: 1;
    min-width: 250px;
    padding: 12px;
    border-radius: 6px;
    background-color: var(--storybot-bg-overlay);
    transition: background-color 0.2s, color 0.3s ease;
}

.drawing-input {
    border: 1px dashed var(--storybot-border-secondary);
    transition: border-color 0.3s ease;
}

.drawing-input:hover {
    border-color: var(--storybot-accent-primary);
    background-color: var(--storybot-bg-accent-hover);
    cursor: pointer;
}

.voice-input:hover {
    background-color: var(--storybot-bg-hover);
    cursor: pointer;
}

.tool-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--storybot-text-icons);
    font-size: 20px;
    background-color: var(--storybot-bg-accent);
    border-radius: 50%;
    flex-shrink: 0;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.tool-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
}

.tool-title {
    font-weight: 500;
    color: var(--storybot-text-light);
    margin-bottom: 4px;
    display: block;
    transition: color 0.3s ease;
}

.tool-tip {
    font-size: 12px;
    color: var(--storybot-text-muted);
    line-height: 1.4;
    display: block;
    transition: color 0.3s ease;
}

/* Input File (Hidden) */
input[type="file"] {
    display: none;
}

/* AGE Slider Styles */
.age-selection-container {
    width: 100%;
    margin-bottom: 15px;
}

/* Age display - moved above slider */
.age-display {
    text-align: center;
    margin-bottom: 15px;
    padding: 10px;
    background-color: var(--storybot-bg-accent);
    border-radius: 6px;
    border: 2px solid var(--storybot-accent-primary);
    box-shadow: 0 0 0 2px rgba(92, 107, 192, 0.2);
    transition: all 0.3s ease;
}

.age-display:hover {
    box-shadow: 0 0 0 3px rgba(92, 107, 192, 0.3);
}

#age-display-value {
    font-size: 24px;
    font-weight: bold;
    color: var(--storybot-accent-primary);
    text-shadow: 0 1px 2px var(--storybot-shadow-light);
    transition: color 0.3s ease;
}

.age-selection-slider {
    width: 90%;
    margin: 0 auto;
    position: relative;
    padding: 15px 0;
}

.age-selection-slider input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
    margin: 15px 0;
    position: relative;
    z-index: 2;
}

/* Track styling for age slider - consistent with gender slider */
.age-selection-slider input[type=range]::-webkit-slider-runnable-track {
    background: var(--storybot-border-primary);
    border-radius: 5px;
    height: 8px;
    transition: background 0.3s ease;
}

.age-selection-slider input[type=range]::-moz-range-track {
    background: var(--storybot-border-primary);
    border-radius: 5px;
    height: 8px;
}

.age-selection-slider input[type=range]::-ms-track {
    background: var(--storybot-border-primary);
    border-radius: 5px;
    height: 8px;
    border-color: transparent;
    color: transparent;
}

/* Slider thumb - consistent with gender slider */
.age-selection-slider input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    border: none;
    height: 24px;
    width: 24px;
    border-radius: 50%;
    background: var(--storybot-accent-primary);
    margin-top: -8px;
    cursor: pointer;
    box-shadow: 0 1px 3px var(--storybot-shadow-medium);
    transition: background 0.3s ease;
}

.age-selection-slider input[type=range]::-moz-range-thumb {
    border: none;
    height: 24px;
    width: 24px;
    border-radius: 50%;
    background: var(--storybot-accent-primary);
    cursor: pointer;
    box-shadow: 0 1px 3px var(--storybot-shadow-medium);
}

.age-selection-slider input[type=range]::-ms-thumb {
    border: none;
    height: 24px;
    width: 24px;
    border-radius: 50%;
    background: var(--storybot-accent-primary);
    cursor: pointer;
    box-shadow: 0 1px 3px var(--storybot-shadow-medium);
}

/* Age tick marks */
.age-tick-marks {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    padding: 0 12px; /* Align with slider thumb */
    position: relative;
}

.tick {
    font-size: 10px;
    color: var(--storybot-text-secondary);
    text-align: center;
    position: relative;
    width: 12px;
    transition: color 0.3s ease;
}

.tick::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 6px;
    background-color: var(--storybot-border-secondary);
    transition: background-color 0.3s ease;
}

/* Age group markers */
.age-markers {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    padding: 0 12px;
    position: relative;
}

.age-group-marker {
    font-size: 11px;
    color: var(--storybot-text-secondary);
    background-color: var(--storybot-bg-hover);
    padding: 3px 8px;
    border-radius: 12px;
    position: absolute;
    white-space: nowrap;
    border: 1px solid var(--storybot-border-hover);
    transition: all 0.3s ease;
}

.age-group-marker.age-4-6 {
    left: 0%;
}

.age-group-marker.age-7-9 {
    left: 50%;
    transform: translateX(-50%);
}

.age-group-marker.age-10-12 {
    right: 0%;
}

.age-group-marker.active {
    font-weight: bold;
    transform: scale(1.05);
    box-shadow: 0 2px 4px var(--storybot-shadow-medium);
    z-index: 10;
    background-color: var(--storybot-bg-accent-active);
    color: var(--storybot-text-primary);
    border-color: var(--storybot-accent-primary);
}

.age-group-marker.active.age-7-9 {
    transform: translateX(-50%) scale(1.05);
}

/* GENRE Icon Grid Styles */
.genre-selection-container {
    width: 100%;
    margin-bottom: 15px;
}

/* Genre display - similar to age display */
.genre-display {
    text-align: center;
    margin-bottom: 15px;
    padding: 10px;
    background-color: var(--storybot-bg-accent);
    border-radius: 6px;
    border: 2px solid var(--storybot-accent-primary);
    box-shadow: 0 0 0 2px rgba(92, 107, 192, 0.2);
    transition: all 0.3s ease;
}

.genre-display:hover {
    box-shadow: 0 0 0 3px rgba(92, 107, 192, 0.3);
}

#genre-display-value {
    font-size: 18px;
    font-weight: bold;
    color: var(--storybot-accent-primary);
    text-shadow: 0 1px 2px var(--storybot-shadow-light);
    transition: color 0.3s ease;
}

/* Genre icon grid */
.genre-selection-grid {
    width: 100%;
}

.genre-icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(65px, 1fr));
    gap: 8px;
    padding: 10px;
    background-color: var(--storybot-bg-overlay);
    border-radius: 6px;
    border: 1px solid var(--storybot-border-overlay);
    max-height: 265px;
    overflow-y: auto;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.genre-icon-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    background-color: var(--storybot-bg-overlay);
    transition: all 0.3s ease;
    min-width: 75px;
    min-height: 75px;
    box-sizing: border-box;
}

.genre-icon-option:hover {
    background-color: var(--storybot-bg-accent-hover);
    border-color: var(--storybot-bg-accent-active);
    transform: translateY(-2px);
}

.genre-icon-option.active {
    background-color: var(--storybot-bg-accent-active);
    border-color: var(--storybot-accent-primary);
    box-shadow: 0 0 0 2px rgba(92, 107, 192, 0.3);
    transform: translateY(-2px);
}

.genre-icon-option i {
    font-size: 24px;
    color: var(--storybot-text-primary);
    margin-bottom: 6px;
    transition: color 0.3s ease;
    line-height: 1;
    height: 24px;
}

.genre-icon-option:hover i,
.genre-icon-option.active i {
    color: var(--storybot-text-primary);
}

.genre-icon-option span {
    font-size: 10px;
    color: var(--storybot-text-secondary);
    text-align: center;
    line-height: 1.2;
    font-weight: 500;
    transition: color 0.3s ease;
}

.genre-icon-option:hover span,
.genre-icon-option.active span {
    color: var(--storybot-text-primary);
    font-weight: 600;
}

/* Visual distinction for main vs sub categories */
.genre-icon-option.main-category {
    font-weight: 600;
}

.genre-icon-option.sub-category {
    opacity: 0.9;
}

.genre-icon-option.sub-category i {
    font-size: 22px;
}

/* Default icon styling for genres without custom icons */
.genre-icon-option.default-icon {
    opacity: 0.7;
}

.genre-icon-option.default-icon i {
    color: var(--storybot-text-muted) !important;
}

.genre-icon-option.default-icon:hover i {
    color: var(--storybot-text-secondary) !important;
}

/* More genres button styling */
.genre-icon-option.more-genres {
    border: 2px dashed var(--storybot-bg-accent-active);
    background-color: var(--storybot-bg-accent);
    cursor: pointer;
}

.genre-icon-option.more-genres:hover {
    border-color: var(--storybot-accent-primary);
    background-color: var(--storybot-bg-accent-hover);
}

.genre-icon-option.more-genres i {
    color: var(--storybot-accent-primary) !important;
}

.genre-icon-option.more-genres span {
    color: var(--storybot-accent-primary) !important;
    font-weight: 600;
}

/* Timeout message styling */
.timeout-message {
    text-align: center;
    padding: 30px;
}

.timeout-message h3 {
    color: var(--storybot-accent-primary);
    margin-bottom: 15px;
    font-size: 20px;
}

.timeout-message p {
    color: var(--storybot-text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}

.timeout-message .button-container {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.timeout-message button {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
}

.timeout-message #check-story-status {
    background-color: var(--storybot-accent-primary);
    color: white;
}

.timeout-message #check-story-status:hover {
    background-color: var(--storybot-accent-hover);
}

.timeout-message #try-again {
    background-color: var(--storybot-bg-secondary);
    color: var(--storybot-text-primary);
    border: 2px solid var(--storybot-border-primary);
}

.timeout-message #try-again:hover {
    background-color: var(--storybot-bg-hover);
    border-color: var(--storybot-accent-primary);
}

/* Hidden genres container */
.hidden-genres {
    display: contents;
}

.hidden-genres .genre-icon-option {
    display: flex;
}

/* LANGUAGE Flag Grid Styles */
.language-selection-container {
    width: 100%;
    margin-bottom: 15px;
}

/* Language display - similar to genre display */
.language-display {
    text-align: center;
    margin-bottom: 15px;
    padding: 10px;
    background-color: var(--storybot-bg-accent);
    border-radius: 6px;
    border: 2px solid var(--storybot-accent-primary);
    box-shadow: 0 0 0 2px rgba(92, 107, 192, 0.2);
    transition: all 0.3s ease;
}

.language-display:hover {
    box-shadow: 0 0 0 3px rgba(92, 107, 192, 0.3);
}

#language-display-value {
    font-size: 18px;
    font-weight: bold;
    color: var(--storybot-accent-primary);
    text-shadow: 0 1px 2px var(--storybot-shadow-light);
    transition: color 0.3s ease;
}

/* Language icon grid */
.language-selection-grid {
    width: 100%;
}

.language-icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(65px, 1fr));
    gap: 8px;
    padding: 10px;
    background-color: var(--storybot-bg-overlay);
    border-radius: 6px;
    border: 1px solid var(--storybot-border-overlay);
    max-height: 265px;
    overflow-y: auto;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.language-icon-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    background-color: var(--storybot-bg-overlay);
    transition: all 0.3s ease;
    min-width: 75px;
    min-height: 75px;
    box-sizing: border-box;
}

.language-icon-option:hover {
    background-color: var(--storybot-bg-accent-hover);
    border-color: var(--storybot-bg-accent-active);
    transform: translateY(-2px);
}

.language-icon-option.active {
    background-color: var(--storybot-bg-accent-active);
    border-color: var(--storybot-accent-primary);
    box-shadow: 0 0 0 2px rgba(92, 107, 192, 0.3);
    transform: translateY(-2px);
}

.language-icon-option .flag-emoji {
    font-size: 24px;
    color: var(--storybot-text-primary);
    margin-bottom: 6px;
    transition: color 0.3s ease;
    display: block;
    text-align: center;
    line-height: 1;
    height: 24px;
}

.language-icon-option:hover .flag-emoji,
.language-icon-option.active .flag-emoji {
    color: var(--storybot-text-primary);
}

.language-icon-option span:not(.flag-emoji) {
    font-size: 10px;
    color: var(--storybot-text-secondary);
    text-align: center;
    line-height: 1.2;
    font-weight: 500;
    transition: color 0.3s ease;
}

.language-icon-option:hover span:not(.flag-emoji),
.language-icon-option.active span:not(.flag-emoji) {
    color: var(--storybot-text-primary);
    font-weight: 600;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .storybot-form-container {
        padding: 10px;
    }
    
    #storybot-form {
        padding: 15px;
        border-radius: 8px;
    }
    
    .storybot-form-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .half-width, .third-width {
        grid-column: span 12;
    }
    
    .story-efficiency-tools {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 5px;
    }
    
    .efficiency-tool {
        padding: 8px;
        min-width: 0;
        flex: 1 1 100%;
    }
    
    .tool-icon {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .tool-title {
        font-size: 13px;
    }
    
    .tool-tip {
        font-size: 11px;
        line-height: 1.3;
    }
    
    #generate-story-submit {
        width: 100%;
        padding: 12px;
    }
    
    /* Age slider mobile adjustments */
    .age-selection-slider {
        width: 95%;
    }
    
    .age-group-marker {
        font-size: 9px;
        padding: 2px 4px;
    }
    
    .tick {
        font-size: 8px;
        width: 10px;
    }
    
    .tick::before {
        height: 4px;
        top: -12px;
    }
    
    #age-display-value {
        font-size: 20px;
    }
    
    .age-display {
        padding: 8px;
        margin-bottom: 10px;
    }
    
    /* Genre grid mobile adjustments */
    .genre-icon-grid {
        grid-template-columns: repeat(auto-fit, minmax(55px, 1fr));
        gap: 6px;
        padding: 8px;
        max-height: 180px;
    }
    
    .genre-icon-option {
        padding: 8px;
        min-width: 55px;
        min-height: 55px;
    }
    
    .genre-icon-option i {
        font-size: 18px;
        margin-bottom: 4px;
        line-height: 1;
        height: 18px;
    }
    
    .genre-icon-option span {
        font-size: 9px;
        line-height: 1.1;
    }
    
    #genre-display-value {
        font-size: 16px;
    }
    
    .genre-display {
        padding: 8px;
        margin-bottom: 10px;
    }

    /* Language grid mobile adjustments */
    .language-icon-grid {
        grid-template-columns: repeat(auto-fit, minmax(55px, 1fr));
        gap: 6px;
        padding: 8px;
        max-height: 150px;
    }
    
    .language-icon-option {
        padding: 8px;
        min-width: 55px;
        min-height: 55px;
    }
    
    .language-icon-option .flag-emoji {
        font-size: 18px;
        margin-bottom: 4px;
        line-height: 1;
        height: 18px;
    }
    
    .language-icon-option span:not(.flag-emoji) {
        font-size: 9px;
        line-height: 1.1;
    }
    
    #language-display-value {
        font-size: 16px;
    }
    
    .language-display {
        padding: 8px;
        margin-bottom: 10px;
    }
}
