.story-step-container {
    min-height: calc(100vh - 200px);
    padding: 2rem;
    background-color: var(--secondary-color);
    margin-top: 80px;
}

.story-content {
    max-width: 800px;
    margin: 0 auto;
    background-color: var(--surface-color);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
}

.story-header {
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.story-title {
    font-size: 2rem;
    color: var(--text-color);
    margin: 1rem 0;
}

/* Default center alignment for titles in all languages */
html .story-title {
    text-align: center;
}

.progress-container {
    margin-bottom: 1.5rem;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.progress-steps:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #e0e0e0;
    transform: translateY(-50%);
    z-index: -1;
}

.progress-step {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #e0e0e0;
    color: var(--text-color);
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: default;
    z-index: 2;
}

.progress-step.active {
    background: linear-gradient(135deg, #9c27b0 0%, #7c3aed 100%);
    color: var(--surface-color);
    animation: progress-pulse 2s ease-in-out infinite;
}

.progress-step.completed {
    background: linear-gradient(135deg, #9c27b0 0%, #7c3aed 100%);
    color: var(--surface-color);
    animation: progress-pulse 2s ease-in-out infinite;
}

.step-display {
    text-align: center;
    font-size: 1rem;
    color: var(--text-color);
    font-weight: 600;
    margin-top: 0.5rem;
}

.story-image {
    width: 100%;
    max-width: 768px;
    height: auto;
    margin: 0 auto 2rem;
    border-radius: 15px;
    overflow: hidden;
}

.story-image img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 768/448;
}

.story-text {
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--text-color);
    margin-bottom: 2rem;
}

/* RTL text alignment for Hebrew */
html[lang="he"] .story-text {
    text-align: right;
}

/* LTR text alignment for English */
html:not([lang="he"]) .story-text {
    text-align: left;
}

.story-text p {
    margin: 0;
}

.story-choices {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.choice-btn {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    align-items: center;
    gap: 0.5rem;
}

/* RTL styling for Hebrew */
html[lang="he"] .choice-btn {
    text-align: right;
    direction: rtl;
}

/* LTR styling for English */
html:not([lang="he"]) .choice-btn {
    text-align: left;
    direction: ltr;
}

.choice-btn i {
    font-size: 1.2rem;
    margin-left: 0.5rem;
    margin-right: 0;
}

/* Icon positioning for RTL */
html[lang="he"] .choice-btn i {
    order: 1;
    margin-left: 0.5rem;
    margin-right: 0;
}

/* Icon positioning for LTR */
html:not([lang="he"]) .choice-btn i {
    order: 0;
    margin-left: 0;
    margin-right: 0.5rem;
}

.choice-btn span {
    order: 2;
}

/* Text order for RTL */
html[lang="he"] .choice-btn span {
    order: 2;
    text-align: right;
}

/* Text order for LTR */
html:not([lang="he"]) .choice-btn span {
    order: 1;
    text-align: left;
}

.choice-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.choice-btn.btn-primary {
    background: linear-gradient(135deg, #9c27b0 0%, #7c3aed 100%);
    color: var(--surface-color);
}

.choice-btn.btn-secondary {
    background-color: var(--highlight-color);
    color: var(--text-color);
}

.choice-btn.selected {
    background: linear-gradient(135deg, #9c27b0 0%, #7c3aed 100%);
    color: var(--surface-color);
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 2px solid #9c27b0;
}

.choice-btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: var(--highlight-color);
    color: var(--text-color);
    transform: none;
    box-shadow: none;
}

.choice-btn.disabled:hover {
    transform: none;
    box-shadow: none;
}

.end-story {
    margin-top: 1rem;
    border: 2px dashed var(--accent-color);
    background-color: transparent;
}

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

    .story-content {
        padding: 1.5rem;
    }

    .story-image {
        max-width: 100%;
    }

    .story-text {
        font-size: 1.1rem;
    }

    .choice-btn {
        font-size: 1rem;
        padding: 0.8rem;
    }
}

.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;
}

.loading-overlay p {
    color: var(--text-color);
    font-size: 1.2rem;
    margin: 0;
}

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

/* First step nudge animations and styling */
@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.7);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(255, 193, 7, 0.2);
        transform: scale(1.02);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0);
        transform: scale(1);
    }
}

