/* ==========================================================================
   1. General & Body Styles
   ========================================================================== */
body {
    font-family: 'Inter', sans-serif;
    background-color: #000000;
    color: #ffffff;
    scroll-behavior: smooth;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.text-weida-green {
    color: #76C44B;
}

#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-color: #000000;
}

/* ==========================================================================
   2. Header & Navigation
   ========================================================================== */
.header-container {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background-color: #000;
    padding: 1rem 0;
}

.header-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #76C44B 0%, #000000 100%);
    clip-path: polygon(0 0, 100% 0, 100% 50%, 0% 100%);
    z-index: -1;
}

.header-logo {
    display: flex;
    align-items: center;
}

.header-logo img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.header-logo span {
    font-weight: bold;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

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

.navbar-links a {
    color: white;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    transition: color 0.3s;
}

.navbar-links a:hover {
    color: #76C44B;
}

.navbar-toggler {
    border: none;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28118, 196, 75, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.nav-link.dropdown-toggle::after {
    display: none;
}

/* ==========================================================================
   3. Page-Specific Sections
   ========================================================================== */

/* --- Home Page --- */
.home-section {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5rem 0;
    background-color: #000000;
}

.home-content {
    flex: 1;
    padding-right: 2rem;
}

.home-content .lead {
    text-align: justify;
}

.home-content h1 {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 1rem;
}

.home-image-container {
    flex: .7;
    position: relative;
    text-align: right;
}

.home-image-container img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
}

/* --- About Page --- */
#about>.card {
    background-color: #000000;
}

#about .card-header {
    background-color: #1a1a1a;
    border-bottom: 2px solid #76C44B;
}

#introduction-section .card-header h2 {
    white-space: nowrap;
    /* Prevents text from wrapping */
}

#introduction-section h5,
#our-vision-section h5,
#our-mission-section h5 {
    text-align: justify;
    font-family: Poppins, sans-serif;
}

/* --- History Timeline --- */
#our-history-section {
    position: relative;
}

.timeline-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    padding-top: 60px;
    position: relative;
}

.timeline-grid::before {
    content: '';
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #76C44B;
}

.timeline-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    padding-top: 60px;
}

.timeline-image-wrapper {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 120px;
    background-color: #000;
    border: 2px solid #76C44B;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 12px;
}

.timeline-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.timeline-content-card {
    background-color: #1a1a1a;
    padding: 1.5rem 1rem;
    border-radius: 10px;
    border: 2px solid #76C44B;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding-top: 70px;
}

.timeline-year {
    font-weight: 700;
    font-size: 1.2rem;
    color: #76C44B;
    margin-bottom: 0.5rem;
}

.timeline-text {
    font-size: 0.9rem;
    color: #ffffff;
    text-align: justify;
}

/* --- Projects Section --- */
.project-section {
    padding-top: 4rem;
    padding-bottom: 4rem;
}

#projects-section .card-header h2 {
    font-size: 2.5rem;
}

#projects-section .mb-5>h3.lead {
    color: #ffffff;
}

.project-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.project-image-wrapper {
    position: relative;
    overflow: hidden;
    width: 100%;
    padding-top: 100%;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background-color: #222222;
}

.project-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease-in-out;
}

.project-image-wrapper:hover .project-image {
    transform: scale(1.1);
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    clip-path: inherit;
}

.project-image-wrapper:hover .project-overlay {
    opacity: 1;
}

.project-overlay h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #76C44B;
}

.project-overlay p {
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.project-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.project-item img {
    width: 200px;
    height: 200px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    object-fit: fill;
}

.project-item-text h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #76C44B;
}

.project-item-text p {
    color: #ffffff;
    margin: 0;
}

/* --- Contact Page --- */
#contact .contact-container {
    display: flex;
    align-items: center;
    background-color: #000;
    border-radius: 15px;
    overflow: hidden;
}

#contact .contact-image-container {
    flex: 1 1 40%;
}

#contact .contact-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#contact .contact-details {
    flex: 1 1 60%;
    padding: 4rem;
}

#contact .contact-details h3 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 2rem;
    text-transform: uppercase;
}

.contact-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.contact-info-item h4 {
    color: #76C44B;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.contact-info-item p {
    margin: 0;
    font-size: 1.1rem;
}

.qr-codes {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.qr-codes img {
    width: 100px;
    height: 100px;
    border: 2px solid #76C44B;
    border-radius: 10px;
}

/* ==========================================================================
   4. Responsive Media Queries
   ========================================================================== */

/* --- Large Devices (Desktops, <1200px) --- */
@media (max-width: 1199.98px) {
    .timeline-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --- Medium Devices (Tablets, <992px) --- */
@media (max-width: 991.98px) {
    /* Mobile Navigation */
    .navbar-collapse {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: #000;
        padding: 1rem;
    }

    .navbar-links a,
    .navbar-links .dropdown {
        width: 100%;
        text-align: center;
    }

    /* Home Section */
    .home-section {
        flex-direction: column;
        text-align: center;
    }
    
    .home-content .lead,
    #introduction-section h5,
    #our-vision-section h5,
    #our-mission-section h5 {
        text-align: justify;
    }

    .home-content {
        padding-right: 0;
        margin-bottom: 2rem;
    }

    .home-content h1 {
        font-size: 3rem;
    }

    .home-image-container {
        text-align: center;
    }

    /* Contact Section */
    #contact .contact-container {
        flex-direction: column;
    }

    #contact .contact-details {
        padding: 2rem;
        text-align: center;
    }

    .contact-info-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .qr-codes {
        justify-content: center;
    }
}

/* --- Small Devices (Landscape Phones, <768px) --- */
@media (max-width: 767.98px) {
    .card-body.p-5 {
        padding: 2rem !important;
        /* Adjust padding for smaller screens */
    }

    /* History Timeline */
    .timeline-grid {
        grid-template-columns: 1fr;
        padding-top: 0;
    }

    .timeline-grid::before {
        top: 0;
        left: 50%;
        height: 100%;
        width: 2px;
        transform: translateX(-50%);
    }

    .timeline-item {
        padding-top: 80px;
        margin-bottom: 2rem;
    }

    /* Projects Section */
    .project-item {
        flex-direction: column;
        text-align: center;
    }
}

/* --- Extra Small Devices (Portrait Phones, <576px) --- */
@media (max-width: 575.98px) {
    .header-logo img {
        width: 60px;
        height: 60px;
    }

    .header-logo span {
        font-size: 1.2rem;
    }

    .home-content h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 400px) {
    #introduction-section .card-header h2 {
        white-space: normal;
        /* Allow title to wrap on very small screens */
    }
}