/* ===================================
   CSS CUSTOM PROPERTIES (THEME COLORS)
   Muted, professional color palette
   ==================================== */


:root {
    /* Light Mode Colors - Muted & Professional */
    --bg-primary: #dde7f1;
    --bg-secondary: #dcf1f79f;
    --bg-tertiary: #d4dde6;
    
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    
    --accent-primary: #16a085;      /* Professional Emerald */
    --accent-secondary: #1abc9c;    /* Brighter Teal */
    --accent-hover: #138d75;        /* Darker Emerald */
    
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.08);
    
    --success: #48bb78;
    --warning: #ed8936;
    --info: #4299e1;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;
    --spacing-3xl: 5rem; /* Added for more flexibility */
    
    /* Typography */
    --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'Courier New', monospace;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-medium: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Dark Mode Colors - Smooth & Easy on Eyes */
[data-theme="dark"] {
    --bg-primary: #1a202c;
    --bg-secondary: #2d3748;
    --bg-tertiary: #4a5568;
    
    --text-primary: #f7fafc;
    --text-secondary: #e2e8f0;
    --text-muted: #a0aec0;
    
    --accent-primary: #1abc9c;      /* Brighter Teal for dark mode */
    --accent-secondary: #48c9b0;    /* Even Lighter Teal */
    --accent-hover: #16a085;        /* Original Emerald for hover */
    
    --border-color: #4a5568;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
}

/* ===================================
   GLOBAL STYLES
   ==================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color var(--transition-medium), color var(--transition-medium);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* Animated Background */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden; /* This correctly contains the shapes without affecting the body */
    pointer-events: none;
}

.floating-shape {
    position: absolute;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    opacity: 0.05;
    border-radius: 50%;
    animation: float 20s infinite ease-in-out;
}

.shape-1 { width: 400px; height: 400px; top: -100px; right: -100px; animation-delay: 0s; }
.shape-2 { width: 300px; height: 300px; bottom: -50px; left: -50px; animation-delay: 7s; }
.shape-3 { width: 500px; height: 500px; top: 50%; left: 50%; transform: translate(-50%, -50%); animation-delay: 14s; }

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(120deg); }
    66% { transform: translate(-20px, 20px) rotate(240deg); }
}

/* ===================================
   NAVIGATION
   ==================================== */

.navbar {
    /* --- Core Sticky Properties --- */
    position: -webkit-sticky; /* For Safari compatibility */
    position: sticky;
    top: 0;
    left: 0;
    width: 100%; /* Explicitly set the width */
    z-index: 1000;

    /* --- Your Glass Effect Style --- */
    background: rgba(45, 55, 72, 0.8); 
    backdrop-filter: blur(10px);        
    -webkit-backdrop-filter: blur(10px); 
    border-bottom: 1px solid rgba(74, 85, 104, 0.5); 
    
    /* General Styling */
    transition: background-color var(--transition-medium);
}

/* Adjust the glass effect for light mode */
[data-theme="light"] .navbar {
    background: rgba(255, 255, 255, 0.8); /* Light semi-transparent background */
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-sm) var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo a {
    font-size: 1.5rem;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.logo-text {
    font-weight: 700;
    color: var(--text-primary);
}

.logo-accent {
    font-weight: 400;
    color: var(--accent-primary);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: var(--spacing-lg);
    align-items: center;
}

.nav-menu a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
    position: relative;
    padding-bottom: 8px;
}

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

.nav-menu a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--accent-primary);
    border-radius: 2px;
}

/* --- HAMBURGER ICON (NEW) --- */
/* This is hidden by default on desktop screens */
.hamburger {
    display: none;
    cursor: pointer;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: var(--text-primary);
    transition: all 0.3s ease-in-out;
}


/* ===================================
   THEME TOGGLE
   ==================================== */

.theme-toggle {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 50%; 
    width: 44px;
    height: 44px;
    position: relative; 
    cursor: pointer;
    margin-left: var(--spacing-md);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all var(--transition-fast);
}

.theme-toggle:hover {
    background-color: var(--border-color);
    border-color: var(--accent-primary);
    transform: translateY(-2px) rotate(15deg);
    box-shadow: var(--shadow-md);
}

