/* --- PREMIUM LIBRARY THEME --- */
:root {
    --lib-bg: #050505;
    --lib-card: #0f0f0f;
    --lib-accent: #4facfe;
    --lib-gold: #ffca28;
    --lib-border: rgba(255, 255, 255, 0.05);
    --lib-text-dim: #a0a0a0;
}

body.library-page {
    background: var(--lib-bg);
    color: #fff;
    font-family: 'Inter', sans-serif;
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
}

/* --- NAVIGATION --- */
#main-nav {
    height: 70px;
    padding: 0 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--lib-border);
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(15px);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.back-btn {
    color: var(--lib-accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: 0.3s ease;
}

.nav-title { font-weight: 800; text-transform: uppercase; letter-spacing: 2px; font-size: 0.9rem; }
.nav-right-meta { font-size: 0.75rem; color: rgba(255, 255, 255, 0.4); }

/* --- MAIN LAYOUT --- */
.library-container {
    padding: 60px 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.gateway-header {
    text-align: center;
    margin-bottom: 50px;
}

/* --- TILES GRID --- */
.tiles-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 25px;
    width: 100%;
}

.premium-tile {
    background: var(--lib-card);
    border: 1px solid var(--lib-border);
    padding: 0 0 40px 0; /* No top padding to allow banner to flush */
    border-radius: 30px;
    text-align: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
}

.premium-tile:hover {
    transform: translateY(-12px);
    border-color: var(--lib-accent);
    background: #141414;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

/* --- BANNER SYSTEM --- */
.tile-banner {
    width: 100%;
    height: 120px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0 0 25px 25px;
    transition: 0.4s ease;
}

.tile-banner i {
    font-size: 2.5rem !important;
    color: #fff !important;
}

.premium-tile:hover .tile-banner {
    height: 140px;
}

/* --- TILE TEXT & DECOR --- */
.premium-tile h3 {
    font-size: 1.5rem;
    margin: 10px 0 5px 0;
    font-weight: 700;
}

.premium-tile span {
    font-size: 0.85rem;
    color: var(--lib-text-dim);
}

.tile-bg-num {
    position: absolute;
    bottom: 10px;
    right: 20px;
    font-size: 5rem;
    font-weight: 900;
    opacity: 0.03;
    pointer-events: none;
    transition: 0.3s;
}

.premium-tile:hover .tile-bg-num {
    opacity: 0.08;
    color: var(--lib-accent);
}

/* --- SEMESTER COLOR THEMES --- */
.s1-bg { background: linear-gradient(45deg, #2c3e50, #4ca1af); }
.s2-bg { background: linear-gradient(45deg, #1e3c72, #2a5298); }
.s3-bg { background: linear-gradient(45deg, #6a11cb, #2575fc); }
.s4-bg { background: linear-gradient(45deg, #00b09b, #96c93d); }
.s5-bg { background: linear-gradient(45deg, #434343, #000000); }
.s6-bg { background: linear-gradient(45deg, #f2994a, #f2c94c); } 
.s7-bg { background: linear-gradient(45deg, #8e2de2, #4a00e0); }
.s8-bg { background: linear-gradient(45deg, #000428, #004e92); }
.res-bg { background: linear-gradient(45deg, #ff512f, #dd2476); }

/* --- GOLD HIGHLIGHT (SEM 6 & SPECIALIZED) --- */
.premium-tile.sem-highlight:hover,
.premium-tile.specialized:hover {
    border-color: var(--lib-gold);
    box-shadow: 0 0 35px rgba(255, 202, 40, 0.15);
}

.premium-tile.sem-highlight:hover .tile-bg-num,
.premium-tile.specialized:hover .tile-bg-num {
    color: var(--lib-gold);
}

/* --- FILE LIST VIEW --- */
.view-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 40px;
}

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

.book-card {
    background: var(--lib-card);
    border: 1px solid var(--lib-border);
    border-radius: 25px;
    padding: 20px;
    transition: 0.4s;
}

.cover {
    height: 250px;
    border-radius: 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.book-card:hover .cover {
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.book-card:hover .cover i {
    color: rgba(255,255,255,0.8) !important;
    transform: scale(1.1);
    transition: 0.4s;
}
.tile-banner, 
.tile-bg-num, 
.tile-banner i, 
.premium-tile h3, 
.premium-tile span {
    pointer-events: none; /* This ensures the click always goes to the parent .premium-tile */
}
/* --- ENHANCED CARD UI --- */
.book-card {
    background: rgba(15, 15, 15, 0.7);
    backdrop-filter: blur(10px); /* Glassmorphism effect */
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 16px;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    overflow: hidden;
}

.book-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: var(--lib-accent);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

/* --- DYNAMIC COVERS --- */
.cover {
    height: 220px;
    border-radius: 18px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.2);
}

/* Glossy Overlay for Covers */
.cover::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(225deg, rgba(255,255,255,0.1) 0%, transparent 50%);
    pointer-events: none;
}

/* --- TYPOGRAPHY & TAGS --- */
.sem-tag {
    background: rgba(79, 172, 254, 0.1);
    color: var(--lib-accent);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    display: inline-block;
}

.book-card h4 {
    font-size: 1.1rem;
    line-height: 1.4;
    margin: 10px 0 15px 0;
    font-weight: 600;
    color: #efefef;
}