/* filename: styles/styles.css */

/* 1. VARIABLES & RESET */
:root {
    --bg-body: #f8f9fa;
    --bg-nav: #333333;
    --text-main: #333333;
    --text-nav: #ffffff;
    --primary-blue: #007bff;
    --card-border: #e0e0e0;
    --project-accent: #28a745;
    --nav-height: 60px;
    --max-width: 1200px;
    
    /* Category Colors */
    --cat-projects: #ff00ff;
    --cat-games: #007bff;
    --cat-blogs: #28a745;
    --cat-collections: #ffc107;
    --cat-pcbs: #00ffff;
    --status-gray: #888888;
}

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

body { 
    font-family: 'Segoe UI', Tahoma, sans-serif; 
    background-color: var(--bg-body); 
    color: var(--text-main); 
    line-height: 1.6; 
    min-height: 100vh; 
    display: flex; 
    flex-direction: column; 
}

/* 2. NAVBAR & GLOBAL LAYOUT */
.navbar { 
    background-color: var(--bg-nav); 
    color: var(--text-nav); 
    height: var(--nav-height); 
    position: sticky; 
    top: 0; 
    z-index: 1000; 
}

.nav-container { 
    max-width: var(--max-width); 
    margin: 0 auto; 
    padding: 0 1rem; 
    height: 100%; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}

.logo { font-size: 1.5rem; font-weight: bold; color: white; text-decoration: none; }
.nav-menu { display: flex; gap: 1.5rem; list-style: none; }
.nav-link { color: white; text-decoration: none; transition: color 0.2s; }
.nav-link:hover { color: var(--primary-blue); }

.main-content { 
    flex: 1; 
    max-width: var(--max-width); 
    margin: 2rem auto; 
    padding: 0 1rem; 
    width: 100%; 
    position: relative;
    z-index: 1;
}

/* 3. FRONT PAGE: HERO, SEARCH & FILTERS */
.hero-section { text-align: center; margin-bottom: 3rem; }
.hero-section h1 { font-size: 2.5rem; margin-bottom: 1rem; }

.controls-container { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 2rem; 
    margin-bottom: 3rem; 
    width: 100%; 
}

.search-bar { 
    width: 100%; 
    max-width: 600px; 
    display: flex; 
    justify-content: center; 
}

.search-bar input { 
    width: 100%; 
    padding: 1rem 1.5rem; 
    font-size: 1.2rem; 
    border: 2px solid var(--card-border); 
    border-radius: 30px; 
    outline: none; 
    transition: all 0.3s ease;
}

.search-bar input:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.2);
}

.filter-tabs { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 10px; 
    justify-content: center; 
}

.tab-btn { 
    padding: 0.6rem 1.2rem; 
    border: 1px solid var(--card-border); 
    background: white; 
    cursor: pointer; 
    border-radius: 20px; 
    font-weight: 500;
    transition: 0.3s;
}

.tab-btn.active { 
    background: var(--primary-blue); 
    color: white; 
    border-color: var(--primary-blue);
}

/* 4. GRID & CARDS */
.grid-container { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); 
    gap: 1.5rem; 
}

.card { 
    border: 1px solid var(--card-border); 
    border-radius: 8px; 
    background: #fff; 
    overflow: hidden; 
    display: flex; 
    flex-direction: column; 
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.card:hover { transform: translateY(-5px); box-shadow: 0 5px 15px rgba(0,0,0,0.1); }

.card-image-placeholder { 
    width: 100%; 
    aspect-ratio: 3/2; 
    background: #eee; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-weight: bold; 
    color: #999; 
}

.card-content { padding: 1.2rem; flex-grow: 1; display: flex; flex-direction: column; }
.card-title { margin-bottom: 0.5rem; font-size: 1.25rem; }
.card-text { font-size: 0.95rem; color: #555; margin-bottom: 1.5rem; }

.card-slideshow-container {
    position: relative;
    width: 100%;
    aspect-ratio: 3/2;
    background: #eee;
}

.card-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    object-fit: cover;
}

.card-slide.active {
    opacity: 1;
}

.card-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.6); 
    color: white;
    padding: 5px 10px;
    font-size: 0.75rem;
    text-align: center;
    pointer-events: none; 
}