@keyframes gentle-bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-3px);
    }
    60% {
        transform: translateY(-1px);
    }
}

@keyframes progress-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.6);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(255, 193, 7, 0.2);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0);
    }
}

.first-step-nudge {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 2px solid #ffc107;
    border-radius: 10px;
    padding: 1rem;
    margin-top: 1.5rem;
    text-align: center;
    font-size: 1.1rem;
    color: #856404;
    font-weight: 600;
    animation: gentle-bounce 2s ease-in-out infinite;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
}

/* RTL styling for Hebrew */
html[lang="he"] .first-step-nudge {
    direction: rtl;
    text-align: center;
}

.first-step-nudge::before {
    content: "✨";
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

html[lang="he"] .first-step-nudge::before {
    margin-right: 0;
    margin-left: 0.5rem;
}

.first-step-nudge::after {
    content: "👆";
    font-size: 1.2rem;
    margin-left: 0.5rem;
}

html[lang="he"] .first-step-nudge::after {
    margin-left: 0;
    margin-right: 0.5rem;
}

.nudge-choice {
    animation: pulse-glow 2s ease-in-out infinite;
    border: 2px solid #ffc107;
    position: relative;
    overflow: hidden;
}

.nudge-choice::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.nudge-choice:hover::before {
    left: 100%;
}

/* Disable nudge effects for selected and disabled buttons */
.nudge-choice.selected,
.nudge-choice.disabled {
    animation: none;
    border: 2px solid var(--accent-color);
}

.nudge-choice.selected::before,
.nudge-choice.disabled::before {
    display: none;
}

/* Ensure end story button doesn't get nudge effects */
.choice-btn.btn-end-story {
    animation: none;
    border: 2px dashed var(--accent-color);
}

.choice-btn.btn-end-story::before {
    display: none;
}

/* Ensure completion buttons don't get nudge effects */
.choice-btn.read-whole-story,
.choice-btn.create-another-story {
    animation: none;
}

.choice-btn.read-whole-story::before,
.choice-btn.create-another-story::before {
    display: none;
}

.first-step-tooltip {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    white-space: nowrap;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.first-step-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
}

.nudge-choice:hover .first-step-tooltip {
    opacity: 1;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .first-step-nudge {
        font-size: 1rem;
        padding: 0.8rem;
        margin-top: 1rem;
    }
    
    .first-step-tooltip {
        font-size: 0.8rem;
        padding: 6px 10px;
    }
}

.navigation-arrows {
    position: relative;
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 1rem 0;
    padding: 0 1rem;
    z-index: 10;
}

.nav-arrow {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--surface-color);
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nav-arrow:hover {
    background-color: var(--accent-color);
    color: var(--surface-color);
    transform: scale(1.1);
}

.nav-arrow:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Remove the mobile hiding rule */
@media (max-width: 768px) {
    .navigation-arrows {
        gap: 1rem;
    }

    .nav-arrow {
        width: 36px;
        height: 36px;
    }
}

.choice-btn.read-whole-story {
    background-color: var(--secondary-color);
    color: var(--surface-color);
    font-size: 1.2rem;
    padding: 1.2rem;
    margin-top: 1rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 2px solid var(--secondary-color);
}

.choice-btn.read-whole-story:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.choice-btn.read-whole-story i {
    margin-right: 10px;
    margin-left: 0;
    font-size: 1.3rem;
}

/* 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 {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

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

.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;
    }
}

.max-steps-message {
    background-color: #fff3cd;
    color: #856404;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    text-align: center;
    font-weight: bold;
    border: 1px solid #ffeeba;
}

.choice-btn.create-another-story {
    background-color: var(--accent-color);
    color: var(--surface-color);
    font-size: 1.2rem;
    padding: 1.2rem;
    margin-top: 1rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 2px solid var(--accent-color);
    text-decoration: none;
}

.choice-btn.create-another-story:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.choice-btn.create-another-story i {
    margin-right: 10px;
    margin-left: 0;
    font-size: 1.3rem;
}

/* When choice buttons are in a centered flex container */
.story-choices[style*="flex"] .choice-btn {
    width: 80%;
    max-width: 350px;
} 