/* 
 * Royal Library - Core Design System & Styling
 * Themes: Bright Royal Gold & Ivory Elegance (Light Theme Default)
 */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;0,900;1,400&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Fira+Code:wght@400;500;600&display=swap');

:root {
    /* Color Palette - Bright Royal Light Theme Default */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.92);
    --bg-card-hover: #ffffff;
    --bg-glass: rgba(212, 175, 55, 0.06);
    --border-glass: rgba(180, 140, 20, 0.25);
    --border-subtle: rgba(15, 23, 42, 0.08);

    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --text-gold: #b48c14;

    /* Accents */
    --accent-gold: #d4af37;
    --accent-gold-glow: rgba(212, 175, 55, 0.3);
    --accent-gold-dark: #aa7c11;
    --accent-gold-light: #fef08a;
    --accent-navy: #0b1329;
    --accent-emerald: #0d9488;
    --accent-blue: #2563eb;

    /* Status Colors */
    --status-available: #10b981;
    --status-borrowed: #d97706;
    --status-restricted: #dc2626;

    /* Shadows & Effects */
    --shadow-sm: 0 4px 6px -1px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 10px 20px -3px rgba(15, 23, 42, 0.1);
    --shadow-lg: 0 20px 30px -5px rgba(15, 23, 42, 0.12);
    --shadow-gold: 0 10px 30px -5px rgba(180, 140, 20, 0.2);

    /* Fonts */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    --font-mono: 'Fira Code', monospace;

    /* Radius & Transitions */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 24px;
    --radius-full: 9999px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Theme Variables (Optional Toggle) */
[data-theme="dark"] {
    --bg-primary: #0a0f1d;
    --bg-secondary: #10172a;
    --bg-card: rgba(16, 23, 42, 0.85);
    --bg-card-hover: rgba(26, 37, 66, 0.95);
    --bg-glass: rgba(255, 255, 255, 0.04);
    --border-glass: rgba(212, 175, 55, 0.3);
    --border-subtle: rgba(255, 255, 255, 0.1);

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-gold: #f3c64f;

    --shadow-gold: 0 10px 30px -5px rgba(212, 175, 55, 0.3);
}

/* Reset & Global */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* Utility Containers */
.container {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section-padding {
    padding: 6rem 0;
}

/* Typography */
h1, h2, h3, h4, .font-serif {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-primary);
}

.text-gold {
    color: var(--text-gold);
    background: linear-gradient(135deg, #aa7c11 0%, #d4af37 50%, #855e00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 0.75rem;
    position: relative;
    color: var(--text-primary);
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 680px;
    margin: 0 auto 3.5rem auto;
}

.crown-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 0.5rem 0 1rem 0;
    color: var(--accent-gold);
}

.crown-divider::before,
.crown-divider::after {
    content: '';
    height: 1px;
    width: 60px;
    background: linear-gradient(90deg, transparent, var(--accent-gold));
}

.crown-divider::after {
    background: linear-gradient(90deg, var(--accent-gold), transparent);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.85rem 1.75rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-gold {
    background: linear-gradient(135deg, #d4af37 0%, #b48c14 100%);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(180, 140, 20, 0.3);
}

.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(180, 140, 20, 0.45);
    background: linear-gradient(135deg, #e5c158 0%, #d4af37 100%);
}

.btn-outline-gold {
    background: transparent;
    border-color: var(--text-gold);
    color: var(--text-gold);
}

.btn-outline-gold:hover {
    background: rgba(180, 140, 20, 0.1);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-gold);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

/* Glassmorphism Card Wrapper */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.glass-card:hover {
    border-color: rgba(180, 140, 20, 0.4);
    box-shadow: var(--shadow-gold);
    transform: translateY(-4px);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-full);
}

.badge-gold {
    background: rgba(180, 140, 20, 0.12);
    color: var(--text-gold);
    border: 1px solid rgba(180, 140, 20, 0.3);
}

.badge-emerald {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-blue {
    background: rgba(37, 99, 235, 0.12);
    color: #2563eb;
    border: 1px solid rgba(37, 99, 235, 0.3);
}

.badge-crimson {
    background: rgba(220, 38, 38, 0.12);
    color: #dc2626;
    border: 1px solid rgba(220, 38, 38, 0.3);
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-body-wrapper {
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.3);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.modal-overlay.active .modal-body-wrapper {
    transform: scale(1);
}

.modal-close-btn {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition);
    z-index: 10;
}

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

/* Animations */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.animate-float {
    animation: float 5s ease-in-out infinite;
}

/* Responsive Grid Base */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }

@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
    .section-title { font-size: 1.9rem; }
}
