/* assets/css/style.css */

/* 1. Root Variables & Reset */
:root {
    --primary-green: #27AE60;
    --dark-green: #1D3522;
    --light-green-bg: #F0FDF4;
    --dark-text: #333;
    --light-text: #fff;
    --border-color: #ddd;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    --font-family: 'Poppins', sans-serif;
}

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

/* 2. Base & Typography */
body {
    font-family: var(--font-family);
    line-height: 1.7;
    color: var(--dark-text);
    background-color: #f9f9f9;
}

h1, h2, h3 {
    font-weight: 600;
    color: var(--dark-green);
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
p { margin-bottom: 1rem; }

a {
    color: var(--primary-green);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--dark-green);
}

.wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

img {
    max-width: 100%;
    height: auto;
}

/* 3. Header & Navigation */
.site-header {
    background: var(--light-text);
    padding: 1rem 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-green);
}

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

nav a {
    color: var(--dark-text);
    font-weight: 600;
    padding-bottom: 5px;
    border-bottom: 2px solid transparent;
    transition: border-color 0.3s ease;
}

nav a:hover, nav a.active {
    border-color: var(--primary-green);
}

.hamburger {
    display: none;
    font-size: 2rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--dark-green);
}

/* 4. Main Content & Sections */
main {
    padding: 3rem 0;
}

section.content {
    background: var(--light-text);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

/* 5. Components (Buttons, Forms, Grids, Cards) */
button, input[type="submit"] {
    background: var(--primary-green);
    color: var(--light-text);
    border: none;
    padding: 12px 25px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

button:hover, input[type="submit"]:hover {
    background: var(--dark-green);
    transform: translateY(-2px);
}

form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

input, textarea {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    font-family: var(--font-family);
    transition: border-color 0.3s, box-shadow 0.3s;
    width: 100%; /* Ensure form elements don't overflow */
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 5px rgba(39, 174, 96, 0.5);
}

.notice {
    padding: 1rem;
    background: var(--light-green-bg);
    border-left: 5px solid var(--primary-green);
    margin-bottom: 1rem;
    border-radius: 5px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--light-text);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.client-grid .card { padding: 1.5rem; }
.client-grid img {
    width: 100%; /* Make the image take the full width of the card's content area */
    max-height: 100px; /* You can increase the max-height a bit if you like */
    object-fit: contain; /* CRITICAL: Ensures the whole logo is visible without distortion */
    margin-bottom: 1rem;
}

.gallery-grid a { display: block; }
.gallery-grid img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

/* 6. Page Specific: Home */
.hero-slider .swiper-container {
    width: 100%;
    height: 60vh;
    max-height: 550px;
}
.hero-slider .swiper-slide {
    background-color: #2c3e50; /* This is still needed for the mobile view */
}
.hero-slider .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Default for large screens: fill the container and crop */
}
.hero-text-content {
    background: var(--light-text);
    text-align: center;
    padding: 2.5rem 1.5rem;
    margin: -60px auto 0 auto;
    position: relative;
    z-index: 10;
    max-width: 1000px;
    border-radius: 8px;
    box-shadow: var(--shadow);
}
.hero-text-content h1 {
    color: var(--dark-green);
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}
.hero-text-content p {
    font-size: 1.1rem;
    color: var(--dark-text);
    max-width: 800px;
    margin: 0 auto;
}
.intro { 
    text-align: center; 
    padding-top: 3rem; 
}

/* 7. Footer */
footer {
    background: var(--dark-green);
    color: var(--light-text);
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}
footer p { margin: 0.5rem 0; }

/* 8. Admin Panel Styles */
.login-box {
    max-width: 400px;
    margin: 5rem auto;
    padding: 2rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: var(--shadow);
    text-align: center;
}
.login-box h2 { margin-bottom: 1.5rem; }
.login-box p { margin-top: 1.5rem; font-size: 0.9rem; }

.table-responsive-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    border: 1px solid var(--border-color);
    border-radius: 5px;
    margin-top: 1.5rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap; /* Prevents text from wrapping, works with horizontal scroll */
}
.admin-table th, .admin-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
.admin-table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

/* 9. Lightbox Styles */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 1rem;
}
.lightbox.active {
    opacity: 1;
    visibility: visible;
}
.lightbox img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 3rem;
    color: #fff;
    cursor: pointer;
    line-height: 1;
}

