/* CSS Variables & Global Settings */
:root {
    --primary-color: #1a2a6c;
    /* Deep Royal Blue */
    --secondary-color: #b21f1f;
    /* Warm Red/Burgundy */
    --accent-color: #fdbb2d;
    /* Gold */
    --text-color: #333333;
    --text-light: #ffffff;
    --bg-color: #f9f9f9;
    --section-padding: 80px 20px;

    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

html,
body {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    position: relative;
    /* Helps with AOS containing */
}

h1,
h2,
h3 {
    font-family: var(--font-heading);
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

ul {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: var(--section-padding);
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin: 0 auto 3rem auto;
    /* Centering fix */
    color: var(--primary-color);
    position: relative;
    display: block;
    /* Changed from inline-block for easier centering */
    width: fit-content;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--accent-color);
    margin: 10px auto 0;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 50px;
    background: rgba(255, 255, 255, 0.05);
    /* Very subtle transparent */
    backdrop-filter: blur(5px);
    z-index: 1000;
    transition: all 0.4s ease;
    border-radius: 0;
    left: 0;
    /* Align to left by default for 100% width stability */
    transform: none;
    /* No transform initially */
}

.navbar.scrolled {
    width: 900px;
    max-width: 90%;
    /* Ensure responsiveness on small screens */
    top: 20px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 15px 40px;
    left: 0;
    right: 0;
    margin: 0 auto;
    /* Robust centering without transform */
    transform: none;
    /* Explicitly ensure no transform shifts it */
}

.hamburger {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--text-light);
    /* White initially */
    transition: 0.3s;
}

/* Navbar Scrolled Colors */
.navbar.scrolled .logo {
    color: var(--primary-color);
}

.navbar.scrolled .nav-links a {
    color: var(--primary-color);
}

.navbar.scrolled .hamburger span {
    background-color: var(--primary-color);
}

.navbar .logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-light);
    /* White initially */
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    font-weight: 500;
    color: var(--text-light);
    /* White initially */
}

.nav-links a:hover {
    color: var(--accent-color);
}

/* Hero Section */
.hero-section {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    /* Premium Dark Blue Gradient */
    background: radial-gradient(circle at center, #1a2a6c 0%, #0f172a 100%);
    color: var(--text-light);
    position: relative;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Abstract Gold/Celebration Background */
    background: url('https://images.unsplash.com/photo-1530099486328-e021101a494a?q=80&w=2147&auto=format&fit=crop') center/cover no-repeat;
    opacity: 0.15;
    mix-blend-mode: overlay;
    z-index: 0;
    animation: panBackground 30s linear infinite alternate;
}

@keyframes panBackground {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(1.1);
    }
}

.hero-content {
    position: relative;
    z-index: 1;
    padding: 0 20px;
}

.hero-title {
    font-size: 5rem;
    margin-bottom: 1rem;
    letter-spacing: 2px;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 300;
    margin-bottom: 3rem;
    opacity: 0.9;
}

.hero-scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0.7;
    animation: bounce 2s infinite;
}

.hero-scroll-indicator span {
    font-size: 0.9rem;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    40% {
        transform: translateX(-50%) translateY(-10px);
    }

    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* Timeline Section */
.timeline-section {
    background-color: #f9f9f9;
    position: relative;
}

.timeline-container {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 0;
}

.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--accent-color);
    transform: translateX(-50%);
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    margin-bottom: 60px;
    width: 50%;
    padding: 0 40px;
}

.timeline-item:nth-child(even) {
    /* Actually odd in DOM structure due to line div, but logic applies to items */
    left: 0;
    text-align: right;
}

.timeline-item:nth-child(odd) {
    left: 50%;
    text-align: left;
}

/* Fix for the .timeline-line being the first child */
.timeline-item:nth-of-type(odd) {
    left: 0;
    text-align: right;
}

.timeline-item:nth-of-type(even) {
    left: 50%;
    text-align: left;
}

.timeline-marker {
    position: absolute;
    top: 20px;
    right: -11px;
    width: 22px;
    height: 22px;
    background: var(--primary-color);
    border: 4px solid #fff;
    border-radius: 50%;
    z-index: 10;
    box-shadow: 0 0 0 4px rgba(253, 187, 45, 0.3);
}

.timeline-item:nth-of-type(even) .timeline-marker {
    left: -11px;
}

.timeline-content {
    background: #fff;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    border-bottom: 4px solid var(--primary-color);
}

.timeline-content:hover {
    transform: translateY(-5px);
}

