/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

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

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 1rem 0;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

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

.nav-logo h2 {
    color: #2c3e50;
    font-weight: 600;
    font-size: 1.5rem;
}

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

.nav-link {
    text-decoration: none;
    color: #555;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: #3498db;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: #3498db;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Parallax container */
.parallax-container {
    position: relative;
    height: 100vh;
    overflow: hidden;
}

.parallax-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 120%;
    height: 120%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    will-change: transform;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Mobile optimized parallax */
@media (max-width: 768px) {
    .parallax-bg {
        background-attachment: scroll;
        width: 100%;
        height: 100%;
        background-size: cover;
        background-position: center center;
    }

    .parallax-container {
        height: 70vh;
        min-height: 400px;
    }

    .hero.parallax-container {
        height: 80vh;
        min-height: 500px;
    }

    /* Better mobile positioning for original images when JS removes inline styles */
    .hero .parallax-bg.optimized-mobile-positioning {
        background-image: url('./images/charlie_2.jpg');
        background-position: center 30%; /* Focus on upper portion for hero */
    }

    #quotes .parallax-bg.optimized-mobile-positioning {
        background-image: url('./images/charlie_1.jpg');
        background-position: center 40%; /* Adjust focus area */
    }

    #quotes-about .parallax-bg.optimized-mobile-positioning {
        background-image: url('./images/charlie_3.jpg');
        background-position: center 35%; /* Adjust focus area */
    }

    #faq .parallax-bg.optimized-mobile-positioning {
        background-image: url('./images/charlie_4.jpg');
        background-position: center 45%; /* Adjust focus area */
    }

    /* Mobile-specific images - only if they exist */
    .hero .parallax-bg.has-mobile-image {
        background-image: url('./images/charlie_2_mobile.jpg');
        background-position: center center;
    }

    #quotes .parallax-bg.has-mobile-image {
        background-image: url('./images/charlie_1_mobile.jpg');
        background-position: center center;
    }

    #quotes-about .parallax-bg.has-mobile-image {
        background-image: url('./images/charlie_3_mobile.jpg');
        background-position: center center;
    }

    #faq .parallax-bg.has-mobile-image {
        background-image: url('./images/charlie_4_mobile.jpg');
        background-position: center center;
    }
}

/* Hero section */
.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

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

.hero-title {
    font-size: 4rem;
    font-weight: 300;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 1s ease;
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 300;
    opacity: 0.9;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 1s ease 0.5s both;
}

/* Sections */
.section {
    position: relative;
}

.section .parallax-container {
    height: auto;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1;
}

.section-content {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: 5rem 0;
    color: white;
}

.section-title {
    font-size: 3rem;
    font-weight: 300;
    text-align: center;
    margin-bottom: 3rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Quotes grid */
.quotes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.quote-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.quote-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.quote-card blockquote {
    font-size: 1.2rem;
    font-style: italic;
    line-height: 1.8;
    margin-bottom: 1rem;
    position: relative;
}

.quote-card cite {
    display: block;
    text-align: right;
    font-size: 0.9rem;
    opacity: 0.8;
    font-weight: 500;
}

.quote-card cite a {
    color: white;
    text-decoration: underline;
}

/* FAQ Section */
.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    margin-bottom: 1.5rem;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.faq-item:hover {
    transform: translateY(-5px);
}

.faq-question {
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    margin: 0;
    font-size: 1.3rem;
    font-weight: 500;
}

.faq-answer {
    padding: 1.5rem;
    font-size: 1.1rem;
    line-height: 1.7;
    opacity: 0.9;
}

.faq-answer a {
    color: white;
    text-decoration: underline;
}

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

/* Mobile navigation improvements */
.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 5px;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: #333;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 1px;
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Responsive design */
@media (max-width: 768px) {
    .nav-container {
        position: relative;
        padding: 0 15px;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(15px);
        flex-direction: column;
        padding: 1rem;
        margin-top: 10px;
        border-radius: 10px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        transform: translateY(-10px);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-item {
        margin: 0.5rem 0;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

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

    .quotes-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 10px;
    }

    .quote-card {
        padding: 1.2rem;
        margin: 0 5px;
    }

    .quote-card blockquote {
        font-size: 1.1rem;
        line-height: 1.6;
    }

    .parallax-container {
        height: auto;
        min-height: 60vh;
    }

    .section-content {
        padding: 3rem 0;
    }
}

/* Additional mobile improvements */
@media (max-width: 768px) {
    /* Improve touch targets */
    .nav-link {
        padding: 12px 16px;
        display: block;
        border-radius: 8px;
    }

    .nav-link:hover {
        background: rgba(52, 152, 219, 0.1);
    }

    /* Prevent text selection on navigation elements */
    .nav-toggle, .nav-menu {
        user-select: none;
        -webkit-user-select: none;
    }

    /* Smooth transitions for mobile interactions */
    .quote-card, .faq-item {
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }

    .quote-card:active {
        transform: scale(0.98);
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }

    .nav-container {
        padding: 0 10px;
    }

    .nav-logo h2 {
        font-size: 1.2rem;
    }

    .hero-content {
        padding: 1rem;
        margin: 0 10px;
    }

    .hero-title {
        font-size: 2rem;
        line-height: 1.2;
    }

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

    .section-title {
        font-size: 1.8rem;
        margin-bottom: 2rem;
    }

    .quotes-grid {
        padding: 0 5px;
        gap: 1rem;
    }

    .quote-card {
        padding: 1rem;
        margin: 0;
    }

    .quote-card blockquote {
        font-size: 1rem;
        line-height: 1.5;
    }

    .quote-card cite {
        font-size: 0.8rem;
    }

    .faq-question {
        font-size: 1rem;
        padding: 1rem;
    }

    .faq-answer {
        padding: 0 1rem 1rem;
        font-size: 0.95rem;
        line-height: 1.6;
    }

    .section-content {
        padding: 2rem 0;
    }

    .parallax-container {
        min-height: 50vh;
    }
}
