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

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    line-height: 1.6;
    color: #2c3e50;
    background-color: #ffffff;
    overflow-x: hidden;
}

/* Container for consistent max-width */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header and Navigation */
header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    border-bottom: 1px solid rgba(44, 62, 80, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.logo a {
    font-size: 1.8rem;
    font-weight: 700;
    text-decoration: none;
    color: #2c3e50;
    letter-spacing: -0.5px;
    transition: color 0.3s ease;
}

.logo a:hover {
    color: #8b4513;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

nav ul li a {
    text-decoration: none;
    color: #2c3e50;
    font-weight: 500;
    font-size: 1rem;
    position: relative;
    transition: color 0.3s ease;
}

nav ul li a:hover {
    color: #8b4513;
}

nav ul li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: #8b4513;
    transition: width 0.3s ease;
}

nav ul li a:hover::after {
    width: 100%;
}

/* Hero Section */
#hero {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 8rem 0 6rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

#hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="%23000" opacity="0.02"/><circle cx="75" cy="75" r="1" fill="%23000" opacity="0.02"/><circle cx="50" cy="10" r="1" fill="%23000" opacity="0.02"/><circle cx="10" cy="90" r="1" fill="%23000" opacity="0.02"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
}

.hero-content h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #2c3e50;
    letter-spacing: -1px;
    line-height: 1.2;
}

.hero-content p {
    font-size: 1.3rem;
    margin-bottom: 2.5rem;
    color: #5a6c7d;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Button Styles */
.btn {
    display: inline-block;
    background: #8b4513;
    color: #fff;
    padding: 1rem 2rem;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.3);
}

.btn:hover {
    background: #a0522d;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 69, 19, 0.4);
}

.btn:active {
    transform: translateY(0);
}

/* Section Styles */
section {
    padding: 6rem 0;
}

section h2 {
    text-align: center;
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 3rem;
    color: #2c3e50;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* About Section */
#about {
    background: #ffffff;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 4rem;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.about-image {
    position: relative;
}

.about-image img {
    width: 100%;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.about-image:hover img {
    transform: scale(1.05);
}

.about-text {
    font-size: 1.1rem;
    line-height: 1.8;
}

.about-text p {
    margin-bottom: 2rem;
    color: #5a6c7d;
}

/* Books Section */
#books {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.book-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.book-item {
    text-align: center;
    background: #ffffff;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.book-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.book-item img {
    width: 100%;
    max-width: 200px;
    height: auto;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.book-item h3 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: #2c3e50;
    font-weight: 600;
}

/* Events Section */
#events {
    background: #ffffff;
}

.events-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
}

#events ul {
    list-style: none;
    margin-bottom: 3rem;
}

#events ul li {
    background: #f8f9fa;
    margin-bottom: 1rem;
    padding: 1.5rem;
    border-radius: 10px;
    font-size: 1.1rem;
    color: #5a6c7d;
    border-left: 4px solid #8b4513;
}

/* Contact Section */
#contact {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: #ffffff;
}

#contact h2 {
    color: #ffffff;
}

.contact-content {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
}

#contact form {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

#contact form input {
    padding: 1rem;
    width: 300px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    outline: none;
    background: rgba(255, 255, 255, 0.9);
}

#contact form input:focus {
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.3);
}

/* Footer */
footer {
    background: #1a252f;
    color: #ffffff;
    text-align: center;
    padding: 3rem 2rem;
}

.social-media {
    margin-bottom: 2rem;
}

.social-media a {
    color: #ffffff;
    text-decoration: none;
    margin: 0 1rem;
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.social-media a:hover {
    color: #8b4513;
}

footer p {
    margin: 1rem 0;
    color: #95a5a6;
}

footer a {
    color: #95a5a6;
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: #ffffff;
}

/* Responsive Design */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    nav ul {
        gap: 1rem;
    }
    
    #hero {
        padding: 6rem 0 4rem;
    }
    
    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .book-gallery {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    #contact form {
        flex-direction: column;
        align-items: center;
    }
    
    #contact form input {
        width: 100%;
        max-width: 400px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    
    nav {
        padding: 0.5rem 1rem;
    }
    
    section {
        padding: 4rem 0;
    }
    
    .hero-content,
    .about-content,
    .book-gallery,
    .events-content,
    .contact-content {
        padding: 0 1rem;
    }
}

/* Enhanced Mobile Navigation */
.hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #2c3e50;
    padding: 0.5rem;
    transition: transform 0.3s ease;
}

.hamburger:hover {
    transform: scale(1.1);
}

/* Animation Classes */
.animate-in {
    opacity: 1;
    transform: translateY(0);
}

section {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.book-item {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.book-item.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Image Loading States */
.book-item img {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.book-item img.loaded {
    opacity: 1;
}

/* Form Enhancements */
#contact form input.valid {
    border-color: #27ae60;
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.2);
}

#contact form input.invalid {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.2);
}

/* Notification System */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    z-index: 10000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    max-width: 300px;
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    background: #27ae60;
}

.notification-error {
    background: #e74c3c;
}

.notification-info {
    background: #3498db;
}

/* Reading Progress Bar */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #8b4513, #a0522d);
    z-index: 10001;
    transition: width 0.3s ease;
}

/* Enhanced Hover Effects */
.book-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.book-item:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
}

/* Header Transitions */
header {
    transition: all 0.3s ease;
}

/* Body Loading State */
body:not(.loaded) section {
    opacity: 0;
    transform: translateY(50px);
}

