/* ==========================================================================
   PERPUSTAKAAN SMAN 1 TAMBELAN - Modern Custom Stylesheet
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Cinzel:wght@600;700&display=swap');

:root {
    --primary: #0f766e;
    --primary-dark: #115e59;
    --primary-light: #14b8a6;
    --secondary: #1e293b;
    --accent: #f59e0b;
    --accent-hover: #d97706;
    --dark-bg: #0f172a;
    --light-bg: #f8fafc;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #1e293b;
    --text-muted: #64748b;
    --sidebar-width: 260px;
    --header-height: 70px;
    --transition: all 0.25s ease-in-out;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--light-bg);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Typography Headings */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.hero-section h1, .hero-section h2, .hero-section h3, .hero-section h4, .hero-section h5, .hero-section h6,
.reader-spotlight-card h1, .reader-spotlight-card h2, .reader-spotlight-card h3, .reader-spotlight-card h4, .reader-spotlight-card h5, .reader-spotlight-card h6,
.text-white h1, .text-white h2, .text-white h3, .text-white h4, .text-white h5, .text-white h6 {
    color: #ffffff !important;
}

.school-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Sticky Header */
.main-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
    height: var(--header-height);
}

.main-header.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.nav-link {
    font-weight: 600;
    color: #334155 !important;
    padding: 0.5rem 0.9rem !important;
    border-radius: 8px;
    transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
    color: var(--primary) !important;
    background-color: rgba(15, 118, 110, 0.08);
}

/* Hero Section */
.hero-section {
    position: relative;
    background: linear-gradient(135deg, #091e2b 0%, #0f3d4a 60%, #0d9488 100%);
    color: #ffffff;
    padding: 90px 0 100px;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: 0.5;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fef08a;
    backdrop-filter: blur(6px);
}

.hero-title {
    font-size: 2.75rem;
    font-weight: 800;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: #e2e8f0;
    max-width: 650px;
}

/* Search Box Container */
.search-container {
    background: #ffffff;
    border-radius: 16px;
    padding: 12px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.12);
    border: 1px solid var(--border-color);
}

.search-input-lg {
    border: none;
    font-size: 1.05rem;
    font-weight: 500;
    padding: 12px 16px;
}

.search-input-lg:focus {
    box-shadow: none;
    outline: none;
}

/* Cards & Badges */
.card-modern {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    transition: var(--transition);
    overflow: hidden;
}

.card-modern:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
}

.book-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.book-cover-wrap {
    position: relative;
    width: 100%;
    height: 240px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.book-cover-img {
    max-height: 100%;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.book-card:hover .book-cover-img {
    transform: scale(1.05);
}

.badge-ebook {
    background-color: #0284c7;
    color: #fff;
    font-weight: 600;
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 6px;
}

.badge-fisik {
    background-color: #059669;
    color: #fff;
    font-weight: 600;
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 6px;
}

.badge-both {
    background-color: #7c3aed;
    color: #fff;
    font-weight: 600;
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 6px;
}

/* Reader of the month */
.reader-spotlight-card {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #ffffff;
    border-radius: 20px;
    border: 2px solid #f59e0b;
    position: relative;
    overflow: hidden;
}

.reader-spotlight-card::before {
    content: '👑';
    position: absolute;
    right: -20px;
    bottom: -20px;
    font-size: 140px;
    opacity: 0.06;
}

/* Running Text (Marquee Bar) */
.running-text-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #0f172a;
    color: #f1f5f9;
    padding: 10px 0;
    z-index: 1030;
    border-top: 2px solid var(--accent);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.2);
}

.running-text-label {
    background: var(--accent);
    color: #000;
    font-weight: 800;
    font-size: 0.75rem;
    padding: 4px 12px;
    border-radius: 4px;
    margin-right: 15px;
    white-space: nowrap;
    text-transform: uppercase;
}

.marquee-content {
    white-space: nowrap;
    overflow: hidden;
    display: inline-block;
    width: 100%;
}

.marquee-inner {
    display: inline-block;
    padding-left: 100%;
    animation: marquee 30s linear infinite;
}

@keyframes marquee {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-100%, 0); }
}

/* Admin Dashboard Layout */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: var(--sidebar-width);
    background: #0f172a;
    color: #94a3b8;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    overflow-y: auto;
    z-index: 1020;
    transition: var(--transition);
}

