.home-page {
    padding: 0;
    background-color: #f9f7f7;
    min-height: 100vh;
}

.categories-container {
    padding: 2rem 4%;
}

.category-section {
    margin-bottom: 2.5rem;
}

.category-title {
    font-family: 'Sigmar', cursive;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #84aeaf;
    padding-left: 0.5rem;
    line-height: 1.2;
}

.story-carousel {
    position: relative;
    padding: 0 0.5rem;
}

.carousel-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.carousel-button:hover {
    background-color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.carousel-button.left {
    left: -20px;
}

.carousel-button.right {
    right: -20px;
}

.carousel-button i {
    color: #4a5568;
    font-size: 1.25rem;
}

.carousel-container {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    padding: 0.5rem 0;
}

.carousel-container::-webkit-scrollbar {
    display: none;
}

.story-card {
    flex: 0 0 auto;
    width: 440px;
    height: 300px;
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 0.5rem;
    overflow: hidden;
}

.story-card:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    z-index: 2;
}

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

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

.story-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

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

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

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

.modal-title {
    font-family: 'Sigmar', cursive;
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #2d3748;
}

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

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

.read-button {
    background-color: #b8c6db;
    color: #4a5568;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    font-family: 'Nunito', sans-serif;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-grow: 1;
    font-weight: 600;
}

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

.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 styles */
.dark-mode .home-page {
    background-color: #1a1a1a;
}

.dark-mode .category-title {
    color: #b8c6db;
}

.dark-mode .carousel-button {
    background-color: rgba(45, 45, 45, 0.9);
}

.dark-mode .carousel-button i {
    color: #e0e0e0;
}

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

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

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

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

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

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

@media (max-width: 768px) {
    .story-card {
        width: 300px;
        height: 225px;
    }

    .carousel-button {
        width: 32px;
        height: 32px;
    }

    .carousel-button.left {
        left: -16px;
    }

    .carousel-button.right {
        right: -16px;
    }

    .story-modal {
        flex-direction: column;
        height: 90vh;
    }

    .story-modal-image {
        height: 40%;
    }

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

    .modal-description {
        font-size: 0.875rem;
        margin-bottom: 1rem;
    }
}

@media (max-width: 480px) {
    .story-card {
        width: 260px;
        height: 180px;
    }

    .category-title {
        font-size: 1.25rem;
    }

    .carousel-button {
        display: none;
    }
}
