/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #ffbe00;
    --secondary-color: #F5A623;
    --accent-color: #7ED321;
    --text-color: 37312c;
    --light-bg: #F8F9FA;
    --white: #FFFFFF;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 5px 20px rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-bg);
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
}

/* Restore padding for containers outside main-wrapper (like header, footer) */
.header .container,
.footer .container {
    padding: 0 20px;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #cf4949 100%);
    color: var(--white);
    padding: 1rem 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header .container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: center;
}

.logo img {
    width: 100px;
    height: 50px;
    border-radius: 0%;
    object-fit: cover;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: bold;
}

.nav {
    display: flex;
    align-items: center;
    gap: 20px;
    position: absolute;
    right: 20px;
}

.nav-link {
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.nav-link:hover,
.nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
}

.social-links {
    display: flex;
    gap: 15px;
    align-items: center;
}

.social-icon {
    color: var(--white);
    width: 24px;
    height: 24px;
    transition: transform 0.3s;
}

.social-icon:hover {
    transform: scale(1.2);
}

/* Hero Section */
.hero {
    position: relative;
    height: 400px;
    overflow: hidden;
    margin-bottom: 40px;
}

.hero-image {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.7);
}

.hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: var(--white);
    text-align: center;
    padding: 20px;
}

.hero-content h2 {
    font-size: 3rem;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-content p {
    font-size: 1.3rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Main Wrapper for Two-Column Layout */
.main-wrapper {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.main-content {
    min-width: 0; /* Prevents grid overflow */
}

.ad-sidebar {
    min-width: 0; /* Prevents grid overflow */
}

/* AdSense Container */
.ad-container {
    text-align: center;
    min-height: 100px;
    background-color: #f0f0f0;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    width: 100%;
}

.ad-top {
    margin-top: 20px;
}

.ad-middle {
    margin-top: 20px;
}

.ad-inline {
    margin-top: 20px;
    margin-bottom: 20px;
}

.ad-footer {
    margin: 30px auto;
    max-width: 1200px;
}

/* Categories Section */
.categories {
    padding: 30px 0;
    background-color: var(--white);
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 40px;
    color: var(--primary-color);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 20px;
}

.section-header .section-title {
    margin-bottom: 0;
    text-align: left;
}

.search-container {
    position: relative;
    flex: 0 0 auto;
    min-width: 300px;
    max-width: 400px;
}

.search-input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 2px solid #ddd;
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
    background-color: var(--white);
}

.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 190, 0, 0.1);
}

.search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    pointer-events: none;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.category-card {
    background: linear-gradient(135deg, var(--white) 0%, #f0f7ff 100%);
    padding: 10px;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 2px solid transparent;
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

.category-card img {
    width: 45px;
    height: 45px;
    object-fit: contain;
    margin-bottom: 6px;
}

.category-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.category-card h3 {
    font-size: 0.95rem;
    margin-bottom: 0;
    color: #000;
    font-weight: 600;
    line-height: 1.2;
}

.category-card p {
    color: #666;
    font-size: 0.75rem;
    margin: 0;
    line-height: 1.3;
}

/* Books Section */
.books-section {
    padding: 40px 0;
    background-color: var(--light-bg);
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.book-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.book-thumbnail {
    width: 100%;
    height: 280px;
    object-fit: cover;
    display: block;
}

.book-info {
    padding: 15px;
    text-align: center;
}

.book-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 5px;
}

.book-category {
    font-size: 0.9rem;
    color: #666;
}

/* Story Reader Section */
.story-reader-section {
    padding: 40px 0;
    min-height: 70vh;
}

.story-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.back-btn {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.back-btn:hover {
    background-color: #357ABD;
}

.read-btn {
    background-color: var(--accent-color);
    color: var(--white);
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.read-btn:hover {
    background-color: #6BB01A;
}

.story-content {
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin: 20px 0;
}

.story-pdf {
    width: 100%;
    height: 800px;
    border: none;
}

.story-image-container {
    text-align: center;
}

.story-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.loading {
    text-align: center;
    padding: 40px;
    font-size: 1.2rem;
    color: #666;
}

/* Story Reading Modal */
.story-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 3000;
    justify-content: center;
    align-items: center;
    padding: 0;
}

.story-modal-content {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: 100vh;
    max-height: 100vh;
    background-color: var(--white);
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.close-modal-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: rgba(0, 0, 0, 0.7);
    color: var(--white);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 28px;
    cursor: pointer;
    z-index: 3001;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background-color 0.3s, transform 0.3s;
}

.close-modal-btn:hover {
    background-color: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

.story-modal-body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.story-modal-body.has-padding {
    padding: 20px;
    overflow: auto;
}

.story-modal-pdf {
    width: 100%;
    height: 100vh;
    border: none;
    display: block;
}

.story-modal-image-container {
    width: 100%;
    text-align: center;
    padding: 20px;
}

.story-modal-image {
    max-width: 100%;
    height: auto;
    max-height: calc(95vh - 80px);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Videos Section */
.videos-section {
    padding: 40px 0;
    background-color: var(--light-bg);
}

.videos-header {
    position: relative;
    margin-bottom: 30px;
}

.videos-header .back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: var(--primary-color);
    color: var(--white);
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: 500;
    transition: background-color 0.3s, transform 0.2s;
    margin-bottom: 20px;
}

.videos-header .back-btn:hover {
    background-color: #e6a800;
    transform: translateX(-3px);
}

.videos-header .back-btn svg {
    width: 18px;
    height: 18px;
}

.section-subtitle {
    text-align: center;
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 40px;
}

.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.video-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.video-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 aspect ratio */
    background-color: #000;
    cursor: pointer;
    overflow: hidden;
}

.video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.9;
    transition: opacity 0.3s;
}

.video-thumbnail:hover .play-button {
    opacity: 1;
}

.video-card h3 {
    padding: 15px;
    font-size: 1.1rem;
    color: var(--text-color);
    text-align: center;
}

/* Video Modal */
.video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 20px;
}

.video-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    width: 100%;
    max-width: 1200px;
}

.video-modal-content iframe {
    width: 100%;
    height: 100%;
    min-height: 400px;
    border: none;
}

.close-modal {
    position: absolute;
    top: -40px;
    right: 0;
    color: var(--white);
    font-size: 40px;
    cursor: pointer;
    line-height: 1;
}

.close-modal:hover {
    color: var(--secondary-color);
}

/* Footer */
.footer {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: var(--white);
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 15px;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section a {
    color: var(--white);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: var(--secondary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-wrapper {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .ad-sidebar {
        order: 2;
    }
    
    .main-content {
        order: 1;
    }
    
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .hero-content h2 {
        font-size: 2rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .section-header .section-title {
        text-align: center;
        margin-bottom: 20px;
    }
    
    .search-container {
        min-width: 100%;
        max-width: 100%;
    }
    
    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .book-thumbnail {
        height: 200px;
    }
    
    .videos-grid {
        grid-template-columns: 1fr;
    }
    
    .videos-header .back-btn {
        font-size: 0.9rem;
        padding: 8px 16px;
    }
    
    .header .container {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav {
        position: relative;
        right: auto;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .story-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .category-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .books-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .hero {
        height: 300px;
    }
}


