/**
 * Style Utama - Penerbit AiPress
 * Tema: Hijau Emerald Gradient ke Biru Tua (Perpustakaan Nasional / ISBN Style)
 */

:root {
    --primary-emerald: #1a7a4c;
    --primary-emerald-light: #2ecc71;
    --primary-emerald-dark: #145a38;
    --secondary-navy: #0a3d62;
    --secondary-navy-deep: #052338;
    --secondary-navy-gradient: #1e3c72;
    --accent-red: #e74c3c;
    --accent-red-hover: #c0392b;
    --accent-gold: #f39c12;
    --bg-light: #f8fafc;
    --bg-card: #ffffff;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --font-base: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Global Reset & Base Typography (Kecil, Rapi & Elegan) */
html {
    font-size: 13.5px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-base);
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Helper Font Sizes */
.text-xs { font-size: 0.8rem; }
.text-sm { font-size: 0.88rem; }
.text-base { font-size: 0.96rem; }
.text-lg { font-size: 1.15rem; }

/* Colors */
.text-emerald { color: var(--primary-emerald) !important; }
.text-emerald-light { color: var(--primary-emerald-light) !important; }
.text-navy { color: var(--secondary-navy) !important; }
.text-red { color: var(--accent-red) !important; }

/* Top Information Bar */
.top-bar {
    background: linear-gradient(90deg, #0f4c2e 0%, #062b46 100%);
    font-size: 0.78rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.top-bar .text-divider {
    color: rgba(255, 255, 255, 0.25);
}
.top-link:hover {
    color: var(--primary-emerald-light) !important;
}

/* Animated Blur Navbar */
.main-navbar {
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    transition: all 0.3s ease;
    padding: 0.65rem 0;
    z-index: 1030;
}
.main-navbar.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 20px rgba(10, 61, 98, 0.08);
    padding: 0.45rem 0;
}

/* Brand Badge */
.brand-badge {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary-emerald) 0%, var(--secondary-navy) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 4px 10px rgba(26, 122, 76, 0.3);
}
.brand-badge-lg {
    width: 44px;
    height: 44px;
    font-size: 1.25rem;
}
.brand-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--secondary-navy);
    letter-spacing: -0.5px;
    line-height: 1.1;
}
.brand-subtitle {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.2px;
}

/* Nav Links */
.main-navbar .nav-link {
    font-size: 0.9rem;
    font-weight: 600;
    color: #334155;
    padding: 0.5rem 0.9rem !important;
    border-radius: 6px;
    transition: all 0.25s ease;
}
.main-navbar .nav-link:hover {
    color: var(--primary-emerald);
    background-color: rgba(46, 204, 113, 0.08);
}
.main-navbar .nav-link.active {
    color: var(--primary-emerald);
    background-color: rgba(46, 204, 113, 0.12);
}

