.hero-section {
    height: 60vh;
    min-height: 400px;
    background-image: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), 
        url('https://app.trickle.so/storage/public/images/usr_0ab9ef3a38000001/af872c09-a8ca-4b57-b6ff-1dc1e8b09e18.png');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    margin-bottom: 2rem;
}

.hero-content {
    text-align: center;
    max-width: 800px;
}

.hero-title {
    font-family: 'Syne', sans-serif;
    font-size: 3rem;
    color: #B8BDE1;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    font-weight: 700;
}

.hero-description {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    font-family: 'Raleway', sans-serif;
}

.start-button {
    background-color: #B8BDE1;
    color: #404992;
    font-size: 1.25rem;
    padding: 0.75rem 2rem;
    border-radius: 2rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-family: 'Raleway', sans-serif;
}

.start-button:hover {
    background-color: #A3A8D6;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.section-title {
    font-family: 'Syne', sans-serif;
    font-size: 2rem;
    color: #404992;
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: 700;
}

.theme-selector {
    padding: 2rem 4%;
    /* margin-bottom: 2rem; */
    scroll-margin-top: 80px; /* Add scroll margin for anchor links */
}

.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.theme-card {
    background-color: #fff;
    border-radius: 1rem;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    border: 2px solid transparent;
    text-decoration: none; /* Remove underline from anchor */
    color: inherit; /* Keep text color consistent */
}

.theme-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.theme-card.active {
    border-color: #B8BDE1;
    background-color: rgba(184, 189, 225, 0.1);
}

.theme-icon {
    font-size: 2rem;
    color: #85C7D3;
    margin-bottom: 0.5rem;
}

.theme-name {
    font-weight: 600;
    color: #404992;
    font-family: 'Raleway', sans-serif;
}

.story-card {
    position: relative;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.story-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.story-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 1rem;
}

.story-card-info {
    padding: 1rem;
    background-color: white;
    text-align: center;
    position: relative;
    z-index: 2;
}

.story-card-title {
    font-size: 1.25rem;
    font-weight: 100;
    margin-bottom: 0.5rem;
    color: #fff;
    line-height: 21px;
    letter-spacing: 1px;
    font-family: 'Syne', sans-serif;
}

.story-card-description {
    font-size: 0.875rem;
    color: #718096;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'Raleway', sans-serif;
}

.story-card-age {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background-color: #e53e3e;
    color: white;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    z-index: 10;
    font-family: 'Raleway', sans-serif;
}

.story-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    text-align: center;
    backdrop-filter: blur(30px);
    background: rgba(24, 24, 24, 0.01);
}

.category-section {
    scroll-margin-top: 80px; /* Add scroll margin for anchor links */
    padding: 0 4%;
    margin-bottom: 2rem;
}

.category-title {
    font-family: 'Syne', sans-serif;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #85C7D3;
    padding-left: 0.5rem;
    line-height: 1.2;
    font-weight: 600;
}

.customization-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 60;
    padding: 1rem;
}

.customization-modal {
    background-color: white;
    border-radius: 1rem;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 2rem;
}

.customization-title {
    font-family: 'Syne', sans-serif;
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    color: #B8BDE1;
    text-align: center;
    font-weight: 700;
}

.customization-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: #404992;
    font-family: 'Raleway', sans-serif;
}

.form-input, .form-select {
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: 'Raleway', sans-serif;
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: #B8BDE1;
    box-shadow: 0 0 0 3px rgba(184, 189, 225, 0.2);
}

.theme-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.theme-pill {
    padding: 0.5rem 1rem;
    background-color: #f7fafc;
    border-radius: 2rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Raleway', sans-serif;
}

.theme-pill:hover {
    background-color: rgba(184, 189, 225, 0.2);
}

.theme-pill.active {
    background-color: #B8BDE1;
    color: #404992;
}

.elements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}

.element-pill {
    padding: 0.5rem 1rem;
    background-color: #f7fafc;
    border-radius: 2rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Raleway', sans-serif;
}

.element-pill:hover {
    background-color: rgba(184, 189, 225, 0.2);
}

.element-pill.active {
    background-color: #B8BDE1;
    color: #404992;
}

.form-section {
    border-top: 1px solid #e2e8f0;
    padding-top: 1.5rem;
}

