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

:root {
    --app-ink: #f8fafc;
    --app-muted: #94a3b8;
    --app-line: rgba(255, 255, 255, 0.1);
    --app-paper: #0b1120;
    --app-surface: rgba(30, 41, 59, 0.4);
    --app-primary: #d4af37; /* Gold */
    --app-primary-dark: #aa8c2c;
    --app-accent: #38bdf8;
    --app-glass-border: rgba(255, 255, 255, 0.08);
    --app-glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    --app-font-sans: 'Outfit', system-ui, -apple-system, sans-serif;
    --app-font-serif: 'Playfair Display', serif;
}

body {
    background: var(--app-paper);
    color: var(--app-ink);
    font-family: var(--app-font-sans);
    -webkit-font-smoothing: antialiased;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(212, 175, 55, 0.05), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(56, 189, 248, 0.05), transparent 25%);
    background-attachment: fixed;
}

/* Glassmorphism utility */
.glass-panel {
    background: var(--app-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--app-glass-border);
    box-shadow: var(--app-glass-shadow);
}

.app-navbar {
    background: rgba(11, 17, 32, 0.8) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--app-glass-border);
    padding: 1rem 0;
}

.brand-mark {
    align-items: center;
    background: linear-gradient(135deg, var(--app-primary), var(--app-primary-dark));
    border-radius: 10px;
    color: #0b1120;
    display: inline-flex;
    font-size: 0.85rem;
    font-weight: 800;
    height: 36px;
    justify-content: center;
    width: 36px;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.navbar-brand span:not(.brand-mark) {
    font-family: var(--app-font-serif);
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: linear-gradient(to right, #fff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-link {
    font-weight: 500;
    color: #cbd5e1 !important;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
}

.nav-link:hover, .nav-link.active {
    color: var(--app-primary) !important;
    background: rgba(212, 175, 55, 0.1);
}

.btn {
    align-items: center;
    border-radius: 10px;
    display: inline-flex;
    gap: 0.5rem;
    justify-content: center;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0.6rem 1.2rem;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--app-primary), var(--app-primary-dark));
    color: #0b1120;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
    background: linear-gradient(135deg, #dfc059, var(--app-primary));
    color: #0b1120;
}

.btn-light {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-light:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: translateY(-2px);
}

.btn-outline-light {
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: translateY(-2px);
}

.btn-outline-dark {
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    background: rgba(30, 41, 59, 0.6);
}

.btn-outline-dark:hover {
    background: var(--app-primary);
    color: #0b1120;
    border-color: var(--app-primary);
    transform: translateY(-2px);
}

.section-kicker {
    color: var(--app-primary);
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.menu-book-body {
    background: var(--app-paper);
    background-image: 
        radial-gradient(circle at 0% 0%, rgba(212, 175, 55, 0.08), transparent 40%),
        radial-gradient(circle at 100% 100%, rgba(56, 189, 248, 0.05), transparent 40%);
}

.menu-book-screen {
    min-height: calc(100vh - 76px);
    padding: 2rem 0 3rem;
}

.book-header {
    align-items: flex-end;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.book-title,
.admin-heading h1,
.auth-panel h1 {
    font-family: var(--app-font-serif);
    font-size: clamp(2rem, 3vw, 3rem);
    font-weight: 700;
    margin: 0;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.book-count {
    align-items: center;
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(8px);
    border: 1px solid var(--app-glass-border);
    border-radius: 12px;
    color: #e2e8f0;
    display: inline-flex;
    gap: 0.6rem;
    padding: 0.6rem 1rem;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.book-count span[data-lucide] {
    color: var(--app-primary);
}

.flipbook-stage {
    align-items: center;
    display: grid;
    gap: 2rem;
    grid-template-columns: 60px minmax(0, 1fr) 60px;
    margin: 2rem auto 0;
    max-width: 1200px;
    position: relative;
}

.book-wrap {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: min(75vh, 800px);
    perspective: 1500px;
}

.flip-book {
    height: min(75vh, 780px);
    max-width: 1000px;
    width: min(88vw, 1000px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    border-radius: 4px;
}

.menu-page {
    background: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.menu-page-image {
    align-items: center;
    background: #ffffff;
    display: flex;
    height: 100%;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.menu-page-image img {
    height: 100%;
    object-fit: contain;
    width: 100%;
    transition: transform 0.5s ease;
}

.menu-page:hover .menu-page-image img {
    transform: scale(1.05);
}

.book-nav-btn {
    aspect-ratio: 1;
    border-radius: 50%;
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(8px);
    border: 1px solid var(--app-glass-border);
    color: #fff;
    width: 60px;
    height: 60px;
    padding: 0;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.book-nav-btn:hover {
    background: var(--app-primary);
    color: #0b1120;
    transform: scale(1.1);
    box-shadow: 0 10px 40px rgba(212, 175, 55, 0.4);
    border-color: var(--app-primary);
}

.book-toolbar {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    position: relative;
    z-index: 50;
}

#pageIndicator {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(8px);
    border: 1px solid var(--app-glass-border);
    border-radius: 20px;
    color: #fff;
    font-weight: 600;
    min-width: 90px;
    padding: 0.5rem 1rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.empty-book,
.auth-panel,
.admin-section,
.stat-card {
    background: var(--app-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--app-glass-border);
    border-radius: 16px;
    box-shadow: var(--app-glass-shadow);
    color: var(--app-ink);
}

.empty-book {
    margin: 4rem auto 0;
    max-width: 600px;
    padding: 4rem 3rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.empty-book::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--app-primary), var(--app-accent));
}

.empty-book > span {
    color: var(--app-primary);
    height: 64px;
    margin: 0 auto 1.5rem;
    width: 64px;
    filter: drop-shadow(0 0 15px rgba(212, 175, 55, 0.4));
}

.empty-book h2 {
    font-family: var(--app-font-serif);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.empty-book p {
    color: var(--app-muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.auth-screen {
    align-items: center;
    display: flex;
    min-height: calc(100vh - 76px);
    padding: 2rem 1rem;
}

.auth-panel {
    margin: 0 auto;
    max-width: 440px;
    padding: 2.5rem;
    width: 100%;
}

.admin-heading {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.admin-section {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    align-items: center;
    display: flex;
    gap: 1.2rem;
    min-height: 120px;
    padding: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.4);
    border-color: rgba(212, 175, 55, 0.3);
}

.stat-card > span {
    color: var(--app-primary);
    height: 40px;
    width: 40px;
    background: rgba(212, 175, 55, 0.1);
    padding: 8px;
    border-radius: 12px;
}

.stat-card p {
    color: var(--app-muted);
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 0.3rem;
}

.stat-card strong {
    display: block;
    font-size: 2rem;
    font-family: var(--app-font-serif);
    color: #fff;
    line-height: 1;
}

.section-title-row {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--app-glass-border);
    padding-bottom: 1rem;
}

.section-title-row h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.table {
    --bs-table-bg: transparent !important;
    --bs-table-color: var(--app-ink) !important;
    --bs-table-border-color: var(--app-glass-border) !important;
    --bs-table-striped-bg: rgba(255, 255, 255, 0.05) !important;
    --bs-table-hover-bg: rgba(255, 255, 255, 0.1) !important;
    color: var(--app-ink) !important;
    background-color: transparent !important;
    border-color: var(--app-glass-border) !important;
}

.table th {
    font-weight: 600;
    color: var(--app-muted) !important;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--app-glass-border) !important;
    background-color: transparent !important;
}

.table td {
    vertical-align: middle;
    border-bottom: 1px solid var(--app-glass-border) !important;
    color: #e2e8f0 !important;
    background-color: transparent !important;
}

.table-thumb {
    aspect-ratio: 4 / 5;
    border: 1px solid var(--app-glass-border);
    border-radius: 8px;
    height: 72px;
    object-fit: cover;
    width: 58px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.preview-panel {
    background: rgba(15, 23, 42, 0.6);
    border: 1px dashed var(--app-muted);
    border-radius: 12px;
    min-height: 380px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-label {
    background: var(--app-primary);
    border-radius: 0 0 12px 0;
    color: #0b1120;
    font-size: 0.85rem;
    font-weight: 700;
    left: 0;
    padding: 0.5rem 1rem;
    position: absolute;
    top: 0;
    z-index: 2;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.2);
}

.preview-panel img {
    height: 440px;
    object-fit: contain;
    padding: 1rem;
    width: 100%;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.3));
}

.preview-placeholder {
    align-items: center;
    color: var(--app-muted);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: center;
    min-height: 380px;
    padding: 2rem;
    text-align: center;
}

.preview-placeholder span {
    height: 48px;
    width: 48px;
    opacity: 0.5;
}

.form-control, .form-select {
    background-color: rgba(15, 23, 42, 0.6) !important;
    border: 1px solid var(--app-glass-border) !important;
    color: #fff !important;
    border-radius: 8px;
    padding: 0.7rem 1rem;
}

.form-control:focus, .form-select:focus {
    background-color: rgba(15, 23, 42, 0.8) !important;
    border-color: var(--app-primary) !important;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2) !important;
}

.form-control::placeholder {
    color: var(--app-muted);
}

.form-label {
    font-weight: 500;
    color: #e2e8f0;
    margin-bottom: 0.5rem;
}

.simple-flipbook {
    background: transparent;
    display: flex;
    justify-content: center;
}

.simple-flipbook .menu-page {
    height: 100%;
    max-width: 520px;
    width: 100%;
}

.text-muted {
    color: var(--app-muted) !important;
}

.alert {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(12px);
    border: 1px solid var(--app-glass-border);
    color: #fff;
    border-radius: 12px;
}

.alert-success {
    border-left: 4px solid var(--app-accent);
}

.alert-danger {
    border-left: 4px solid #ef4444;
}

/* Pagination Links Styling */
.pagination {
    --bs-pagination-bg: rgba(30, 41, 59, 0.6);
    --bs-pagination-border-color: var(--app-glass-border);
    --bs-pagination-color: #cbd5e1;
    --bs-pagination-hover-bg: rgba(212, 175, 55, 0.1);
    --bs-pagination-hover-color: var(--app-primary);
    --bs-pagination-hover-border-color: var(--app-primary);
    --bs-pagination-active-bg: var(--app-primary);
    --bs-pagination-active-border-color: var(--app-primary);
    --bs-pagination-active-color: #0b1120;
}

@media (max-width: 767.98px) {
    .book-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 1.5rem;
    }

    .book-count {
        width: 100%;
        justify-content: center;
    }

    .flipbook-stage {
        display: block;
        margin-top: 1rem;
    }

    .book-wrap {
        min-height: 560px;
    }

    .flip-book {
        height: 560px;
        width: 100%;
    }

    .book-nav-btn {
        display: none;
    }

    .menu-page-image {
        height: 100%;
        min-height: 320px;
    }

    .admin-section {
        padding: 1rem;
    }
}
