/***************************************
* TABLE OF CONTENTS
* 1. Base Styles and Reset
* 2. Variables and Theme Configuration
* 3. Typography
* 4. Layout and Grid
* 5. Navigation
* 6. Hero Section
* 7. About Section
* 8. Book Section
* 9. Contact Form
* 10. Footer
* 11. Components (Buttons, Cards)
* 12. Animations and Transitions
* 13. Utilities
* 14. Media Queries
***************************************/

/***************************************
* 1. Base Styles and Reset
* - Normalizes browser defaults
* - Sets up animation keyframes
* - Establishes base box-sizing
***************************************/
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/***************************************
* 13. Utility Classes
* - Helper classes for common patterns
* - Text alignment, spacing, etc.
***************************************/
.text-center {
    text-align: center;
}

/***************************************
* 2. Variables and Theme Configuration
* - Color palette
* - Shadows and effects
* - Transitions and timing
***************************************/
:root {
    --primary-color: #000000;
    --secondary-color: #FF0000;
    --accent-color: #FFB800;
    --text-color: #333333;
    --light-gray: #f8f9fa;
    --medium-gray: #6c757d;
    --dark-gray: #343a40;
    --white: #ffffff;
    --border-light: rgba(0, 0, 0, 0.1);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --font-primary: 'Ariana Pro', Arial, sans-serif;
}

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--text-color);
    font-weight: 400;
}

/***************************************
* 3. Typography
* - Font sizes and weights
* - Heading styles
* - Text spacing
***************************************/
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 900;
    letter-spacing: -0.02em;
}

h1 .highlight {
    color: var(--secondary-color);
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 2rem;
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    text-align: center;
    margin-bottom: 2rem;
}

.subtitle {
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    font-weight: 500;
    color: var(--medium-gray);
}

.about-text p {
    margin-bottom: 1.5rem;
    line-height: 1.8;
    font-size: 1.1rem;
}

.chapter h3 {
    color: var(--primary-color);
    font-size: 1.4rem;
    margin-bottom: 1rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.chapter h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: var(--secondary-color);
    transition: width 0.3s ease;
}

.chapter:hover h3::after {
    width: 100px;
}

.chapter p {
    line-height: 1.7;
    color: var(--text-color);
    font-size: 1.05rem;
}

/***************************************
* 5. Navigation
* - Header and navbar
* - Navigation links
* - Mobile menu
***************************************/
.navbar {
    background: var(--primary-color);
    padding: 1rem;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

.logo {
    color: var(--white);
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-links {
    display: none;
    list-style: none;
}

.nav-links.active {
    display: block;
}

.nav-links li a {
    color: var(--white);
    text-decoration: none;
    padding: 0.5rem 1rem;
    display: block;
    transition: var(--transition);
}

.nav-links li a:hover {
    background: var(--secondary-color);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 2px 10px rgba(0, 163, 255, 0.3);
}

.mobile-menu-btn {
    position: absolute;
    right: 1rem;
    top: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.hamburger {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--white);
    position: relative;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 3px;
    background: var(--white);
    left: 0;
}

.hamburger::before {
    top: -8px;
}

.hamburger::after {
    bottom: -8px;
}

/***************************************
* 6. Hero Section
* - Main banner
* - Hero content and taglines
* - Call to action
***************************************/
.hero {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.hero-overlay {
    position: relative;
    z-index: 2;
    background: rgba(0, 0, 0, 0.6);
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
}

.hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    color: var(--white);
}

.hero-portrait {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 4px solid var(--accent-color);
    margin-bottom: 2rem;
    object-fit: cover;
}

.hero-title {
    font-size: 2rem;
    font-weight: 600;
    margin: 1rem 0;
    color: var(--accent-color);
}

.hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    max-width: 600px;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--accent-color);
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
}

.tagline {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 1rem 0;
    color: var(--accent-color);
}

.subtitle {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 2rem;
    color: var(--white);
}

.cta-button {
    display: inline-block;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-color));
    color: var(--white);
    text-decoration: none;
    border-radius: 5px;
    transition: var(--transition);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
}

.cta-button:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