.timeline-date {
    display: inline-block;
    padding: 5px 15px;
    background: var(--accent-color);
    color: var(--primary-color);
    font-weight: 700;
    border-radius: 20px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.timeline-title {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

/* Timeline Responsive */
@media (max-width: 768px) {
    .timeline-line {
        left: 30px;
    }

    .timeline-item {
        width: 100%;
        left: 0 !important;
        text-align: left !important;
        padding-left: 80px;
        padding-right: 20px;
    }

    .timeline-marker {
        left: 19px !important;
        right: auto;
    }
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: none;
    /* Hidden by default */
    background: var(--accent-color);
    color: var(--primary-color);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: all 0.3s ease;
}

.back-to-top:hover {
    transform: translateY(-5px);
    background: #fff;
}

/* Gallery Section */
.gallery-section {
    background-color: #fff;
    padding-bottom: 100px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    /* Slightly smaller min-width */
    gap: 20px;
    padding: 20px 0;
}

.gallery-item {
    position: relative;
    height: 450px;
    /* Taller height for portrait/WhatsApp images */
    overflow: hidden;
    border-radius: 15px;
    /* Softer corners */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    /* Focus on faces/heads for vertical photos */
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: #fff;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
    transform: translateY(0);
}

.gallery-overlay span {
    font-size: 1.2rem;
    font-weight: 500;
}

/* Message Section */
.message-section {
    background-color: var(--primary-color);
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    color: #fff;
    text-align: center;
    padding: 100px 20px;
}

.message-section .section-title {
    color: var(--accent-color);
}

.message-card {
    background: #fff;
    color: var(--text-color);
    max-width: 800px;
    margin: 0 auto;
    padding: 40px;
    /* Reduced specific padding, container handles it */
    border-radius: 10px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    position: relative;
}

.message-card::before {
    content: '"';
    font-family: var(--font-heading);
    font-size: 10rem;
    position: absolute;
    top: -40px;
    left: 40px;
    color: var(--accent-color);
    opacity: 0.2;
}

.card-inner {
    padding: 20px;
    border: 2px solid var(--accent-color);
    border-radius: 5px;
}

.message-title {
    font-size: 2rem;
    margin-bottom: 20px;
    text-align: left;
}

.message-text {
    font-size: 1.2rem;
    margin-bottom: 20px;
    line-height: 1.8;
    text-align: left;
}

.signature {
    font-family: 'Poppins', sans-serif;
    /* Or a handwritten font */
    font-size: 1.5rem;
    font-style: italic;
    text-align: right;
    margin-top: 30px;
    color: var(--secondary-color);
}

.celebrate-btn {
    display: inline-block;
    margin-top: 40px;
    padding: 15px 40px;
    background: var(--secondary-color);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(178, 31, 31, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.celebrate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(178, 31, 31, 0.4);
    background: #c92525;
}

/* Gallery & Placeholders */
.placeholder-text {
    text-align: center;
    padding: 50px;
    color: #888;
    font-style: italic;
    border: 2px dashed #ddd;
    border-radius: 10px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 40px;
    background: var(--primary-color);
    color: var(--text-light);
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        padding: 15px 20px;
        width: 100%;
        /* Reset width for mobile */
        top: 0;
        border-radius: 0;
        /* No floating radius on very small screens if desired, or keep it */
    }

    .navbar.scrolled {
        width: 95%;
        /* Slightly wider on mobile */
        top: 10px;
    }

    .hero-title {
        font-size: 3rem;
    }

    .hamburger {
        display: flex;
    }

    .nav-links {
        display: flex;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        height: 0;
        background: rgba(255, 255, 255, 0.98);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 30px;
        overflow: hidden;
        transition: height 0.4s ease;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    }

    .nav-links.active {
        height: 300px;
        border-bottom-left-radius: 20px;
        border-bottom-right-radius: 20px;
    }

    .nav-links a {
        font-size: 1.2rem;
        color: var(--primary-color);
        /* Always dark in mobile menu dropdown */
    }

    .nav-links a {
        font-size: 1.2rem;
        color: var(--primary-color);
        /* Always dark in mobile menu dropdown */
    }
}

/* Small Screens (Up to 480px) - Covers most mobiles */
@media (max-width: 480px) {
    .navbar {
        padding: 5px 10px;
    }

    .navbar.scrolled {
        width: 98%;
        /* Use almost full width */
        top: 5px;
        /* Less gap at top */
        padding: 8px 15px;
        /* Compact padding */
    }

    .navbar .logo {
        font-size: 1.1rem;
        /* Smaller logo to prevent overlap */
    }

    .hamburger span {
        width: 22px;
        height: 2px;
    }

    .hero-title {
        font-size: 2.2rem;
        /* Compact hero title */
    }

    .hero-subtitle {
        font-size: 0.9rem;
    }

    .section-title {
        font-size: 1.8rem;
        /* Fit "A Journey..." better */
    }

    /* Adjust Timeline for very narrow screens */
    .timeline-container {
        padding: 10px 0;
    }

    .timeline-item {
        padding-left: 45px;
        /* Gain 15px space */
        padding-right: 5px;
        margin-bottom: 20px;
    }

    .timeline-marker {
        left: 5px !important;
        /* Move closer to edge */
        width: 15px;
        height: 15px;
        top: 22px;
    }

    .timeline-line {
        left: 12px;
        /* Center of marker (5 + 7.5) */
    }

    .timeline-content {
        padding: 12px;
    }

    .timeline-content p {
        font-size: 0.85rem;
    }

    .timeline-title {
        font-size: 1.2rem;
    }

    .timeline-date {
        font-size: 0.75rem;
        padding: 3px 10px;
    }

    /* Message Section */
    .message-card {
        padding: 15px;
    }

    .message-card::before {
        font-size: 4rem;
        top: -20px;
        left: 5px;
    }

    .card-inner {
        padding: 12px;
    }

    .message-text {
        font-size: 0.95rem;
    }

    /* Modal */
    .modal-content {
        width: 95%;
        padding: 15px;
    }

    .modal-body p {
        font-size: 1.1rem;
    }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: none;
    /* Hidden by default */
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: #fff;
    padding: 40px;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    border: 2px solid var(--accent-color);
    transform: scale(0.7);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-body p {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    font-style: italic;
    line-height: 1.6;
}

.heart-icon {
    font-size: 3rem;
    margin: 20px 0;
    animation: heartBeat 1.5s infinite;
}

@keyframes heartBeat {
    0% {
        transform: scale(1);
    }

    14% {
        transform: scale(1.3);
    }

    28% {
        transform: scale(1);
    }

    42% {
        transform: scale(1.3);
    }

    70% {
        transform: scale(1);
    }
}

.modal-btn {
    padding: 12px 30px;
    background: var(--secondary-color);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-btn:hover {
    background: #c92525;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(178, 31, 31, 0.4);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    color: #999;
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal:hover {
    color: var(--secondary-color);
}