.sun-icon,
.moon-icon {
    position: absolute;
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    transition: all var(--transition-medium);
}

[data-theme="light"] .sun-icon { opacity: 1; transform: rotate(0deg) scale(1); }
[data-theme="light"] .moon-icon { opacity: 0; transform: rotate(90deg) scale(0); }
[data-theme="dark"] .sun-icon { opacity: 0; transform: rotate(-90deg) scale(0); }
[data-theme="dark"] .moon-icon { opacity: 1; transform: rotate(0deg) scale(1); }


/* ==========================================================================
   ==                PROJECT DETAIL PAGE STYLES START HERE                 ==
   ========================================================================== */

/* --- (All your project detail styles are correct and unchanged) --- */
.project-detail-container { max-width: 1200px; margin: 0 auto; padding: var(--spacing-xl) var(--spacing-lg); animation: fadeIn 0.6s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.project-hero { background-color: var(--bg-secondary); padding: var(--spacing-3xl) var(--spacing-lg); text-align: center; border-bottom: 1px solid var(--border-color); margin-bottom: var(--spacing-2xl); }
.project-hero-content { max-width: 800px; margin: 0 auto; }
.project-title-large { font-size: clamp(2.5rem, 5vw, 3.5rem); color: var(--text-primary); margin: 0.5rem 0; line-height: 1.1; }
.project-subtitle-large { font-size: clamp(1.1rem, 2.5vw, 1.3rem); color: var(--text-secondary); font-weight: 400; margin-bottom: var(--spacing-md); }
.project-tags .tag { background: hsla(from var(--accent-primary) h s l / 0.1); color: var(--accent-primary); font-size: .85rem; padding: .4rem .8rem; border-radius: 50px; font-weight: 600; margin: 0 0.25rem; }

.project-main-image {
     width: 60%;
     border-radius: 16px; 
     overflow: hidden; 
     margin-bottom: var(--spacing-2xl); 
     box-shadow: var(--shadow-md); 
     border: 1px solid var(--border-color);
     max-width: 60%; 

     /* --- CENTERING --- */
  /* Use auto margins to center the container horizontally */
  margin-left: auto;
  margin-right: auto;

}

.project-main-image img { 
    width: 100%;
    height: auto; 
    display: block; 
}

.project-layout { display: grid; grid-template-columns: 2.5fr 1fr; gap: var(--spacing-2xl); align-items: flex-start; }
.content-card { background: var(--bg-secondary); border-radius: 16px; padding: var(--spacing-xl); border: 1px solid var(--border-color); margin-bottom: var(--spacing-xl); box-shadow: var(--shadow-md); text-align: center; }
.project-main-content h2 { font-size: 1.6rem; color: var(--text-primary); margin-bottom: var(--spacing-md); border-bottom: none; position: relative; padding-bottom: var(--spacing-md); display: inline-block; }
.project-main-content h2::after { content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 80px; height: 3px; background: var(--accent-primary); border-radius: 2px; }
.project-main-content p, .responsibilities-list { text-align: left; max-width: 720px; margin-left: auto; margin-right: auto; color: var(--text-secondary); line-height: 1.8; font-size: 1.05rem; margin-bottom: 1rem; }

.visual-placeholder { 
    width: 50%; 
    min-height: 350px; 
    background-color: var(--bg-tertiary); 
    background-image: linear-gradient(var(--border-color) 1px, transparent 1px), linear-gradient(to right, var(--border-color) 1px, var(--bg-tertiary) 1px); 
    background-size: 20px 20px; 
    border-radius: 12px; 
    border: 1px solid var(--border-color); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    margin: var(--spacing-lg) auto 0 auto; 
}

/* ==============================================
   CSS FOR THE NEW TWO-COLUMN ANALYSIS GRID
   ============================================== */

/* --- Introduction paragraph for the section --- */
.section-intro {
    text-align: center;
    color: var(--text-secondary);
    max-width: 70ch; /* Limits line length for readability */
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 2rem;
}

/* --- Container for each text + image block --- */
.analysis-feature-block {
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
}
.analysis-feature-block:first-of-type {
    padding-top: 1rem;
}

/* --- The centered text block --- */
.analysis-text-featured {
    text-align: center;
    max-width: 80ch; /* A bit wider for paragraphs */
    margin: 0 auto 1.5rem auto; /* Center the text block */
}

.analysis-text-featured h4 {
    font-size: 1.25rem;
    color: var(--accent-primary, var(--accent-color));
    margin-top: 0;
    margin-bottom: 1rem;
}

.analysis-text-featured p {
    text-align: justify; /* Keep paragraph text justified for a clean look */
    hyphens: auto;
    line-height: 1.7;
}

/* --- The larger, featured image --- */
.analysis-visual-featured {
    /* Set a large width, but not 100%, and center it */
    max-width: 85%; /* <<< You can adjust this value! */
    margin: 0 auto;
    
    /* Your existing styles for the interactive zoom effect */
    position: relative;
    cursor: pointer;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.analysis-visual-featured img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.analysis-visual-featured:hover img {
    transform: scale(1.02); /* A more subtle zoom effect */
}

/* Your .image-zoom-wrapper::after styles for the magnifying glass icon remain the same */
.image-zoom-wrapper::after {
    content: '🔍';
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.5rem;
    color: white;
    background-color: rgba(0, 0, 0, 0.5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.image-zoom-wrapper:hover::after {
    opacity: 1;
}

/* --- The main lightbox overlay --- */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    display: none; /* << CRUCIAL: This hides it by default */
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

/* --- THE RESPONSIVE MAGIC --- */
/* This media query activates only on screens 992px or wider (desktops) */
@media (min-width: 992px) {
  .analysis-grid {
    /* Switch to a two-column layout */
    grid-template-columns: repeat(2, 1fr);
    
    /* Make the gap slightly larger on big screens */
    gap: 3rem;
  }
  
  /* Reverse the order for every second grid block for visual variety */
  .analysis-grid:nth-of-type(odd) .analysis-visual {
    order: 2; /* Puts the image on the right for the 2nd and 4th block */
  }
}

.placeholder-text { background: var(--bg-secondary); padding: 0.5rem 1.5rem; border-radius: 8px; color: var(--text-muted); font-weight: 500; border: 1px solid var(--border-color); }
.responsibilities-list { list-style: none; padding-left: 0; margin-top: var(--spacing-md); }
.responsibilities-list li { padding-left: 1.5rem; position: relative; margin-bottom: 0.5rem; }
.responsibilities-list li::before { content: '✓'; position: absolute; left: 0; color: var(--accent-primary); font-weight: bold; }
.project-gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--spacing-md); margin-top: var(--spacing-lg); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; border: 1px solid var(--border-color); transition: transform var(--transition-medium), box-shadow var(--transition-medium); }
.gallery-item img:hover { transform: scale(1.03); box-shadow: var(--shadow-lg); }

/* ==============================================
   NEW CSS FOR THE UPGRADED SIDEBAR 
   (Uses your existing CSS variables for a perfect match)
   ============================================== */

/* --- Sidebar Container & Positioning --- */
.project-sidebar {
    position: sticky;
    top: 100px; /* Adjust if needed */
    align-self: flex-start;
    text-align: left;
}

/* --- General Card Styling (Upgraded) --- */
.sidebar-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--accent-primary); /* Key visual accent */
    border-radius: 12px;
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-fast);
}
.sidebar-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1); /* Slightly stronger shadow on hover */
}
.project-sidebar h3 {
    font-size: 1.15rem; /* Standardized heading size */
    color: var(--text-primary);
    margin-top: 0;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border-color);
}

