/* ---
   style.css for Meemah's Petal Palace
   --- */

/* --- 0. Imports & Variables --- */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700&family=Poppins:wght@300;400;600&display=swap');

:root {
    --primary-color: #b11f89;
    --secondary-color: #ea1363;
    --white: #ffffff;
    --whatsapp-button: #6b8e23;
    --dark-gray: #444;
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Poppins', sans-serif;
    --sidebar-width: 300px;
}

/* --- 1. Basic Reset & Body --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--white);
    color: var(--dark-gray);
    line-height: 1.6;
    font-size: 16px;
    font-weight: 300;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.75em;
}

p {
    margin-bottom: 1.25em;
}

a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-color);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

/* --- 2. Main Layout (Wrapper, Sidebar, Main) --- */
#wrapper {
    display: flex;
    position: relative;
}

/* Sidebar Navigation */
#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--white);
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.578);
    z-index: 100;
    transition: transform 0.4s ease;
}

.sidebar-inner {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    padding: 2.5em 2em;
    text-align: center;
}

ul.main-nav {
    list-style: none;
}
ul.main-nav li a {
    display: block;
    padding: 0.8em 0;
    font-size: 1.1em;
    font-weight: 600;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}
ul.main-nav li a:hover {
    color: var(--secondary-color);
}
ul.main-nav li a.active {
    color: var(--dark-gray);
    font-weight: 700;
}

.sidebar-footer .social-links {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 1.5em;
    margin-bottom: 1em;
}
.sidebar-footer .social-links a {
    font-size: 1.8em;
    color: var(--secondary-color);
}
.sidebar-footer .social-links a:hover {
    color: var(--primary-color);
}

.sidebar-footer .copyright {
    font-size: 0.85em;
    color: var(--secondary-color);
    line-height: 1.5;
    margin: 0;
}

/* Main Content Area */
#main {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    position: relative;
    height: 100vh;
}

.panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease-in-out, visibility 0.6s;
    overflow: hidden; /* Hide scrollbars during transition */
}
.panel.active {
    opacity: 1;
    visibility: visible;
    z-index: 2;
}

/* --- 3. Panel 1: Intro (Hero) Section --- */
#intro {
    background: url('images/main background/background.svg') no-repeat center center/cover;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
}

.button.primary.nav-link {
    display: inline-block;       /* behave like a button */
    padding: 0.75rem 1.5rem;     /* size */
    background-color:var(--primary-color);   /* primary button color */
    color: #fff;                 /* text color */
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;       /* remove underline for links */
    border: none;                /* remove any default border */
    border-radius: 0.5rem;       /* rounded corners */
    cursor: pointer;             /* pointer on hover */
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.button.primary.nav-link:hover {
    background-color: var(--dark-gray);   /* darker on hover */
    transform: translateY(-2px); /* subtle lift effect */
}

.button.primary.nav-link:active {
    transform: translateY(0);    /* reset on click */
}


/* Overlay for readability */
#intro::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0);
    z-index: 1;
}
.hero-content {
    position: relative;
    z-index: 2;
    padding: 2em 3em;
    border-radius: 10px;
}
#intro h2 {
    font-family: var(--font-body);
    font-size: 1.5em;
    color: var(--white);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
}
#intro h1 {
    font-size: 3.5em;
    color: var(--secondary-color);
    margin-bottom: 0.75em;
    line-height: 1.2;
}

/* --- 4. Panel 2: Scrollable Content --- */
#content-wrapper {
    overflow-y: auto; /* This makes the panel scrollable */
    background: var(--white);
}

.content-section {
    padding: 5em 4em;
    max-width: 1100px;
    margin: 0 auto;
    border-bottom: 1px solid #eee;
}
#content-wrapper section:last-of-type {
    border-bottom: none;
}

.content-section header {
    text-align: center;
    margin-bottom: 3em;
}
.content-section header h2 {
    font-size: 3em;
    color: var(--dark-gray);
}

/* --- 5. Content Sections (About, Services, Gallery, Contact) --- */

/* About Section */
.two-col {
    display: flex;
    gap: 3em;
    align-items: center;
}
.two-col .col-image {
    flex: 2;
}
.two-col .col-image img {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}
.two-col .col-text {
    flex: 3;
}
.two-col .col-text h3 {
    font-size: 2.2em;
    color: var(--secondary-color);
}

/* Services Section */
.service-item {
    display: flex;
    gap: 2.5em;
    align-items: center;
    margin-bottom: 4em;
}
.service-item .service-text {
    flex: 1;
}
.service-item .service-image {
    flex: 1;
}
.service-item .service-image img {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}
.service-item h4 {
    font-size: 1.8em;
    color: var(--secondary-color);
}
/* Alternating layout */
.service-item.alt {
    flex-direction: row-reverse;
}