/* 10. Media Queries for Responsiveness */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    .wrap { padding: 0 1rem; }

    /* === Public Site Hamburger Menu === */
    .hamburger { display: block; }
    nav ul {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%; /* Position right below the header */
        left: 0;
        width: 100%;
        background: var(--light-text);
        box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
        border-top: 1px solid var(--border-color);
        gap: 0;
    }
    nav ul.active { display: flex; }
    nav li { width: 100%; }
    nav a {
        display: block;
        padding: 1rem 1.5rem;
        border-bottom: 1px solid #f0f0f0;
    }
    nav a:hover, nav a.active {
        border-color: transparent; /* Remove bottom border on hover */
        background: var(--light-green-bg);
        color: var(--primary-green);
    }

    /* === Homepage Adjustments === */
    .hero-text-content {
        margin-top: -40px;
        padding: 2rem 1rem;
    }
    .hero-text-content h1 { font-size: 1.8rem; }

    /* === ADD THIS NEW RULE FOR THE SLIDER === */
    .hero-slider .swiper-slide img {
        object-fit: contain; /* On screens 768px or less, show the full image */
    }
    
    main { padding: 1.5rem 0; }
    section.content { padding: 1.5rem; }
    
    /* === Admin Panel Adjustments === */
    .login-box {
        margin: 2rem auto;
        padding: 1.5rem;
        width: 90%;
    }
    .admin-table {
        white-space: normal; /* Allow text to wrap on mobile */
    }
    .admin-table th, .admin-table td {
        padding: 10px;
    }
}

/* 11. Admin Panel Responsive Header */
.admin-header {
    background: #f7f7f7;
}


.admin-header .brand {
    color: var(--light-text);
}

.admin-header nav a {
    color: var(--dark-text);
    opacity: 0.9;
}

.admin-header nav a:hover {
    color: var(--primary-green);
    opacity: 1;
    border-color: var(--primary-green);
}

.admin-header .hamburger {
    color: var(--dark-text);
}

.admin-main {
    padding: 2rem 0;
}

/* Responsive Navigation - Mobile View */
@media (max-width: 768px) {
    .admin-header nav ul {
        background: #f5f5f5; /* Very light greyish background */
        box-shadow: 0 10px 15px rgba(0,0,0,0.1);
    }

    .admin-header nav a {
        color: var(--dark-text);
        border-bottom: 1px solid rgba(0,0,0,0.05);
    }

    .admin-header nav a:hover {
        background: #e0e0e0; /* Slightly darker grey hover effect */
        opacity: 1;
    }

    .admin-main {
        padding: 1.5rem 0;
    }
}

/* 12. Page Specific Styles */

/* --- About Us Page - Dark Green Background --- */
.page-about .content {
    background-color: var(--primary-green); /* Uses the main brand green */
    color: var(--light-text); /* IMPORTANT: Changes paragraph text to white */
}

.page-about .content h1 {
    color: var(--light-text); /* IMPORTANT: Changes the main heading to white */
}
/* 13. Header Logo Styling */
.brand {
    display: flex;
    align-items: center; /* Vertically aligns the logo and text */
    gap: 12px; /* Adds a nice space between the logo and text */
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-green);
}

.brand:hover {
    color: var(--primary-green); /* Optional: Change color on hover */
}

.header-logo {
    max-height: 60px; /* Controls the height of your logo. Adjust if needed. */
    width: 80px;
}

.admin-header .brand {
    color: var(--light-text); /* Ensures admin text stays white */
}
/* 14. Pagination Styling */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 2rem;
    flex-wrap: wrap; /* Allows it to wrap on small screens */
}

.pagination a {
    color: var(--dark-text);
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    text-decoration: none;
    transition: background-color 0.3s, color 0.3s;
}

.pagination a:hover {
    background-color: var(--light-green-bg);
    border-color: var(--primary-green);
}

.pagination a.active {
    background-color: var(--primary-green);
    color: var(--light-text);
    border-color: var(--primary-green);
    cursor: default;
}

.pagination a.disabled {
    color: #aaa;
    pointer-events: none;
    background-color: #f9f9f9;
}
/* 15. Product Page Styling */
.category-block {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.category-block:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.category-block h2 {
    color: var(--primary-green);
    border-left: 4px solid var(--primary-green);
    padding-left: 1rem;
    margin-bottom: 1.5rem;
}

.product-list {
    list-style-type: none; /* Removes default bullets */
    padding-left: 0;
}

.product-list li {
    background-color: var(--light-green-bg);
    padding: 12px 18px;
    margin-bottom: 8px;
    border-radius: 5px;
    border-left: 3px solid var(--primary-green);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-list li:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}