.admin-sidebar .sidebar-brand {
    padding: 22px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-sidebar .sidebar-menu {
    padding: 16px 10px;
    list-style: none;
    margin: 0;
}

.sidebar-heading {
    font-size: 0.72rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #64748b;
    padding: 14px 16px 6px;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #94a3b8;
    padding: 10px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.92rem;
    transition: var(--transition);
    margin-bottom: 3px;
}

.sidebar-menu li a:hover,
.sidebar-menu li.active a {
    color: #ffffff;
    background: rgba(15, 118, 110, 0.4);
}

.sidebar-menu li.active a {
    background: var(--primary);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(15, 118, 110, 0.35);
}

.admin-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    transition: var(--transition);
    padding-bottom: 50px;
}

.admin-topbar {
    height: 70px;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 1010;
}

.stat-card {
    border-radius: 16px;
    border: 1px solid var(--border-color);
    background: #ffffff;
    padding: 20px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

a.stat-card {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

a.stat-card:hover {
    color: inherit;
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 12px 25px rgba(15, 118, 110, 0.15);
}

a.stat-card:hover .stat-icon {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

/* Timeline Feed */
.activity-feed {
    list-style: none;
    padding-left: 20px;
    position: relative;
}

.activity-feed::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 6px;
    bottom: 0;
    width: 2px;
    background: #e2e8f0;
}

.activity-feed-item {
    position: relative;
    padding-bottom: 18px;
    padding-left: 16px;
}

.activity-feed-item::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid #ffffff;
}

/* Camera Scanner Container */
.scanner-viewport {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    border: 2px dashed var(--primary);
    background: #0f172a;
    position: relative;
}

/* Print Styles */
@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
    }
    .no-print, .main-header, .admin-sidebar, .admin-topbar, .running-text-bar, .btn, footer {
        display: none !important;
    }
    .admin-main {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    .card-modern, .stat-card {
        border: 1px solid #ccc !important;
        box-shadow: none !important;
    }
}

/* Running Text Safe Spacing */
body.has-running-text {
    padding-bottom: 55px;
}

/* Mobile Sidebar Backdrop */
.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 1040;
    display: none;
    opacity: 0;
    transition: opacity 0.25s ease-in-out;
}

.sidebar-backdrop.show {
    display: block;
    opacity: 1;
}

/* Offcanvas Mobile Navigation Drawer */
.offcanvas-mobile-nav {
    width: 300px !important;
    background-color: #0f172a !important;
    color: #f1f5f9;
    border-right: 2px solid var(--primary);
}

.offcanvas-mobile-nav .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

.offcanvas-mobile-nav .nav-link {
    color: #cbd5e1 !important;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 10px 14px !important;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
}

.offcanvas-mobile-nav .nav-link:hover,
.offcanvas-mobile-nav .nav-link.active {
    background: rgba(15, 118, 110, 0.4);
    color: #ffffff !important;
}

/* ==========================================================================
   Breakpoints: Mobile & Tablet Responsiveness
   ========================================================================== */

/* Tablets & Small Laptops (max-width: 991.98px) */
@media (max-width: 991.98px) {
    .admin-sidebar {
        left: -100%;
        z-index: 1050;
        box-shadow: 0 0 35px rgba(0, 0, 0, 0.35);
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .admin-sidebar.show {
        left: 0;
    }
    .admin-main {
        margin-left: 0 !important;
        width: 100%;
    }
    .hero-title {
        font-size: 2.15rem;
    }
}

/* Smartphones & Small Tablets (max-width: 575.98px) */
@media (max-width: 575.98px) {
    .hero-section {
        padding: 40px 0 65px;
    }
    .hero-title {
        font-size: 1.65rem;
        line-height: 1.25;
    }
    .hero-subtitle {
        font-size: 0.9rem;
    }
    .hero-badge {
        font-size: 0.75rem;
        padding: 4px 12px;
    }
    .search-container {
        padding: 8px;
        border-radius: 12px;
    }
    .search-input-lg {
        font-size: 0.92rem;
        padding: 8px 12px;
    }
    .admin-topbar {
        padding: 0 12px;
        height: 60px;
    }
    .stat-card {
        padding: 14px;
        border-radius: 12px;
    }
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1.15rem;
    }
    .book-cover-wrap {
        height: 190px;
    }
    .running-text-bar {
        font-size: 0.8rem;
        padding: 6px 0;
    }
    .running-text-label {
        font-size: 0.68rem;
        padding: 3px 8px;
        margin-right: 8px;
    }
}