/* Buttons */
.btn {
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 6px;
    padding: 0.45rem 1rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-emerald {
    background: linear-gradient(135deg, var(--primary-emerald) 0%, #157347 100%);
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 12px rgba(26, 122, 76, 0.25);
}
.btn-emerald:hover {
    background: linear-gradient(135deg, #157347 0%, var(--primary-emerald-dark) 100%);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(26, 122, 76, 0.35);
}

.btn-navy {
    background: linear-gradient(135deg, var(--secondary-navy) 0%, var(--secondary-navy-deep) 100%);
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 12px rgba(10, 61, 98, 0.25);
}
.btn-navy:hover {
    background: linear-gradient(135deg, var(--secondary-navy-deep) 0%, #031726 100%);
    color: #ffffff;
    transform: translateY(-2px);
}

.btn-login-portal {
    background: transparent;
    color: var(--secondary-navy);
    border: 1.5px solid var(--secondary-navy);
    font-weight: 600;
}
.btn-login-portal:hover {
    background: var(--secondary-navy);
    color: #ffffff;
}

.btn-admin {
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
    color: #fff;
    border: none;
}
.btn-admin:hover {
    background: #0f766e;
    color: #fff;
}

/* Ripple effect on button click */
.btn-ripple {
    position: relative;
    overflow: hidden;
}
.ripple-wave {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: rippleAnim 0.6s linear;
    pointer-events: none;
}
@keyframes rippleAnim {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Hero Section with Animated Gradient */
.hero-section {
    position: relative;
    background: linear-gradient(135deg, #0f4c2e 0%, #1a7a4c 30%, #0a3d62 70%, #06263f 100%);
    background-size: 300% 300%;
    animation: gradientShift 16s ease infinite;
    color: #ffffff;
    padding: 4.5rem 0 3.5rem;
    overflow: hidden;
}
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Subtle Geometric Pattern Overlay */
.hero-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
}

.hero-title {
    font-size: 2.3rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.typing-text {
    border-right: 2px solid var(--primary-emerald-light);
    animation: blinkCursor 0.8s infinite;
    white-space: nowrap;
}
@keyframes blinkCursor {
    0%, 100% { border-color: transparent; }
    50% { border-color: var(--primary-emerald-light); }
}

/* Search Bar on Hero */
.hero-search-wrapper {
    background: #ffffff;
    border-radius: 12px;
    padding: 0.35rem 0.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}
.hero-search-input {
    border: none;
    outline: none;
    box-shadow: none !important;
    font-size: 0.95rem;
    padding-left: 0.75rem;
}

/* Stats Counter Box */
.stat-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 1.1rem 1rem;
    text-align: center;
    transition: all 0.3s ease;
}
.stat-card:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-4px);
}
.stat-number {
    font-size: 1.9rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.5px;
    line-height: 1;
}
.stat-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 0.35rem;
    font-weight: 500;
}

/* Book Cards & Lift-Up Hover Effect */
.book-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(10, 61, 98, 0.04);
    transition: all 0.35s cubic-bezier(0.165, 0.84, 0.44, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}
.book-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 32px rgba(26, 122, 76, 0.18), 0 4px 12px rgba(10, 61, 98, 0.08);
    border-color: rgba(46, 204, 113, 0.4);
}

.book-cover-wrap {
    position: relative;
    background: linear-gradient(135deg, #eef2f6 0%, #e2e8f0 100%);
    height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 1rem;
}
.book-cover-img {
    height: 90%;
    max-width: 85%;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: -4px 6px 16px rgba(0, 0, 0, 0.25);
    transition: transform 0.4s ease;
}
.book-card:hover .book-cover-img {
    transform: scale(1.05) rotate(-1deg);
}

.badge-isbn-verified {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.25rem 0.55rem;
    border-radius: 20px;
    box-shadow: 0 2px 6px rgba(231, 76, 60, 0.35);
    letter-spacing: 0.3px;
}

.badge-category {
    background: rgba(26, 122, 76, 0.1);
    color: var(--primary-emerald);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
}

.book-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--secondary-navy);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-author {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.book-price {
    font-size: 1rem;
    font-weight: 800;
    color: var(--primary-emerald);
}

/* Marketplace Buttons */
.btn-marketplace {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
    transition: all 0.2s ease;
}
.btn-tokopedia {
    background-color: #03ac0e;
    color: #ffffff;
}
.btn-tokopedia:hover {
    background-color: #028e0b;
    color: #ffffff;
}
.btn-shopee {
    background-color: #ee4d2d;
    color: #ffffff;
}
.btn-shopee:hover {
    background-color: #d73211;
    color: #ffffff;
}
.btn-google-book {
    background-color: #4285f4;
    color: #ffffff;
}
.btn-google-book:hover {
    background-color: #2b6cb0;
    color: #ffffff;
}
.btn-google-play {
    background-color: #00875f;
    color: #ffffff;
}
.btn-google-play:hover {
    background-color: #006647;
    color: #ffffff;
}

/* Detail Book Layout */
.book-detail-cover {
    box-shadow: -8px 12px 28px rgba(0, 0, 0, 0.22);
    border-radius: 8px;
    max-height: 420px;
    width: auto;
    object-fit: contain;
}

.spec-table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.85rem;
    width: 32%;
    background-color: #f8fafc;
}
.spec-table td {
    font-size: 0.88rem;
    color: var(--text-dark);
}

/* Footer Section */
.main-footer {
    background: linear-gradient(135deg, #051d2c 0%, #0a3d62 50%, #0e4429 100%);
    color: #ffffff;
    border-top: 3px solid var(--primary-emerald);
}
.footer-title {
    font-size: 0.95rem;
    letter-spacing: 0.3px;
    position: relative;
    padding-bottom: 0.5rem;
}
.footer-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 28px;
    height: 2px;
    background: var(--primary-emerald-light);
}
.footer-links li {
    margin-bottom: 0.5rem;
}
.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.82rem;
    transition: all 0.2s ease;
}
.footer-links a:hover {
    color: var(--primary-emerald-light);
    padding-left: 4px;
}
.legal-badge-box {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.bg-emerald-badge {
    background: var(--primary-emerald);
}

/* Back to Top Button */
.btn-back-to-top {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

/* Admin Dashboard Styling */
.admin-sidebar {
    background: #ffffff;
    border-right: 1px solid var(--border-color);
    min-height: calc(100vh - 60px);
}
.admin-sidebar .nav-link {
    font-size: 0.88rem;
    color: #475569;
    padding: 0.65rem 1rem;
    border-radius: 6px;
    margin-bottom: 0.25rem;
    font-weight: 500;
}
.admin-sidebar .nav-link.active,
.admin-sidebar .nav-link:hover {
    color: var(--primary-emerald);
    background: rgba(46, 204, 113, 0.1);
    font-weight: 600;
}

/* Loading Spinner Screen */
.page-loader {
    position: fixed;
    inset: 0;
    background: #ffffff;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
.page-loader.loaded {
    opacity: 0;
    visibility: hidden;
}
.spinner-publisher {
    width: 45px;
    height: 45px;
    border: 3px solid rgba(26, 122, 76, 0.2);
    border-top-color: var(--primary-emerald);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