/* --- New Snapshot List Styling (Detailed & Aligned) --- */
.snapshot-list {
    list-style: none;
    padding: 0;
}
.snapshot-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    font-size: 0.95rem;
}
.snapshot-list .info-label {
    color: var(--text-secondary);
}
.snapshot-list .info-value {
    color: var(--text-primary);
    font-weight: 500;
    text-align: right;
    background: var(--bg-primary, var(--body-bg-color)); /* Fallback for bg variable */
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.9rem;
}

/* --- Tools List Styling (Cleaned Up) --- */
.tool-list {
    list-style: none;
    padding: 0;
}
.tool-list li {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--text-primary);
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
}
.tool-list .tool-icon {
    font-size: 1.2rem;
    color: var(--accent-primary);
}

/* --- New Button for Project Links --- */
.sidebar-button {
    display: block;
    width: 100%;
    text-align: center;
    background-color: var(--accent-primary);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-fast);
}
.sidebar-button:hover {
    background: var(--accent-hover);
    transform: scale(1.03);
}

/* --- Back Link (Unchanged from your file) --- */
.back-link {
    display: block;
    text-align: center;
    width: 100%;
    padding: var(--spacing-sm);
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all var(--transition-fast);
    margin-top: 2rem; /* Added margin for better spacing */
}
.back-link:hover {
    background: var(--accent-hover);
    color: white;
    border-color: var(--accent-hover);
}


