:root {
    --bg: #030712;
    --glass: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
    --text-dim: #94a3b8;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: white;
    line-height: 1.6;
    overflow-x: hidden;
}

/* 1. Side Nav */
.side-nav {
    position: fixed;
    left: 0; top: 0; height: 100vh; width: 60px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-right: 1px solid var(--glass-border);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    padding-top: 20px;
}

.side-nav.expanded { width: 200px; }

.nav-item a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    text-decoration: none;
    color: var(--text-dim);
    transition: 0.2s;
    border-left: 4px solid transparent; /* Placeholder for active state */
}

/* Active Highlight */
.side-nav .nav-item.active-page a {
    background: rgba(99, 102, 241, 0.2) !important;
    border-left: 4px solid #6366f1 !important;
    color: white !important;
}

.nav-item.active-page .icon {
    filter: drop-shadow(0 0 8px #6366f1);
}

.icon { min-width: 30px; font-size: 1.2rem; }
.nav-text { margin-left: 20px; opacity: 0; transition: opacity 0.2s; white-space: nowrap; }
.side-nav.expanded .nav-text { opacity: 1; }

/* 2. Layout */
main, footer { margin-left: 60px; transition: margin-left 0.3s ease; }
.content-section { padding: 80px 20px; max-width: 1000px; margin: 0 auto; }

/* 3. Universal Cards */
.book-card, .project-card, .card {
    background: var(--glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    padding: 25px;
    border-radius: 24px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.book-card:hover, .project-card:hover, .card:hover {
    transform: translateY(-4px); 
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.project-grid, .book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

/* 4. Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.entrance-anim {
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.entrance-anim:nth-child(1) { animation-delay: 0.1s; }
.entrance-anim:nth-child(2) { animation-delay: 0.2s; }
.entrance-anim:nth-child(3) { animation-delay: 0.3s; }

/* 5. Photos & Lightbox */
.photo-gallery { column-count: 3; column-gap: 20px; }
.photo-item { margin-bottom: 20px; break-inside: avoid; }
.photo-item img { width: 100%; border-radius: 16px; transition: transform 0.3s ease; }
.photo-item img:hover { transform: scale(1.015); }

.lightbox {
    display: none; position: fixed; z-index: 10000; top: 0; left: 0; 
    width: 100%; height: 100%; background: rgba(0,0,0,0.95);
    justify-content: center; align-items: center; backdrop-filter: blur(10px);
}
.lightbox.active { display: flex; }
.lightbox img { max-width: 90%; max-height: 85%; transition: 0.3s; transform: scale(0.98); }
.lightbox.active img { transform: scale(1); }

/* 6. Mobile */
@media (max-width: 768px) {
    .side-nav {
        width: 100% !important; height: 60px !important;
        top: auto !important; bottom: 0 !important;
        left: 0 !important; flex-direction: row !important;
        justify-content: space-around; padding-top: 0; border-right: none;
        border-top: 1px solid var(--glass-border);
    }
    .nav-item.active-page a {
        border-left: none !important;
        border-top: 3px solid #6366f1 !important;
    }
    .nav-text { display: none; }
    main, footer { margin-left: 0 !important; padding-bottom: 80px; }
    .book-card:hover, .project-card:hover { transform: none !important; }
}

/* 7. Utility */
.filter-btn { background: var(--glass); border: 1px solid var(--glass-border); color: white; padding: 8px 16px; border-radius: 20px; cursor: pointer; transition: 0.2s; }
.filter-btn.active { background: #6366f1; border-color: #818cf8; }
.status-tag { font-size: 0.7rem; padding: 4px 10px; border-radius: 20px; }
.finished { background: rgba(34, 197, 94, 0.1); color: #4ade80; }
.reading { background: rgba(99, 102, 241, 0.1); color: #818cf8; }