body.loaded section {
    opacity: 1;
    transform: translateY(0);
}

/* Enhanced Mobile Styles */
@media (max-width: 768px) {
    .hamburger {
        display: block;
    }
    
    nav ul {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 1rem 0;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
        transform: translateY(-20px);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    nav ul.mobile-active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    nav ul li {
        margin: 0;
        text-align: center;
    }
    
    nav ul li a {
        display: block;
        padding: 0.8rem 1rem;
        border-bottom: 1px solid rgba(44, 62, 80, 0.1);
    }
    
    nav ul li:last-child a {
        border-bottom: none;
    }
    
    /* Mobile Hero Adjustments */
    #hero {
        padding: 6rem 0 4rem;
    }
    
    .hero-content h1 {
        font-size: clamp(2rem, 8vw, 3rem);
    }
    
    .hero-content p {
        font-size: 1.1rem;
    }
    
    /* Mobile About Section */
    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .about-image {
        max-width: 300px;
        margin: 0 auto;
    }
    
    /* Mobile Book Gallery */
    .book-gallery {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .book-item {
        max-width: 300px;
        margin: 0 auto;
    }
    
    /* Mobile Contact Form */
    #contact form {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    #contact form input {
        width: 100%;
        max-width: 400px;
    }
    
    /* Mobile Notification */
    .notification {
        right: 10px;
        left: 10px;
        max-width: none;
        transform: translateY(-100px);
    }
    
    .notification.show {
        transform: translateY(0);
    }
}

/* Extra Small Devices */
@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    
    nav {
        padding: 0.5rem 1rem;
    }
    
    section {
        padding: 4rem 0;
    }
    
    .hero-content,
    .about-content,
    .book-gallery,
    .events-content,
    .contact-content {
        padding: 0 1rem;
    }
    
    .book-item {
        padding: 1.5rem;
    }
    
    #events ul li {
        padding: 1rem;
        font-size: 1rem;
    }
}

/* Print Styles */
@media print {
    header {
        position: static;
    }
    
    .hamburger,
    .reading-progress,
    .notification {
        display: none;
    }
    
    section {
        page-break-inside: avoid;
        opacity: 1;
        transform: none;
    }
}

/* Book Gallery Enhancements */
.book-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.book-item {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: all 0.3s ease;
}

.book-item img {
    width: 100%;
    max-width: 250px;
    height: auto;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.book-item h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.book-number {
    color: #8b4513;
    font-style: italic;
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.book-item p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

/* Social Links Styling */
.social-links {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.social-btn {
    background: linear-gradient(135deg, #8b4513, #a0522d);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.social-btn:hover {
    background: linear-gradient(135deg, #a0522d, #8b4513);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(139, 69, 19, 0.3);
}

/* About Section Enhancements */
.about-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
    align-items: center;
    margin-top: 2rem;
}

.about-image img {
    width: 100%;
    max-width: 400px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.about-text p {
    margin-bottom: 1.5rem;
    line-height: 1.8;
    color: #444;
}

/* Events Section as Social Connect */
#events .events-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

#events p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #666;
    margin-bottom: 2rem;
}

/* Enhanced Mobile Responsiveness */
@media (max-width: 768px) {
    .book-gallery {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .about-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
    
    .about-image {
        max-width: 300px;
        margin: 0 auto;
    }
    
    .social-links {
        flex-direction: column;
        align-items: center;
    }
    
    .social-btn {
        width: 200px;
        text-align: center;
    }
    
    .book-item {
        padding: 1.5rem;
    }
    
    .book-item img {
        max-width: 200px;
    }
}

@media (max-width: 480px) {
    .book-item {
        padding: 1rem;
    }
    
    .book-item h3 {
        font-size: 1.1rem;
    }
    
    .book-item p {
        font-size: 0.9rem;
    }
    
    .about-text p {
        font-size: 1rem;
    }
}

/* MailChimp Newsletter Form Styling */
.newsletter-form {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.newsletter-form .form-group {
    display: flex;
    gap: 1rem;
    width: 100%;
    align-items: center;
}

.newsletter-form input[type="email"] {
    flex: 1;
    padding: 0.8rem 1rem;
    border: 2px solid #ddd;
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    background: white;
}

.newsletter-form input[type="email"]:focus {
    border-color: #8b4513;
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.2);
}

.newsletter-form .btn {
    white-space: nowrap;
    min-width: 120px;
    margin: 0;
}

/* MailChimp Response Messages */
#mce-responses {
    margin-top: 1rem;
    text-align: center;
}

#mce-error-response {
    color: #e74c3c;
    background: #fdf2f2;
    padding: 0.8rem;
    border-radius: 8px;
    border: 1px solid #e74c3c;
}

#mce-success-response {
    color: #27ae60;
    background: #f2fdf5;
    padding: 0.8rem;
    border-radius: 8px;
    border: 1px solid #27ae60;
}

/* Mobile Newsletter Form */
@media (max-width: 768px) {
    .newsletter-form .form-group {
        flex-direction: column;
        gap: 1rem;
    }
    
    .newsletter-form input[type="email"] {
        width: 100%;
        max-width: 400px;
    }
    
    .newsletter-form .btn {
        width: 100%;
        max-width: 200px;
    }
}

@media (max-width: 480px) {
    .newsletter-form {
        padding: 0 1rem;
    }
    
    .newsletter-form input[type="email"] {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}
