/* =========================================
   1. GLOBAL VARIABLES
   ========================================= */

/* =========================================
   2. SHARED NAVIGATION STYLES
   (Used for Sectors, Projects, etc.)
   ========================================= */

/* Container for the buttons */
.subcode-nav-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 40px;
    padding-top: 4px;
}

/* The Button Style */
.subcode-nav-btn {
    border: none;
    background-color: var(--secondary);
    color: var(--text-primary);

    padding: 12px 28px;
    border-radius: 30px;
    font-size: var(--p2);
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

/* SVG Icon Styling (Forces icon to be WHITE) */
.subcode-nav-btn img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    filter: brightness(0) invert(1); 
    transition: all 0.3s ease;
}

/* Hover Effect */
.subcode-nav-btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

/* --- ACTIVE STATE --- */
.subcode-nav-btn.active {
    background-color: var(--text-primary);
    color: var(--text-dark);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* Force icon to be DARK when active */
.subcode-nav-btn.active img {
    filter: brightness(0.2); 
}

/* =========================================
   3. FEATURED PROJECT SECTION
   ========================================= */

/* Smooth Fade Transition Utility */
.fade-wrapper {
    transition: opacity 0.3s ease-in-out;
    opacity: 1;
    
}


/* =========================================
   4. PROJECT CARD COMPONENT
   ========================================= */

/* Wrapper: Creates space for floating images */
.project-component-wrapper {
    position: relative;
    padding-top: 10px; /* Space for images to float above card */
    max-width: 100%;
    margin: 0 auto;
    margin-bottom: 50px;
    background-color: var(--secondary);
    border-radius: 20px;
}
/* --- A. Floating Visuals (Collage) --- */
.project-visuals {
    position: relative; 
    width: 100%;
    border-radius: 20px 0 0 20px;
    /* 
       This Aspect Ratio creates the "Stage".
       If the screen shrinks, the stage shrinks proportionally, 
       keeping all actors (images) in their exact spots.
    */
    aspect-ratio: 4 / 3; 
    
    background: #fff;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    margin-bottom: 40px;
    z-index: 10;
    pointer-events: none;
    display: block;
    overflow: hidden; 
}

.device-img {
    position: absolute;
    display: block;
    margin: 0;
    
    /* STYLING */
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
    border: 3px solid #333;
    
    /* --- CRITICAL FOR "SCALE REDUCTION" --- */
    /* This ensures the image never stretches or squashes. */
    height: auto; 
    /* This ensures that if it does hit a limit, it shows the whole image. */
    object-fit: contain; 
    
    transition: transform 0.3s ease;
}

/* --- POSITIONING & SIZING --- */
/* 
   Since we use % for Width AND Top/Left, 
   the images will stay perfectly arranged 
   no matter how big or small the screen is.
*/

.img-desktop-back {
    width: 60%;
    top: 11%; 
    right: 5%;
    z-index: 1;
    opacity: 0.9;
}

.img-desktop-front {
    width: 55%;
    top: 35%; 
    left: 10%;
    z-index: 2;
}

.img-mobile-top {
    width: 12%;
    top: 11%;
    left: 20%;
    z-index: 3;
}

.img-mobile-bottom {
    width: 18%;
    bottom: 25%; /* Using bottom allows anchoring from the floor */
    right: 15%;
    z-index: 3;
}
/* --- B. The Card Body --- */
.project-card-body {
    /* Rounded top corners per design */
    border-radius: 40px 40px 30px 30px;
    /* Extra top padding pushes text down */
    color: var(--text-primary);
    box-shadow: 0 20px 50px rgba(141, 118, 70, 0.15);
    position: relative;

}

/* Typography */
.project-content h2 {
    font-size: var(--h3);
    font-weight: 700;
    margin-bottom: 15px;
}

.project-description {
    font-size: var(--p2);
    line-height: 1.6;
    margin-bottom: 35px;
    opacity: 0.95;
    max-width: 800px;
}

/* Technologies Section */
.tech-section h4 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 15px;
}

.tech-row {
    display: flex;
    gap: 15px;
    margin-bottom: 35px;
}
.tech-box img{
    width: 40px;
    height: 40px;
}

.tech-box {
    width: 50px;
    height: 50px;
    background-color: #ffffff;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: var(--h2-small);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: transform 0.2s;
}

.tech-box:hover { transform: translateY(-3px); }

/* Testimonial Section */
.testimonial-section {
    margin-bottom: 35px;
}

.testimonial-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.testimonial-header h4 { font-size: var(--h3); font-weight: 700; }
.stars { color: gold; font-size: 15px; align-items: center; }

.quote {
    font-size: var(--p2);
    max-width:60%;
    margin-bottom: 2px;
    display: block;
}

.author {
    font-size: var(--p2);
    opacity: 0.9;
    font-weight: 600;
}