/* Sections */
section {
    padding: 4rem 1rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/***************************************
* 7. About Section
* - About content layout
* - Achievement cards
* - List styles
***************************************/
.about {
    padding: 80px 0;
    background-color: #f9f9f9;
    text-align: center;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.about h2 {
    font-size: 2.5em;
    margin-bottom: 40px;
    position: relative;
    display: inline-block;
}

.about h2:after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: #ffd700;
    margin: 15px auto;
}

.about-text {
    margin-bottom: 40px;
    line-height: 1.8;
}

.about-text p {
    margin-bottom: 20px;
    font-size: 1.1em;
    color: #333;
}

.qualifications {
    margin-top: 40px;
}

.qualifications h3 {
    font-size: 1.8em;
    margin-bottom: 30px;
    color: #333;
}

.qualifications ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.qualifications li {
    font-size: 1.1em;
    color: #444;
    padding: 15px 25px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
}

.qualifications li:hover {
    transform: translateY(-3px);
}

.qualifications li i {
    margin-right: 15px;
    color: #ffd700;
    font-size: 1.2em;
}

.about h2,
.books h2 {
    font-size: 3.5rem;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--primary-color);
    position: relative;
    padding-bottom: 1rem;
}

.about h2::after,
.books h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--accent-color);
}

/***************************************
* 8. Book Section
* - Book preview layout
* - Chapter cards
* - Buy button
***************************************/
.books {
    padding: 6rem 0;
    background: var(--white);
}

.books .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.book-preview {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 4rem;
    align-items: start;
    background: linear-gradient(145deg, var(--white), var(--light-gray));
    transform: translateY(20px);
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
    position: relative;
    overflow: hidden;
}

.book-cover {
    position: relative;
}

.book-cover::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 20px;
    right: -20px;
    bottom: -20px;
    background: var(--accent-color);
    z-index: -1;
    opacity: 0.1;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.book-cover:hover::after {
    transform: translate(-10px, 10px);
    opacity: 0.2;
}

.book-cover img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s ease;
}

.book-cover:hover img {
    transform: scale(1.05);
}

.book-content {
    padding: 2rem;
    background: var(--white);
    border-radius: 1rem;
    opacity: 0;
    transform: translateX(20px);
    animation: fadeInRight 0.6s ease forwards 0.3s;
}

.book-content h3 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.book-content p {
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--dark-gray);
    margin-bottom: 2rem;
}

.book-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards 0.6s;
}

.book-actions .cta-button {
    text-align: center;
    padding: 1.2rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    text-decoration: none;
}

.preview-btn {
    background: var(--accent-color);
    color: var(--primary-color);
}

.buy-btn {
    background: var(--primary-color);
    color: var(--white);
}

.book-actions .cta-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.preview-btn, .buy-btn {
    position: relative;
    overflow: hidden;
}

.preview-btn::before, .buy-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease-out, height 0.6s ease-out;
}

.preview-btn:hover::before, .buy-btn:hover::before {
    width: 300px;
    height: 300px;
}

/***************************************
* 9. Contact Form
* - Form layout
* - Input styles
* - Submit button
* - Loading states
***************************************/
.contact {
    background: var(--white);
    color: var(--primary-color);
    position: relative;
    overflow: hidden;
    border-top: 5px solid;
    border-image: linear-gradient(to right, var(--accent-color), var(--accent-color)) 1;
}

.contact h2 {
    color: var(--white);
}

.contact-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

input,
textarea {
    width: 100%;
    padding: 1.2rem;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--white);
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: var(--shadow-md);
}

textarea {
    height: 150px;
    resize: vertical;
}

.submit-btn {
    background: var(--primary-color);
    color: var(--white);
    padding: 1.2rem 2.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    font-size: 1rem;
    transition: var(--transition);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.submit-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease-out, height 0.6s ease-out;
}

.submit-btn:hover::after {
    width: 300px;
    height: 300px;
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* PDF Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    -webkit-overflow-scrolling: touch;
}

.modal-content {
    position: relative;
    width: 95%;
    height: 95%;
    margin: 2% auto;
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 10px;
    position: relative;
    background: var(--white);
    border-bottom: 1px solid var(--grey-light);
    z-index: 2;
}

.modal-body {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.close-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--black);
    cursor: pointer;
    background: var(--white);
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.close-btn:hover {
    color: var(--red);
    transform: translateY(-50%) scale(1.1);
}

#pdfViewer {
    width: 100%;
    height: 100%;
    border: none;
}

.pdf-fallback {
    padding: 20px;
    text-align: center;
}