.form-section-title {
    font-family: 'Syne', sans-serif;
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: #85C7D3;
    font-weight: 600;
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.half-width {
    width: 50%;
}

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

.cancel-button {
    padding: 0.75rem 1.5rem;
    background-color: #e2e8f0;
    color: #404992;
    border: none;
    border-radius: 10.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-family: 'Raleway', sans-serif;
}

.cancel-button:hover {
    background-color: #cbd5e0;
}

.start-story-button {
    padding: 0.75rem 1.5rem;
    background-color: #B8BDE1;
    color: #404992;
    border: none;
    border-radius: 2.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-family: 'Raleway', sans-serif;
}

.start-story-button:hover {
    background-color: #A3A8D6;
    transform: translateY(-1px);
}

.customize-button {
    padding: 0.75rem 1.5rem;
    background-color: #e2e8f0;
    color: #404992;
    border: none;
    border-radius: 70px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-family: 'Raleway', sans-serif;
}

.customize-button:hover {
    background-color: #cbd5e0;
}

.read-button {
    padding: 0.75rem 1.5rem;
    background-color: #B8BDE1;
    color: #404992;
    border: none;
    border-radius: 70px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-family: 'Raleway', sans-serif;
}

.read-button:hover {
    background-color: #A3A8D6;
    transform: translateY(-1px);
}

.story-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 60;
    padding: 1rem;
}

.story-modal {
    display: flex;
    background-color: #f9f7f7;
    border-radius: 1rem;
    overflow: hidden;
    max-width: 1000px;
    width: 100%;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.story-modal-image {
    flex: 0 0 50%;
    position: relative;
}

.modal-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.age-rating {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background-color: #e53e3e;
    color: white;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    z-index: 10;
    font-family: 'Raleway', sans-serif;
}

.story-modal-content {
    flex: 1;
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

.modal-title {
    font-family: 'Syne', sans-serif;
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #B8BDE1;
    line-height: 32px;
    font-weight: 700;
}

.modal-description {
    font-family: 'Raleway', sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: #4a5568;
    margin-bottom: 2rem;
    flex-grow: 1;
}

.modal-actions {
    display: flex;
    gap: 1rem;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: #4a5568;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: transform 0.3s ease;
}

.modal-close:hover {
    transform: scale(1.2);
}

/* Dark mode adjustments */
.dark-mode .section-title {
    color: #B8BDE1;
}

.dark-mode .theme-card {
    background-color: #2d3748;
}

.dark-mode .theme-name {
    color: #B8BDE1;
}

.dark-mode .story-card-info {
    background-color: #2d3748;
}

.dark-mode .story-card-title {
    color: #B8BDE1;
}

.dark-mode .story-card-description {
    color: #a0aec0;
}

.dark-mode .customization-modal {
    background-color: #2d3748;
}

.dark-mode .customization-title {
    color: #B8BDE1;
}

.dark-mode .form-group label {
    color: #B8BDE1;
}

.dark-mode .form-input, .dark-mode .form-select {
    background-color: #4a5568;
    border-color: #718096;
    color: #e0e0e0;
}

.dark-mode .theme-pill {
    background-color: #4a5568;
    color: #e0e0e0;
}

.dark-mode .theme-pill:hover {
    background-color: #2d3748;
}

.dark-mode .element-pill {
    background-color: #4a5568;
    color: #e0e0e0;
}

.dark-mode .element-pill:hover {
    background-color: #2d3748;
}

.dark-mode .form-section {
    border-top-color: #4a5568;
}

.dark-mode .form-section-title {
    color: #85C7D3;
}

.dark-mode .cancel-button {
    background-color: #4a5568;
    color: #e0e0e0;
}

.dark-mode .cancel-button:hover {
    background-color: #2d3748;
}

.dark-mode .story-modal {
    background-color: #2d3748;
}

.dark-mode .modal-title {
    color: #B8BDE1;
}

.dark-mode .modal-description {
    color: #a0aec0;
}

.dark-mode .modal-close {
    color: #e0e0e0;
}

.dark-mode .customize-button {
    background-color: #4a5568;
    color: #e0e0e0;
}

.dark-mode .customize-button:hover {
    background-color: #2d3748;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.25rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .start-button {
        font-size: 1rem;
        padding: 0.5rem 1.5rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .theme-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }

    .theme-card {
        padding: 1rem;
    }

    .theme-icon {
        font-size: 1.5rem;
    }

    .theme-name {
        font-size: 0.875rem;
    }

    .elements-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .form-row {
        flex-direction: column;
        gap: 0.5rem;
    }

    .half-width {
        width: 100%;
    }

    .customization-modal {
        padding: 1.5rem;
    }

    .customization-title {
        font-size: 1.5rem;
    }

    .story-modal {
        flex-direction: column;
    }

    .story-modal-image {
        flex: 0 0 200px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.75rem;
    }

    .hero-section {
        min-height: 300px;
    }

    .theme-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .elements-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .form-actions {
        flex-direction: column;
    }

    .cancel-button, .start-story-button {
        width: 100%;
    }

    .modal-actions {
        flex-direction: column;
    }

    .customize-button, .read-button {
        width: 100%;
    }

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

    .modal-title {
        font-size: 1.5rem;
    }
}
