/*
 * screenshots.css
 * Styles for the Screenshots Page (Digital Showcase).
 */

/* ------------------------------------------- */
/* --- 1. Page Header & Layout --- */
/* ------------------------------------------- */

.screenshots-body {
    background-color: var(--color-bg-dark);
    min-height: 100vh;
}

.page-header {
    text-align: center;
    margin: 40px 0 60px 0;
}

.page-title {
    font-size: 2.8em;
    color: var(--color-text-light);
    font-weight: 900;
    margin-bottom: 10px;
}

.page-title i {
    color: var(--color-accent);
    margin-right: 10px;
}

.page-subtitle {
    font-size: 1.1em;
    color: var(--color-text-subtle);
    max-width: 800px;
    margin: 0 auto;
}


/* ------------------------------------------- */
/* --- 2. Dynamic Screenshots Grid --- */
/* ------------------------------------------- */

.screenshot-grid {
    display: grid;
    gap: 20px;
    padding: 20px;
    margin-bottom: 80px;
    /* Define the grid areas for an asymmetrical, "out of box" layout */
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(2, 200px); /* 2 rows, fixed height for visual consistency */
    grid-template-areas: 
        "c1 c1 c2 c2 c3 c3"
        "c4 c4 c5 c5 c6 c6";
    
    /* Assign areas (c1-c6 match the card structure) */
    /* This allows the wide and tall classes to create the unique shape */
}

/* Base card styling */
.screenshot-card {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease-out; /* Transition for the JS hover effect */
    background-color: #21212c;
    border: 1px solid var(--color-border);
}

.screenshot-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s;
}

.screenshot-card:hover .screenshot-img {
    transform: scale(1.05);
}

/* Specific Grid Layout Classes (Desktop) */
.screenshot-grid > div:nth-child(1) { grid-area: c1; }
.screenshot-grid > div:nth-child(2) { grid-area: c2; }
.screenshot-grid > div:nth-child(3) { grid-area: c3; }
.screenshot-grid > div:nth-child(4) { grid-area: c4; }
.screenshot-grid > div:nth-child(5) { grid-area: c5; }
.screenshot-grid > div:nth-child(6) { grid-area: c6; }

/* Desktop custom spanning for an asymmetrical look */
@media (min-width: 1000px) {
    .screenshot-grid {
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: repeat(2, 300px);
        grid-template-areas: 
            "c1 c2 c2 c3"
            "c4 c5 c5 c6";
    }
    
    .screenshot-grid > div:nth-child(1) { 
        grid-area: c1;
        background-color: var(--color-accent-dim); /* Highlight 1 */
    }
    .screenshot-grid > div:nth-child(2) { grid-area: c2; } /* Wide */
    .screenshot-grid > div:nth-child(3) { grid-area: c3; }
    .screenshot-grid > div:nth-child(4) { grid-area: c4; } /* Tall */
    .screenshot-grid > div:nth-child(5) { grid-area: c5; } /* Wide */
    .screenshot-grid > div:nth-child(6) { 
        grid-area: c6; 
        background-color: var(--color-accent-dim); /* Highlight 2 */
    }
}


/* --- Card Overlay Effects --- */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.4s;
}

.screenshot-card:hover .overlay {
    opacity: 1;
}

.label {
    font-size: 1.2em;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 0 5px var(--color-accent);
}

.view-icon {
    font-size: 2em;
    color: var(--color-accent);
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.4s ease-in-out;
}

.screenshot-card:hover .view-icon {
    transform: translateY(0);
    opacity: 1;
}


/* ------------------------------------------- */
/* --- 3. Lightbox Modal --- */
/* ------------------------------------------- */

.lightbox {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.95);
    justify-content: center;
    align-items: center;
}

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90%;
    border-radius: 5px;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.lightbox-content.fade-in {
    opacity: 1;
}

.caption {
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    font-size: 1.2em;
    position: absolute;
    bottom: 5%;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 40px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    text-shadow: 0 0 10px var(--color-accent);
}

.close-btn:hover,
.close-btn:focus {
    color: var(--color-accent);
    text-decoration: none;
}


/* ------------------------------------------- */
/* --- 4. RESPONSIVENESS (Mobile) --- */
/* ------------------------------------------- */

@media (max-width: 768px) {
    .page-title {
        font-size: 2.2em;
    }
    
    .page-subtitle {
        font-size: 1em;
    }

    /* Collapse the dynamic grid into two columns for better phone viewing */
    .screenshot-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: repeat(3, 180px); /* 3 rows of 2 cards each */
        gap: 15px;
        padding: 10px;
        /* Reset grid areas for simple flow */
        grid-template-areas: unset; 
    }
    
    /* Remove specific grid area assignments for linear flow */
    .screenshot-grid > div {
        grid-area: unset !important;
    }
    
    /* Reduce hover effect complexity for performance on mobile */
    .screenshot-card:hover .screenshot-img {
        transform: scale(1.02);
    }
    
    /* Disable JS 3D Transform for mobile performance */
    .screenshot-card {
        transition: transform 0.3s;
        /* Remove 3D transform on hover on small screens */
        transform: none !important; 
    }
    
    .overlay {
        /* Keep overlay subtle or use slightly darker background */
        background: rgba(0, 0, 0, 0.8);
    }
    
    .label {
        font-size: 1em;
    }
    .view-icon {
        font-size: 1.5em;
    }

    .close-btn {
        right: 20px;
        top: 10px;
        font-size: 30px;
    }

    /* Hide nav links on mobile */
    .nav-links {
        display: none;
    }
}