/* ===================================
   PROJECTS SECTION STYLES
==================================== */

/* --- HEADER & FILTERS --- */
.projects-header {
    text-align: center;
    padding: var(--spacing-2xl) 0;
}
.section-label {
    font-size: .9rem;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.section-title {
    font-size: 2.6rem;
    margin: .5rem 0 .8rem;
    font-weight: 700;
    color: var(--text-primary);
}
.projects-intro {
    max-width: 680px;
    margin: 0 auto;
    color: var(--text-secondary);
    line-height: 1.7;
}

.projects-filters {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-xl);
    flex-wrap: wrap;
}
.filter-btn {
    background: transparent;
    border: 1.5px solid var(--border-color);
    color: var(--text-secondary);
    padding: .55rem 1.3rem;
    border-radius: 50px;
    font-size: .95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .25s ease;
}
.filter-btn.active,
.filter-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #fff;
}


/* --- GRID LAYOUT (MODIFIED) --- */
.projects-grid {
    display: grid;
    /* Defaults to a single column on mobile */
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}


/* --- CLICKABLE CARD STYLING (MODIFIED) --- */

/* This is the new wrapper link for the card */
.project-card-link {
    text-decoration: none;
    color: inherit;
    display: block; /* Important for filter and layout */
    transition: transform .3s ease, box-shadow .3s ease;
}
.project-card-link:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 28px rgba(0,0,0,.1);
}

.project-card {
    background: var(--bg-secondary);
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%; /* Ensures all cards in a row have the same height */
}

/* --- IMAGE STYLING (MODIFIED) --- */
.project-image {
    height: 260px;
    overflow: hidden;
    position: relative;
}
.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}

/* Image zoom effect is now triggered by hovering the link */
.project-card-link:hover .project-image img {
    transform: scale(1.07);
}


/* --- CARD CONTENT STYLING --- */
.project-content {
    padding: var(--spacing-md);
    flex: 1;
    display: flex;
    flex-direction: column;
}
.project-title {
    font-size: 1.32rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}
.project-duration {
    font-size: .82rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 500;
}
.project-description {
    color: var(--text-secondary);
    font-size: .94rem;
    line-height: 1.5;
    margin-bottom: 8px;
    flex: 1;
}
.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: auto;
}
.tag {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: .76rem;
    padding: .28rem .68rem;
    border-radius: 5px;
    font-weight: 500;
}


/* --- RESPONSIVE LAYOUT (MODIFIED) --- */

/* On tablets and larger, switch to 2 columns */
@media (min-width: 600px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* On desktops, switch to 3 columns for the compact look */
@media (min-width: 992px) {
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width:480px) {
    .project-content {
        padding: var(--spacing-sm);
    }
}

/* ===================================
   THEME TOGGLE ICONS (CORRECTED for data-theme attribute)
==================================== */

/* Glass Effect */
.glass-effect {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);   /* ← use variable */
}

[data-theme="dark"] .glass-effect {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}


/* ===================================
   PROJECT CARD HOVER & MODAL STYLES
==================================== */

/* --- 1. Enhanced "Pop" Hover Effect --- */
.project-card-link:hover {
    /* translateY lifts the card, scale makes it slightly bigger */
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 18px 35px rgba(0, 0, 0, 0.12);
}


/* --- 2. Modal Popup Styles --- */

/* The main modal container, hidden by default */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0; /* Hidden */
    pointer-events: none; /* Not clickable when hidden */
    transition: opacity 0.3s ease;
}

/* Class added by JavaScript to show the modal */
.modal.active {
    opacity: 1;
    pointer-events: auto;
}

/* The dark background behind the modal */
.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    cursor: pointer;
}

/* The white content window */
.modal-content {
    position: relative;
    background: var(--bg-secondary);
    border-radius: 12px;
    max-width: 800px;
    width: 95%;
    max-height: 90vh; /* Limits height and makes it scrollable on small screens */
    overflow-y: auto; /* Adds scrollbar if content is too long */
    padding: var(--spacing-xl);
    z-index: 2001;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: scale(1);
}

/* The 'X' close button */
.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--bg-tertiary);
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--accent-hover);
    color: white;
    transform: rotate(90deg);
}

/* --- Styles for the content injected by JavaScript --- */
.modal-header { text-align: center; margin-bottom: var(--spacing-lg); }
.modal-title { font-size: 2rem; color: var(--text-primary); margin-bottom: 0.5rem; }
.modal-subtitle { font-size: 1rem; color: var(--accent-primary); font-weight: 500; }
.modal-section { margin-bottom: var(--spacing-lg); border-bottom: 1px solid var(--border-color); padding-bottom: var(--spacing-lg); }
.modal-section:last-child { border-bottom: none; padding-bottom: 0; }
.modal-section h3 { font-size: 1.2rem; margin-bottom: var(--spacing-md); color: var(--text-primary); }
.modal-section p { color: var(--text-secondary); line-height: 1.8; }
.tools-grid { display: grid; gap: var(--spacing-md); grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.metrics-grid { display: grid; gap: var(--spacing-md); grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.tool-item { text-align: center; }
.tool-icon { font-size: 2rem; }
.tool-name { font-size: 0.9rem; color: var(--text-secondary); }
.metric-card { background: var(--bg-tertiary); padding: var(--spacing-md); border-radius: 8px; text-align: center; }
.metric-value { font-size: 2rem; font-weight: 700; color: var(--accent-primary); }
.metric-label { font-size: 0.9rem; color: var(--text-muted); }

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

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: var(--spacing-xl);
}

.footer-brand h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.footer-brand p {
    color: var(--text-muted);
    max-width: 300px;
}

.footer-links {
    display: flex;
    gap: var(--spacing-lg);
}

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

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

.footer-bottom {
    text-align: center;
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-color);
}

.footer-bottom p {
    color: var(--text-muted);
}