/* 
 * Royal Library - Specific UI Components Styling (Bright Regal Theme)
 */

/* ==========================================================================
   1. NAVBAR HEADER
   ========================================================================== */
.header-navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 999;
    padding: 1.25rem 0;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(180, 140, 20, 0.15);
}

.header-navbar.scrolled {
    padding: 0.75rem 0;
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid var(--border-glass);
    box-shadow: var(--shadow-md);
}

.navbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
}

.brand-logo-img {
    height: 48px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

.brand-text h1 {
    font-size: 1.25rem;
    letter-spacing: 0.02em;
    line-height: 1.1;
    color: var(--text-primary);
}

.brand-text span {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: var(--text-gold);
    display: block;
    margin-top: 2px;
    font-weight: 700;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 1.75rem;
    list-style: none;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    position: relative;
    padding: 0.4rem 0;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-gold);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--text-gold);
    transition: var(--transition);
}

.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-toggle-btn {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-gold);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.theme-toggle-btn:hover {
    background: var(--accent-gold);
    color: #ffffff;
}

.mobile-toggle {
    display: none;
    font-size: 1.5rem;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
}

/* ==========================================================================
   2. HERO SECTION & OPAC SEARCH WIDGET
   ========================================================================== */
.hero-section {
    position: relative;
    min-height: 92vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 7.5rem;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.88) 0%, rgba(248, 250, 252, 0.98) 100%), 
                url('../images/hero.png') center/cover no-repeat;
    overflow: hidden;
}

.hero-content {
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.hero-badge {
    margin-bottom: 1.25rem;
}

.hero-title {
    font-size: 3.8rem;
    margin-bottom: 1.25rem;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.hero-description {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    max-width: 750px;
    margin-left: auto;
    margin-right: auto;
}

/* OPAC Search Box */
.opac-search-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: 0 20px 40px rgba(180, 140, 20, 0.12), 0 4px 12px rgba(15, 23, 42, 0.05);
    margin-bottom: 2.5rem;
}

.opac-input-group {
    display: flex;
    gap: 0.75rem;
    position: relative;
}

.opac-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.opac-input-wrapper i {
    position: absolute;
    left: 1.25rem;
    color: var(--text-gold);
    font-size: 1.2rem;
}

.opac-input {
    width: 100%;
    padding: 1.1rem 1rem 1.1rem 3.2rem;
    background: #ffffff;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1.05rem;
    font-family: var(--font-body);
    outline: none;
    transition: var(--transition);
}

.opac-input:focus {
    border-color: var(--accent-gold);
    box-shadow: 0 0 15px rgba(180, 140, 20, 0.25);
}

.opac-filters-row {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.opac-select {
    flex: 1;
    min-width: 180px;
    padding: 0.75rem 1rem;
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: var(--font-body);
    outline: none;
    cursor: pointer;
    transition: var(--transition);
}

.opac-select:focus {
    border-color: var(--accent-gold);
}

.quick-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    margin-top: 1.5rem;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-gold);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* ==========================================================================
   3. CATALOG BOOK CARDS
   ========================================================================== */
.catalog-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.category-tabs {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 0.6rem 1.2rem;
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.tab-btn:hover, .tab-btn.active {
    background: var(--accent-gold);
    color: #ffffff;
    border-color: var(--accent-gold);
    box-shadow: 0 4px 12px rgba(180, 140, 20, 0.3);
}

.book-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid var(--border-glass);
}

.book-cover-container {
    height: 220px;
    width: 100%;
    position: relative;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    text-align: center;
    color: #ffffff;
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.book-cover-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 12px;
    height: 100%;
    background: rgba(0, 0, 0, 0.25);
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.book-cover-content {
    z-index: 2;
}

.book-cover-title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.4rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.6);
}

.book-cover-author {
    font-size: 0.85rem;
    opacity: 0.9;
    font-style: italic;
}

.book-card-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.book-meta-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.book-ddc {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    background: rgba(180, 140, 20, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    color: var(--text-gold);
    font-weight: 600;
}

.book-title {
    font-size: 1.15rem;
    margin-bottom: 0.35rem;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-author {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.book-location {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.book-card-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-subtle);
}

/* Bookmark Favorite Heart Button */
.fav-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
}

.fav-btn:hover, .fav-btn.active {
    color: #dc2626;
    transform: scale(1.15);
}

/* ==========================================================================
   4. E-BOOK & READER MODAL
   ========================================================================== */
.book-detail-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    padding: 2.5rem;
}

.reader-box {
    background: #f8fafc;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    font-family: var(--font-heading);
    font-size: 1.05rem;
    line-height: 1.8;
    max-height: 320px;
    overflow-y: auto;
    margin-top: 1rem;
    white-space: pre-line;
    color: #1e293b;
}

.citation-box {
    background: rgba(180, 140, 20, 0.08);
    border: 1px dashed var(--accent-gold);
    border-radius: var(--radius-sm);
    padding: 1rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    color: var(--text-primary);
}

/* ==========================================================================
   5. DIGITAL MEMBERSHIP CARD GENERATOR
   ========================================================================== */