.pdf-fallback p {
    margin-bottom: 20px;
    color: var(--grey-dark);
}

/* Mobile-specific adjustments */
@media (max-width: 768px) {
    .modal-content {
        width: 100%;
        height: 100%;
        margin: 0;
        border-radius: 0;
    }

    .modal-header {
        padding: 15px 10px;
    }

    .close-btn {
        width: 40px;
        height: 40px;
        font-size: 28px;
    }

    .pdf-fallback {
        padding: 40px 20px;
    }

    .pdf-fallback .preview-btn {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
}

/***************************************
* 10. Footer
* - Footer layout
* - Copyright text
* - Social links
***************************************/
footer {
    background: var(--primary-color);
    color: var(--white);
    padding: 2rem 1rem;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    color: var(--white);
    font-size: 1.5rem;
    transition: var(--transition);
}

.social-link:hover {
    color: var(--secondary-color);
}

.copyright {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
}

/* Media Queries */
@media (min-width: 768px) {
    .mobile-menu-btn {
        display: none;
    }

    .navbar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem 2rem;
    }

    .nav-links {
        display: flex;
        gap: 1rem;
    }

    .book-preview {
        grid-template-columns: 300px 1fr;
    }

    .footer-content {
        flex-direction: row;
        justify-content: space-between;
    }
}

@media screen {
    /* Optimize paint operations */
    .navbar, .hero, .about, .books, .contact {
        will-change: transform;
        backface-visibility: hidden;
    }

    /* Optimize animations */
    .animate-on-scroll {
        will-change: opacity, transform;
    }

    /* Video container optimization */
    .video-container {
        position: relative;
        width: 100%;
        max-width: 800px;
        margin: 2rem auto;
        background: var(--dark-gray);
        aspect-ratio: 16/9;
    }

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

    /* Hero section with portrait */
    .hero {
        min-height: 100vh;
        background: var(--primary-color);
        color: var(--white);
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        padding: 6rem 1rem;
    }

    .hero-image {
        width: 300px;
        height: 300px;
        margin: 0 auto 2rem;
        border-radius: 50%;
        overflow: hidden;
        border: 4px solid var(--accent-color);
    }

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

    /* Books section */
    .books {
        background: var(--white);
        padding: 6rem 0;
    }

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

    .book-cover {
        text-align: center;
    }

    .book-cover img {
        max-width: 300px;
        height: auto;
        box-shadow: var(--shadow-lg);
        transition: transform 0.3s ease;
    }

    .book-cover img:hover {
        transform: scale(1.05);
    }

    .book-content {
        padding: 2rem;
        background: var(--light-gray);
        border-radius: 1rem;
    }

    /* Mobile optimizations */
    @media (max-width: 768px) {
        .hero {
            padding: 4rem 1rem;
        }

        .hero-image {
            width: 200px;
            height: 200px;
        }

        h1 {
            font-size: clamp(2rem, 8vw, 3rem);
        }

        .video-container {
            margin: 1rem auto;
        }

        .book-preview {
            padding: 1rem;
        }

        .book-content {
            padding: 1rem;
        }
    }

    /* Tablet and desktop optimizations */
    @media (min-width: 769px) {
        .book-preview {
            grid-template-columns: 300px 1fr;
            gap: 4rem;
        }

        .nav-links {
            display: flex;
            gap: 2rem;
        }

        .mobile-menu-btn {
            display: none;
        }
    }

    /* Print styles */
    @media print {
        .video-container,
        .nav-links,
        .mobile-menu-btn,
        .social-links {
            display: none;
        }

        .hero,
        .about,
        .books,
        .contact {
            padding: 2rem 0;
            page-break-inside: avoid;
        }
    }
}

@media (max-width: 992px) {
    .book-preview {
        grid-template-columns: 1fr;
        gap: 3rem;
        padding: 2rem;
    }

    .book-cover {
        max-width: 400px;
        margin: 0 auto;
    }

    .qualifications {
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    .about-content,
    .books .container {
        padding: 0 1rem;
    }

    .book-actions {
        grid-template-columns: 1fr;
    }

    .qualifications li {
        font-size: 1rem;
    }

    .book-content h3 {
        font-size: 2rem;
    }
}

/* Animations and Transitions */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.animate {
    opacity: 1;
    transform: translateY(0);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}
