/* Create Story Page Styles */
.create-story-container {
    padding: 8rem 2rem 4rem;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

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


.loading-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.8);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    border: 8px solid #eee;
    border-top: 8px solid #3f51b5;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}


.create-story-content {
    max-width: 800px;
    margin: 0 auto;
    background: var(--surface-color);
    padding: 2rem;
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.create-story-content h1 {
    color: var(--text-color);
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-align: center;
}

.subtitle {
    color: var(--text-color);
    font-size: 1.2rem;
    text-align: center;
    margin-bottom: 2rem;
}

/* Form Sections */
.form-section {
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    background: var(--highlight-color);
    border-radius: 20px;
}

.form-section h2 {
    color: var(--text-color);
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.section-description {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 1rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-weight: 600;
}

.form-group input {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid var(--accent-color);
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(205, 180, 219, 0.2);
}



/* Interests Grid */
.interests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.interest-item {
    background: var(--surface-color);
    padding: 1rem;
    border-radius: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.interest-item:hover {
    transform: translateY(-3px);
    border-color: var(--accent-color);
}

.interest-item.selected {
    background: var(--accent-color);
    color: var(--surface-color);
}

.interest-item i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    display: block;
}

/* Story Types Grid */
.story-types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.story-type-item {
    background: var(--surface-color);
    padding: 1.5rem;
    border-radius: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.story-type-item:hover {
    transform: translateY(-3px);
    border-color: var(--accent-color);
}

.story-type-item.selected {
    background: var(--accent-color);
    color: var(--surface-color);
}

.story-type-item i {
    font-size: 2rem;
    margin-bottom: 0.8rem;
    display: block;
}

/* Additional Characters */
.additional-character {
    background: var(--surface-color);
    padding: 1.5rem;
    border-radius: 15px;
    margin-bottom: 1rem;
    position: relative;
}

/* Position the remove button based on language direction */
html[dir="ltr"] .remove-character {
    position: absolute;
    top: 1rem;
    right: 1rem;
    left: auto;
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

html[dir="rtl"] .remove-character {
    position: absolute;
    top: 1rem;
    left: 1rem;
    right: auto;
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

.remove-character:hover {
    color: var(--accent-color);
}

/* Form Actions */
.form-actions {
    margin-top: 2rem;
    text-align: center;
}

.login-section {
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.login-message {
    color: #6c757d;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

#btn-login-create-story {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

#btn-login-create-story i {
    font-size: 1.1rem;
}

/* Show/hide sections based on auth state */
.logged-in-only {
    display: none;
}

.logged-out-only {
    display: block;
}

body.logged-in .logged-in-only {
    display: block;
}

body.logged-in .logged-out-only {
    display: none;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .create-story-container {
        padding: 6rem 1rem 2rem;
    }

    .create-story-content {
        padding: 1.5rem;
    }

    .create-story-content h1 {
        font-size: 2rem;
    }

    .form-section {
        padding: 1rem;
    }

    .interests-grid,
    .story-types-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Character Role Select Styles */
.character-role {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid var(--accent-color);
    border-radius: 10px;
    font-size: 1rem;
    background-color: var(--surface-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.character-role:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(205, 180, 219, 0.2);
}

/* Add Character Button */
#addCharacterBtn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background-color: var(--surface-color);
    border: 2px solid var(--accent-color);
    color: var(--text-color);
    padding: 0.8rem 1.2rem;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 1rem;
}

#addCharacterBtn:hover {
    background-color: var(--accent-color);
    color: var(--surface-color);
}

#addCharacterBtn i {
    font-size: 1rem;
}

/* Disabled Add Character Button */
#addCharacterBtn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #f0f0f0;
    border-color: #ddd;
    color: #888;
}

#addCharacterBtn.disabled:hover {
    background-color: #f0f0f0;
    color: #888;
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 12px 20px;
    border-radius: 8px;
    z-index: 10000;
    font-size: 1rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
    text-align: center;
}

.toast.show {
    opacity: 1;
}

.toast.error, .toast-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.toast.success, .toast-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.toast.warning, .toast-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

/* Mobile Responsiveness for Toast */
@media (max-width: 768px) {
    .toast {
        width: 90%;
        max-width: 300px;
    }
} 