/* Gallery Section */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5em; /* Nimeongeza nafasi kidogo */
}

.gallery-item {
    /* Hii sasa ni container ya "kadi" */
    display: block;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); /* Shadow nzuri kidogo */
    background: var(--white, #ffffff); /* Inasaidia kama ukurasa una rangi */
    overflow: hidden; /* Muhimu kwa ajili ya picha ndani */
    transition: transform 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-5px); /* Inainua kadi nzima juu kidogo */
}

.gallery-image-link {
    display: block;
    overflow: hidden; /* Hii ni kwa ajili ya 'zoom' effect kwenye picha */
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block; /* Inaondoa nafasi yoyote chini ya picha */
    transition: transform 0.4s ease;
}

/* 'Zoom' effect sasa inatokea kwenye link, sio item */
.gallery-image-link:hover img {
    transform: scale(1.1);
}

/* --- HII NI CSS MPYA KWA AJILI YA MAELEZO --- */
.gallery-caption {
    padding: 1em;
    text-align: center;
}

.gallery-caption p {
    margin: 0; /* Ondoa margin ya 'paragraph' */
    font-size: 0.95em;
    color: var(--dark-gray, #444); /* Tumia variable yako */
    font-weight: 600;
    font-family: var(--font-body, 'Poppins', sans-serif);
}

/* Contact Section */
.contact-container {
    display: flex;
    gap: 3em;
}
.contact-info h4 {
    font-size: 1.6em;
    color: var(--secondary-color);
    margin-bottom: 0.5em;
}
.contact-info p {
    font-size: 1.1em;
}
.contact-info .location-title {
    margin-top: 1.5em;
}
.map-container {
    width: 100%;
    height: 250px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #eee;
}
.map-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

/* --- 6. Buttons & Utilities --- */
.button {
    display: inline-block;
    padding: 0.8em 2em;
    border-radius: 30px;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
}
.button.primary {
    background-color: var(--primary-color);
    color: var(--white);
}
.button.primary:hover {
    background-color: var(--secondary-color);
    color: white;
}
.button.whatsapp {
    background-color: #25D366;
    color: white;
    margin-bottom: 1em;
}
.button.whatsapp:hover {
    background-color: var(--primary-color);
    color: white;
}
.button.whatsapp .fa-whatsapp {
    margin-right: 0.5em;
}

/* Scroll Fade-in Animation */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- 7. Lightbox --- */
#lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    cursor: pointer;
    animation: fadeIn 0.3s ease;
}
.lightbox-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90%;
    max-height: 80%;
    border-radius: 5px;
}
.close-lightbox {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}
.close-lightbox:hover {
    color: var(--primary-color);
}
#lightbox-caption {
    text-align: center;
    color: #ccc;
    font-size: 1.2em;
    padding: 10px;
    position: absolute;
    bottom: 5%;
    left: 50%;
    transform: translateX(-50%);
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- 8. Responsive Design --- */

/* Mobile Menu Toggle Button */
.toggle {
    display: none;
    position: fixed;
    top: 1em;
    right: 1.5em;
    font-size: 1.8em;
    color: var(--primary-color);
    z-index: 99;
    background: var(--white);
    padding: 0.1em 0.4em;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

@media (max-width: 980px) {
    /* Stack two-column layouts */
    .two-col, .service-item, .service-item.alt, .contact-container {
        flex-direction: column;
    }
    .service-item.alt {
        flex-direction: column-reverse; /* Keep image order logical */
    }
    .two-col .col-image {
        max-width: 400px;
        margin: 0 auto;
    }
    .content-section {
        padding: 4em 2em;
    }
    #intro h1 {
        font-size: 2.5em;
    }
}

@media (max-width: 768px) {
    /* Activate mobile toggle */
    .toggle {
        display: block;
    }

    /* Hide sidebar */
    #sidebar {
        transform: translateX(calc(-1 * var(--sidebar-width)));
    }
    #sidebar.visible {
        transform: translateX(0);
        box-shadow: 5px 0 20px rgba(0,0,0,0.15);
    }
    
    #main {
        margin-left: 0;
        width: 100%;
    }
    
    .panel {
        width: 100%;
    }

    .content-section {
        padding: 3em 1.5em;
    }

    .content-section header h2 {
        font-size: 2.5em;
    }

    #intro h1 {
        font-size: 2.2em;
    }
    #intro h2 {
        font-size: 1.2em;
    }
    .hero-content {
        padding: 1.5em;
    }
}
