/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    background-color: #fafafa; /* Light off-white background */
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* Header */
.header {
    position: relative;
    width: 100%;
    padding: 15px 20px 20px 20px;
    text-align: center;
    background: linear-gradient(135deg, #fef7e0 0%, #f5f0d8 100%);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        #2d5a27 20%, 
        #4a7c59 40%, 
        #2d5a27 60%, 
        #4a7c59 80%, 
        transparent 100%);
    box-shadow: 0 2px 8px rgba(45, 90, 39, 0.3);
}

.header::before {
    content: '';
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #2d5a27, transparent);
    opacity: 0.8;
}

/* Back arrow */
.back-arrow {
    position: absolute;
    top: 20px;
    left: 20px;
    cursor: pointer;
    padding: 10px;
    z-index: 10;
}

.back-arrow:hover {
    opacity: 0.7;
}

/* Stage 2: Story Introduction Styles */
.story-card {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 0;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.story-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.story-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px 12px 0 0;
}

.story-content {
    padding: 30px 25px;
    text-align: center;
}

.story-title {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1.6rem;
    font-weight: bold;
    color: #1a1a1a;
    margin: 0 0 20px 0;
    line-height: 1.3;
}

.story-description {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1.1rem;
    color: #444;
    margin: 0;
    line-height: 1.5;
}

/* Continue Button */
.continue-btn {
    width: 100%;
    max-width: 300px;
    background-color: #2d5a27;
    border: none;
    border-radius: 25px;
    padding: 20px 32px;
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    margin: auto auto 20px auto;
    box-shadow: 0 2px 8px rgba(45, 90, 39, 0.3);
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
}

.continue-btn:hover {
    background-color: #1e3d1a;
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 4px 12px rgba(45, 90, 39, 0.4);
}

.continue-btn:active {
    transform: translateX(-50%) translateY(0);
    box-shadow: 0 2px 6px rgba(45, 90, 39, 0.3);
}