.btn-card { 
    align-self: flex-start; 
    padding: 0.5rem 1.2rem; 
    border-radius: 4px; 
    color: white; 
    text-decoration: none; 
    margin-top: auto; 
    font-weight: 600;
}

.btn-blogs { background-color: var(--cat-blogs); }
.btn-projects { background-color: var(--cat-projects); }
.btn-games { background-color: var(--cat-games); }
.btn-collections { background-color: var(--cat-collections); }
.btn-pcbs { background-color: var(--cat-pcbs); }

/* 5. PROJECT DETAIL & TIMELINE */
.project-detail-container { 
    max-width: 900px; 
    margin: 0 auto; 
    background: white; 
    padding: 2rem; 
    border-radius: 12px; 
}

.project-hero { text-align: center; margin-bottom: 3rem; border-bottom: 2px solid #eee; padding-bottom: 2rem; }

.timeline-container { position: relative; padding: 2rem 0; }

.timeline-container::after { 
    content: ''; 
    position: absolute; 
    width: 4px; 
    background: #eee; 
    top: 0; 
    bottom: 0; 
    left: 50%; 
    margin-left: -2px; 
}

.timeline-item { padding: 10px 40px; position: relative; background-color: inherit; width: 50%; }
.timeline-item.left { left: 0; }
.timeline-item.right { left: 50%; }

.timeline-item::after { 
    content: ''; 
    position: absolute; 
    width: 20px; 
    height: 20px; 
    right: -10px; 
    background: white; 
    border: 4px solid var(--project-accent); 
    top: 15px; 
    border-radius: 50%; 
    z-index: 1; 
}

.timeline-item.right::after { left: -10px; }

.timeline-content { 
    padding: 20px; 
    background-color: white; 
    position: relative; 
    border-radius: 8px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); 
    border: 1px solid #f0f0f0; 
}

.timeline-date { font-weight: bold; color: var(--project-accent); display: block; margin-bottom: 0.5rem; }

/* 6. SLIDESHOW & MEDIA */
.mini-slideshow { 
    position: relative; 
    width: 100%; 
    margin-top: 1.5rem; 
    background: #111; 
    border-radius: 8px; 
    overflow: hidden; 
    aspect-ratio: 16/9; 
    cursor: zoom-in; 
}

.mini-slide { display: none; width: 100%; height: 100%; }
.mini-slide.active { display: block; }
.mini-slide img { width: 100%; height: 100%; object-fit: contain; }

.slide-prev, .slide-next { 
    position: absolute; 
    top: 50%; 
    transform: translateY(-50%); 
    background: rgba(0, 0, 0, 0.6); 
    color: white; 
    border: none; 
    padding: 15px 10px; 
    cursor: pointer; 
    z-index: 10; 
    font-size: 1.5rem; 
    border-radius: 4px;
}

.slide-prev { left: 10px; }
.slide-next { right: 10px; }

.slide-counter { 
    position: absolute; 
    top: 10px; 
    right: 10px; 
    background: rgba(0, 0, 0, 0.6); 
    color: white; 
    padding: 3px 10px; 
    border-radius: 12px; 
    font-size: 0.75rem; 
}

.image-caption { 
    position: absolute; 
    bottom: 0; 
    left: 0; 
    width: 100%; 
    background: rgba(0, 0, 0, 0.75); 
    color: white; 
    padding: 12px; 
    font-size: 0.85rem; 
    text-align: center; 
}

.single-image img { cursor: zoom-in; }