.member-section {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.member-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.member-card-wrapper {
    perspective: 1000px;
}

.digital-card {
    width: 100%;
    max-width: 480px;
    height: 290px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 60%, #e2e8f0 100%);
    border: 2px solid var(--accent-gold);
    padding: 1.75rem;
    position: relative;
    box-shadow: 0 15px 35px rgba(180, 140, 20, 0.25), 0 5px 15px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    margin: 0 auto;
}

.digital-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(180, 140, 20, 0.12) 0%, transparent 60%);
    pointer-events: none;
}

.card-header-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-brand-title h3 {
    font-size: 1.1rem;
    color: var(--text-gold);
    line-height: 1;
}

.card-brand-title p {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: #64748b;
    font-weight: 700;
}

.card-chip {
    width: 40px;
    height: 30px;
    background: linear-gradient(135deg, #ffd700 0%, #b8860b 100%);
    border-radius: 6px;
}

.card-main-info {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin: 1rem 0;
}

.member-photo {
    width: 70px;
    height: 85px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--accent-gold);
    object-fit: cover;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--text-gold);
}

.member-details-text h4 {
    font-size: 1.25rem;
    color: #0f172a;
    margin-bottom: 0.2rem;
}

.member-details-text p {
    font-size: 0.85rem;
    color: var(--text-gold);
    font-family: var(--font-mono);
    font-weight: 600;
}

.member-type-badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    background: rgba(180, 140, 20, 0.15);
    border: 1px solid var(--accent-gold);
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #0f172a;
    margin-top: 0.4rem;
}

.card-footer-barcode {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid rgba(180, 140, 20, 0.3);
    padding-top: 0.75rem;
}

.qr-placeholder {
    width: 42px;
    height: 42px;
    background: #ffffff;
    padding: 3px;
    border-radius: 4px;
    border: 1px solid var(--border-subtle);
}

/* Membership Form */
.member-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-input, .form-select {
    padding: 0.85rem 1rem;
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}

.form-input:focus, .form-select:focus {
    border-color: var(--accent-gold);
    box-shadow: 0 0 10px rgba(180, 140, 20, 0.2);
}

/* ==========================================================================
   6. FLOOR DIRECTORY & SERVICES
   ========================================================================== */
.floor-card {
    padding: 1.75rem;
    position: relative;
    background: #ffffff;
}

.floor-number {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--text-gold);
    font-family: var(--font-mono);
    margin-bottom: 0.5rem;
}

.service-icon-box {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    background: rgba(180, 140, 20, 0.1);
    border: 1px solid var(--accent-gold);
    color: var(--text-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 1.25rem;
}

/* ==========================================================================
   7. FINE CALCULATOR & UTILITIES
   ========================================================================== */
.calc-card {
    background: #ffffff;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
}

.calc-result-box {
    background: #f8fafc;
    border: 1px solid var(--accent-gold);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
    margin-top: 1.5rem;
}

.calc-price {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-gold);
}

/* ==========================================================================
   8. FOOTER
   ========================================================================== */
.site-footer {
    background: #0f172a;
    border-top: 1px solid var(--border-glass);
    padding: 4rem 0 2rem 0;
    color: #94a3b8;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-brand p {
    font-size: 0.95rem;
    margin-top: 1rem;
    max-width: 320px;
    color: #94a3b8;
}

.footer-title {
    font-size: 1.1rem;
    color: #ffffff;
    margin-bottom: 1.25rem;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-links a {
    color: #94a3b8;
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--accent-gold-light);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.88rem;
    flex-wrap: wrap;
    gap: 1rem;
    color: #94a3b8;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    background: #ffffff;
    border: 1px solid var(--accent-gold);
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.15), var(--shadow-gold);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideInRight 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@media (max-width: 992px) {
    .hero-title { font-size: 2.7rem; }
    .book-detail-grid { grid-template-columns: 1fr; }
    .member-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .nav-menu { display: none; }
    .mobile-toggle { display: block; }
}

/* ==========================================================================
   9. PRINT STYLESHEET (PRINT ONLY DIGITAL MEMBER CARD)
   ========================================================================== */
@media print {
    /* Hide all layout elements */
    html, body {
        background: #ffffff !important;
        color: #000000 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    header, footer, section, .modal-overlay, .toast-container, button, .btn, .crown-divider, .section-title, .section-subtitle {
        display: none !important;
    }

    /* Display only the membership section and card pass */
    #membership {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        min-height: 100vh !important;
        padding: 0 !important;
        margin: 0 !important;
        background: #ffffff !important;
    }

    #membership .container {
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .member-grid {
        display: block !important;
    }

    .member-grid > .glass-card {
        display: none !important;
    }

    .member-card-wrapper {
        display: block !important;
        margin: 0 auto !important;
        position: absolute !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) scale(1.1) !important;
        width: 100% !important;
        max-width: 480px !important;
    }

    .digital-card {
        box-shadow: none !important;
        border: 2px solid #b48c14 !important;
        background: linear-gradient(135deg, #ffffff 0%, #f8fafc 60%, #e2e8f0 100%) !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    @page {
        size: auto;
        margin: 0;
    }
}