/* ===================================
   FOOTER - COMPACT & PROFESSIONAL VERSION
   ==================================== */

.footer-modern {
    background: var(--bg-secondary);
    padding: var(--spacing-2xl) 0 var(--spacing-md);
    border-top: 1px solid var(--border-color);
    position: relative;
}

.footer-content {
    display: grid;
    grid-template-columns: 2.5fr 1fr 1fr; 
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-xl);
    border-bottom: 1px solid var(--border-color);
}

.footer-heading {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: var(--spacing-md);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.footer-brand .footer-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.footer-brand p {
    color: var(--text-secondary);
    max-width: 350px;
    line-height: 1.7;
    font-size: 0.95rem;
}

.footer-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--accent-primary);
}

.social-icon-group {
    display: flex;
    gap: var(--spacing-sm);
}

.social-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.social-icon:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--spacing-md);
}

.footer-bottom p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.back-to-top {
    position: absolute;
    bottom: var(--spacing-lg);
    right: var(--spacing-lg);
    width: 44px;
    height: 44px;
    background: var(--accent-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition-medium);
    box-shadow: var(--shadow-md);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--accent-hover);
    transform: scale(1.1);
}

/* ===================================
   RESPONSIVE DESIGN (GLOBAL + PROJECT PAGE)
   ==================================== */

@media (max-width: 992px) {
    .project-layout { 
        grid-template-columns: 1fr; 
    }
    .project-sidebar { 
        position: static; 
        grid-row: 1;
    }

    /* --- ADD THIS FOOTER CODE --- */
    .footer-content {
        grid-template-columns: 1fr; /* Stack into a single column on tablets */
        gap: var(--spacing-xl);
        text-align: center;
    }
    .footer-brand p {
        margin: 0 auto;
    }
    .social-icon-group {
        justify-content: center;
    }
}

/* --- TABLETS AND MOBILE PHONES (THIS IS WHERE THE NEW CODE GOES) --- */
@media (max-width: 768px) {
    /* --- 1. Mobile Navigation Menu Styles --- */
    .nav-menu {
        position: fixed;
        left: -100%; /* Start off-screen */
        top: 68px; /* Position below the navbar (adjust height if your navbar changes) */
        flex-direction: column;
        background-color: var(--bg-secondary);
        width: 100%;
        height: calc(100vh - 68px); /* Full height minus navbar */
        text-align: center;
        transition: left 0.4s ease;
        gap: 20px;
        padding-top: 30px;
        z-index: 999; /* Ensure it's above other content but below the main navbar */
    }

    /* This class is added by JavaScript to slide the menu into view */
    .nav-menu.active {
        left: 0;
    }

    .nav-menu li {
        padding: 10px 0;
    }

    /* --- 2. Show the Hamburger Icon --- */
    .hamburger {
        display: block; /* Makes the hamburger icon visible */
    }

    /* --- 3. Animate Hamburger to an "X" when active --- */
    .hamburger.active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .back-to-top {
        width: 40px;
        height: 40px;
        bottom: var(--spacing-md);
        right: var(--spacing-md);
    }
}

}