/* View Project Button */
.btn-project-view {
    background-color: var(--text-primary);
    color: var(--primary);
    padding: 15px;
    border-radius: 50px;
    font-weight: 400;
    text-decoration: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.2s;
    position: absolute;
    right: 30px;
    bottom: 60px;
    width: fit-content;
}

.btn-project-view:hover {
    transform: translateY(-3px);
}

/* =========================================
   5. RESPONSIVE MEDIA QUERIES
   ========================================= */
@media (min-width: 800px) {
    .project-component-wrapper {
        display: grid;
        grid-template-columns: 1fr 1.2fr;
        gap: 40px;
        align-items: start;
        padding-top: 0px;
        background: var(--secondary);
    }
        .project-visuals {
            position: relative;
            grid-column: 1;
            width: 100%;
            height: 100%;
            margin-bottom: 0;
            background: #fff;
            box-shadow: 0 4px 24px rgba(0,0,0,0.08);
            display: flex;
            align-items: center;
            justify-content: center;
        }

    .project-card-body {
        grid-column: 2;
        border-radius: 40px 40px 30px 30px;
        padding: 60px 50px 60px 50px;
        margin-top: 0;
    }

}

@media (max-width: 992px) {
    
    
    .project-card-body {
        padding: 180px 30px 40px 30px;
    }
    .subcode-nav-container {
        gap: 10px;
        display: grid;
        grid-template-columns: repeat(4, minmax(auto, auto));
    }

  
}

@media (max-width: 460px) {
    .btn-project-view {
        position: static !important;
        display: block;
        margin: 24px auto 0 auto;
        right: unset;
        bottom: unset;
    }
    /* Navigation Scroll on Mobile */
    .subcode-nav-container {
        justify-content: center;
        overflow-x: auto;
        white-space: nowrap;
    }
     
    .subcode-nav-btn {
        padding: 5px 10px;
         flex-shrink: 0; 
        font-size: var(--p2);
        gap: 5px;
        }

         .subcode-nav-btn img{
            width: 16px;
            height: 16px;
         }

    /* Layout Adjustments */
    .project-component-wrapper { 
        padding-top: 0;
        margin-bottom: 4vh;
        max-width: 95%;
    }
    
    .project-card-body { 
        padding: clamp(16px, 4vw, 24px);  
    }
    
    /* Optimized image container for small phones using vw */
    .project-visuals {
        position: relative;
        width: 100%;
        height: clamp(180px, 50vw, 260px);
        margin-bottom: 3vh;
        display: flex;
        justify-content: center;
        align-items: center;
        background: #fff;
        box-shadow: 0 2px 8px rgba(0,0,0,0.06);
        border-radius: 12px;
        overflow: hidden;
    }
    
    .project-visuals img {
        margin-top: 0;
    }
    
    /* Hide all images by default */
    .device-img {
        opacity: 0;
        transition: opacity 0.6s ease-in-out;
    }
    
    /* Carousel animation - cycle through images */
    .img-desktop-back {
        animation: slideCarousel 12s infinite;
        width: 90%;
        height: 90%;
        top: 5%;
        right: 5%;
        z-index: 1;
    }

    .img-desktop-front {
        animation: slideCarousel 12s infinite 3s;
        width: 90%;
        height: 90%;
        top: 5%;
        left: 5%;
        z-index: 2;
    }

    .img-mobile-top {
        animation: slideCarousel 12s infinite 6s;
        width: 85%;
        height: 85%;
        top: 7.5%;
        left: 7.5%;
        z-index: 3;
    }

    .img-mobile-bottom {
        animation: slideCarousel 12s infinite 9s;
        width: 85%;
        height: 85%;
        bottom: 7.5%;
        right: 7.5%;
        z-index: 3;
    }

    @keyframes slideCarousel {
        0% {
            opacity: 0;
            transform: scale(0.95);
        }
        10% {
            opacity: 1;
            transform: scale(1);
        }
        25% {
            opacity: 1;
            transform: scale(1);
        }
        35% {
            opacity: 0;
            transform: scale(0.95);
        }
        100% {
            opacity: 0;
            transform: scale(0.95);
        }
    }

    .project-content h2 { 
        font-size: clamp(18px, 5.5vw, 24px);
        margin-bottom: 2vh;
    }
    
    .project-description {
        font-size: clamp(13px, 3.5vw, 16px);
        margin-bottom: 3vh;
        line-height: 1.5;
    }
    
    .tech-section h4 {
        font-size: clamp(14px, 4vw, 18px);
        margin-bottom: 2vh;
    }
    
    .tech-row {
        gap: clamp(8px, 2vw, 12px);
        margin-bottom: 3vh;
        flex-wrap: wrap;
    }
    
    .tech-box {
        width: clamp(38px, 10vw, 50px);
        height: clamp(38px, 10vw, 50px);
        min-width: 38px;
    }
    
    .tech-box img {
        width: clamp(18px, 5vw, 25px);
        height: clamp(18px, 5vw, 25px);
    }
}