/* 7. TEXT EXPANSION & UTILITIES */
.text-preview { 
    display: -webkit-box; 
    -webkit-line-clamp: 3; 
    -webkit-box-orient: vertical; 
    overflow: hidden; 
}
.text-full { display: block; }
.read-more-btn { 
    background: none; 
    border: none; 
    color: var(--primary-blue); 
    cursor: pointer; 
    padding: 5px 0; 
    font-weight: bold; 
    font-size: 0.9rem;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    margin-top: 1rem;
    border-radius: 8px;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* 8. LIGHTBOX MODAL */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.95);
    justify-content: center;
    align-items: center;
}

.modal-content {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

/* 9. FOOTER & RESPONSIVENESS */
footer { 
    text-align: center; 
    padding: 2rem; 
    background: #333; 
    color: #fff; 
    margin-top: auto; 
}

.timeline-note-box {
    background-color: #f1f1f1;
    border-left: 5px solid var(--project-accent);
    padding: 1.5rem;
    margin: 2rem auto;
    border-radius: 4px;
    max-width: 800px;
    font-style: italic;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.timeline-note-box p {
    margin: 0;
    color: #444;
}

.project-tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 2rem 0;
    border-bottom: 2px solid #eee;
    padding-bottom: 1rem;
}

.project-tabs .tab-btn {
    font-size: 1.1rem;
    padding: 0.8rem 1.5rem;
}

.project-section {
    display: none; 
    animation: fadeIn 0.3s ease;
}

.project-section.active {
    display: block; 
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.download-list {
    list-style: none;
    padding: 0;
    margin-top: 1rem;
}

.download-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border: 1px solid var(--card-border);
    padding: 1rem;
    margin-bottom: 0.8rem;
    border-radius: 6px;
    transition: background 0.2s;
}

.download-item:hover {
    background: #f9f9f9;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.file-type-badge {
    background: #eee;
    color: #666;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    min-width: 50px;
    text-align: center;
}

.file-name {
    font-weight: 500;
    color: var(--text-main);
}

.btn-download {
    background-color: var(--primary-blue);
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: bold;
}

.card { position: relative; } 

.card-category-tag {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
    color: #555;
    border: 1px solid #ddd;
    z-index: 5;
}

/* Status Button Colors */
.status-paused { background-color: #dc3545 !important; } 
.status-working { background-color: #ffc107 !important; color: #333 !important; } 
.status-active { background-color: #28a745 !important; } 
.status-coming { background-color: #6c757d !important; } 

.btn-card {
    border: none;
    transition: filter 0.2s;
}

.btn-card:hover {
    filter: brightness(90%);
}

.card-image-container {
    width: 100%;
    aspect-ratio: 3/2;
    overflow: hidden;
    background: #eee;
}

.card-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- ADDED: HOME PAGE BACKGROUND SLIDESHOW --- */
.slideshow-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; 
    overflow: hidden;
    background-color: var(--bg-body); 
}

.slideshow-background .slide {
    position: absolute;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 2s ease-in-out; 
}

.slideshow-background .slide.active { opacity: 0.15; }

/* --- ADDED: COOKIE POPUP & LIKE TOGGLE --- */
#cookie-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #333 !important;
    color: #fff !important;
    padding: 1.5rem 2rem;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    z-index: 9999; 
    text-align: center;
    width: 90%;
    max-width: 600px;
}

#cookie-banner button { 
    margin-left: 15px; 
    padding: 8px 20px; 
    cursor: pointer;
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 20px;
    font-weight: bold;
}

.btn-like.liked {
    filter: grayscale(0);
    transform: scale(1.2);
    border-color: #ff4757;
    background-color: #fff1f2;
}

@media (max-width: 768px) {
    .timeline-container::after { left: 31px; }
    .timeline-item { width: 100%; padding-left: 70px; padding-right: 25px; }
    .timeline-item.right { left: 0%; }
    .timeline-item::after { left: 21px; }
    .timeline-item.right::after { left: 21px; }
}