/* Stage 4: Motivational Message Styles */
.motivation-image {
    width: 100%;
    height: 300px;
    overflow: hidden;
    margin-bottom: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.motivation-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.motivation-content {
    background-color: white;
    border-radius: 12px;
    padding: 30px 25px;
    text-align: center;
    margin-bottom: 40px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.motivation-title {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1.8rem;
    font-weight: bold;
    color: #1a1a1a;
    margin: 0 0 20px 0;
    line-height: 1.3;
}

.motivation-description {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1.1rem;
    color: #444;
    margin: 0;
    line-height: 1.5;
}

/* Stage 6: Writing Process Introduction Styles */
.book-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.book-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.writing-content {
    background-color: white;
    border-radius: 8px;
    padding: 20px 18px;
    text-align: center;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.writing-title {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1.4rem;
    font-weight: bold;
    color: #1a1a1a;
    margin: 0 0 15px 0;
    line-height: 1.3;
}

.writing-description {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 0.95rem;
    color: #444;
    margin: 0 0 18px 0;
    line-height: 1.4;
}

.questions-preview {
    background-color: #f0f8f0;
    border-left: 3px solid #2d5a27;
    border-radius: 6px;
    padding: 15px;
    text-align: left;
    margin-top: 15px;
}

.preview-title {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 0.9rem;
    font-weight: bold;
    color: #1a1a1a;
    margin: 0 0 8px 0;
}

.preview-question {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 0.85rem;
    color: #444;
    margin: 4px 0;
    line-height: 1.3;
}

/* Stage 9: Process Introduction Styles */
.laptop-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.laptop-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.process-content {
    background-color: white;
    border-radius: 8px;
    padding: 20px 18px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.process-title {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1.4rem;
    font-weight: bold;
    color: #1a1a1a;
    margin: 0 0 15px 0;
    line-height: 1.3;
}

.process-description {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 0.95rem;
    color: #444;
    margin: 0 0 18px 0;
    line-height: 1.4;
}

.services-box {
    background-color: #f0f8f0;
    border-left: 3px solid #2d5a27;
    border-radius: 6px;
    padding: 15px;
    text-align: left;
    margin-top: 15px;
}

.services-title {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 0.9rem;
    font-weight: bold;
    color: #1a1a1a;
    margin: 0 0 8px 0;
}

.services-list {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 0.85rem;
    color: #444;
    margin: 0;
    line-height: 1.3;
    font-style: italic;
}

/* Stage 10: Story Selection Styles */
.option-checkbox {
    display: flex;
    align-items: center;
    background-color: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px 18px;
    margin-bottom: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-height: 55px;
    box-sizing: border-box;
    width: 100%;
    max-width: none !important;
}

.option-checkbox:hover {
    border-color: #4a7c59;
    background-color: #f8f8f8;
}

.option-checkbox input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    border-radius: 4px;
    margin-right: 15px;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.option-checkbox input[type="checkbox"]:checked + .checkbox-custom {
    background-color: #2d5a27;
    border-color: #2d5a27;
}

.option-checkbox input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.option-text {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1rem;
    font-weight: bold;
    color: #1a1a1a;
    flex: 1;
    line-height: 1.4;
}

.all-option {
    background-color: white !important;
    border: 2px solid #e0e0e0 !important;
    border-radius: 8px !important;
    padding: 15px 18px !important;
    margin-bottom: 0 !important;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    width: 100% !important;
    max-width: none !important;
    font-family: 'Georgia', 'Times New Roman', serif !important;
    font-size: 1rem !important;
    font-weight: bold !important;
    color: #1a1a1a !important;
    min-height: 55px !important;
    box-sizing: border-box;
    transform: none !important;
    box-shadow: none !important;
}

.all-option:hover {
    border-color: #2d5a27 !important;
    background-color: #f8f8f8 !important;
    transform: none !important;
    box-shadow: none !important;
}

.all-option svg {
    flex-shrink: 0;
}

/* Title */
.title {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 2.8rem;
    font-weight: normal;
    font-style: italic;
    color: #2d5a27;
    margin: 0;
    padding: 0;
    text-align: center;
    line-height: 1.2;
}

.container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
    padding: 20px 20px 20px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

/* Stage management */
.stage {
    min-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-bottom: 100px; /* Add space for fixed button */
}

#stage2 {
    justify-content: space-between;
    padding-bottom: 40px;
}

#stage10 {
    padding-bottom: 150px; /* Extra space for stage 10 content */
}

/* Stage 13: Author and Cover Selection Styles */
.author-input-container {
    width: 100%;
    max-width: 400px;
    margin: 20px 0;
}

.author-input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1rem;
    color: #1a1a1a;
    background-color: white;
    box-sizing: border-box;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.author-input.error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.author-input:focus {
    outline: none;
    border-color: #2d5a27;
}

.author-input::placeholder {
    color: #999;
    font-style: italic;
}

.book-cover-container {
    width: 100%;
    max-width: 200px;
    margin: 20px 0;
    display: flex;
    justify-content: center;
}

.book-cover-image {
    width: 140px;
    height: 200px;
    object-fit: cover;
    object-position: center;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.book-cover-image:hover {
    transform: scale(1.02);
}

.cover-color-title {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1.2rem;
    font-weight: bold;
    color: #1a1a1a;
    text-align: center;
    margin: 20px 0 15px 0;
}

.color-options {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.color-option {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.color-option input[type="radio"] {
    display: none;
}

.color-swatch {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid transparent;
    transition: all 0.3s ease;
    position: relative;
}

.color-swatch.green {
    background-color: #2d5a27;
}

.color-swatch.beige {
    background-color: #bebebe;
}

.color-swatch.grey {
    background-color: #d4c4a8;
}

.color-swatch.blue {
    background-color: #006caa;
}

.color-swatch.pink {
    background-color: #b48b8b;
}

.color-swatch.black {
    background-color: #2c2c2c;
}

.color-option input[type="radio"]:checked + .color-swatch {
    border-color: #1a1a1a;
    transform: scale(1.1);
    box-shadow: 0 0 0 2px white, 0 0 0 4px #1a1a1a;
}

.color-option:hover .color-swatch {
    transform: scale(1.05);
}

.color-option input[type="radio"]:checked:hover + .color-swatch {
    transform: scale(1.1);
}

/* Stage 14 Styles */
.option-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    flex: 1;
}

.option-title {
    font-weight: bold;
    font-size: 1.1rem;
    color: #1a1a1a;
    margin-bottom: 5px;
}

.option-description {
    font-size: 0.95rem;
    color: #1a1a1a;
    line-height: 1.4;
}

/* Question */
.question {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1.8rem;
    font-weight: bold;
    color: #1a1a1a;
    margin-bottom: 20px;
    line-height: 1.4;
    text-align: center;
    width: 100%;
}

/* Question Subtitle */
.question-subtitle {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.1rem;
    color: #444;
    margin-bottom: 40px;
    line-height: 1.4;
    font-weight: bold;
    text-align: center;
    vertical-align: baseline;
}

/* Options container */
.options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    width: 100%;
    max-width: 400px;
}

/* Option buttons */
.option-btn {
    width: 100%;
    max-width: 400px;
    background-color: white;
    border: 2px solid #4a7c59;
    border-radius: 8px;
    padding: 20px 22px;
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1.1rem;
    font-weight: bold;
    color: #1a1a1a;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    transition: all 0.2s ease;
    position: relative;
}

/* Override for stage 10 option buttons */
#stage10 .option-btn {
    max-width: none !important;
}

.option-btn:hover {
    background-color: #f0f8f0;
    border-color: #2d5a27;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(45, 90, 39, 0.2);
}

.option-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.option-btn span {
    flex: 1;
    margin-right: 15px;
}

.option-btn svg {
    flex-shrink: 0;
    opacity: 0.8;
}

/* Responsive design */
@media (max-width: 600px) {
    .header {
        padding: 12px 15px 18px 15px;
    }
    
    .back-arrow {
        top: 12px;
        left: 12px;
    }
    
    .title {
        font-size: 2.2rem;
    }
    
    
    .question {
        font-size: 1.6rem;
    }
    
    .option-btn {
        padding: 18px 20px;
        font-size: 1.05rem;
    }
    
    .container {
        padding: 15px 10px;
    }
    
    .story-card {
        max-width: 350px;
    }
    
    .story-image {
        height: 200px;
    }
    
    .story-content {
        padding: 25px 20px;
    }
    
    .story-title {
        font-size: 1.2rem;
    }
    
    .story-description {
        font-size: 0.95rem;
    }
    
    .continue-btn {
        max-width: 280px;
        padding: 16px 25px;
        font-size: 1rem;
    }
    
    .motivation-image {
        height: 250px;
    }
    
    .motivation-content {
        padding: 25px 20px;
    }
    
    .motivation-title {
        font-size: 1.6rem;
    }
    
    .motivation-description {
        font-size: 1rem;
    }
    
    .book-image {
        height: 250px;
    }
    
    .writing-content {
        padding: 25px 20px;
    }
    
    .writing-title {
        font-size: 1.6rem;
    }
    
    .writing-description {
        font-size: 1rem;
    }
    
    .questions-preview {
        padding: 18px;
    }
}

@media (max-width: 400px) {
    .header {
        padding: 10px 10px 15px 10px;
    }
    
    .back-arrow {
        top: 10px;
        left: 10px;
    }
    
    .title {
        font-size: 2rem;
    }
    
    
    .question {
        font-size: 1.4rem;
    }
    
    .option-btn {
        padding: 16px 18px;
        font-size: 1rem;
    }
    
    .container {
        padding: 10px 5px;
    }
    
    .story-card {
        max-width: 320px;
    }
    
    .story-image {
        height: 180px;
    }
    
    .story-content {
        padding: 20px 15px;
    }
    
    .story-title {
        font-size: 1.1rem;
    }
    
    .story-description {
        font-size: 0.9rem;
    }
    
    .continue-btn {
        max-width: 260px;
        padding: 14px 20px;
        font-size: 0.95rem;
    }
    
    .motivation-image {
        height: 220px;
    }
    
    .motivation-content {
        padding: 20px 15px;
    }
    
    .motivation-title {
        font-size: 1.4rem;
    }
    
    .motivation-description {
        font-size: 0.95rem;
    }
    
    .book-image {
        height: 180px;
    }
    
    .writing-content {
        padding: 18px 15px;
    }
    
    .writing-title {
        font-size: 1.2rem;
    }
    
    .writing-description {
        font-size: 0.9rem;
    }
    
    .questions-preview {
        padding: 12px;
    }
    
    .preview-title {
        font-size: 0.85rem;
    }
    
    .preview-question {
        font-size: 0.8rem;
    }
    
    .laptop-image {
        height: 180px;
    }
    
    .process-content {
        padding: 18px 15px;
    }
    
    .process-title {
        font-size: 1.2rem;
    }
    
    .process-description {
        font-size: 0.9rem;
    }
    
    .services-box {
        padding: 12px;
    }
    
    .services-title {
        font-size: 0.85rem;
    }
    
    .services-list {
        font-size: 0.8rem;
    }
    
    .option-checkbox {
        padding: 12px 15px;
        min-height: 50px;
    }
    
    .option-text {
        font-size: 0.95rem;
    }
    
    .all-option {
        padding: 12px 15px !important;
        font-size: 0.95rem !important;
        min-height: 50px !important;
    }
    
    .checkbox-custom {
        width: 18px;
        height: 18px;
        margin-right: 12px;
    }
}
