@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Merriweather:wght@300;400;700&display=swap');

:root {
    /* Paleta Vibrant & Dark - Inkitt / Premium Vibe */
    --primary: #E50914;
    --primary-hover: #F40612;
    --primary-glow: rgba(229, 9, 20, 0.4);

    --bg-main: #0b0b0e;
    --bg-surface: #15151a;
    --bg-surface-hover: #1e1e25;
    --bg-elevated: #23232b;

    --text-main: #fcfcfc;
    --text-secondary: #a1a1aa;
    --text-tertiary: #71717a;

    --border-light: rgba(255, 255, 255, 0.06);
    --border-focus: rgba(124, 92, 252, 0.3);

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 24px;
    --radius-pill: 9999px;

    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-primary: 0 8px 24px var(--primary-glow);

    --transition-fast: 0.15s ease;
    --transition-smooth: 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    --transition-bounce: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);

    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-serif: 'Merriweather', Georgia, serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* ================== TYPOGRAPHY ================== */
h1,
h2,
h3,
h4,
h5 {
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    line-height: 1.1;
}

h2 {
    font-size: clamp(1.8rem, 3vw, 2.5rem);
}

h3 {
    font-size: 1.25rem;
}

.text-muted {
    color: var(--text-secondary);
}

/* ================== LAYOUT & UTILS ================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 5%;
}

.glass {
    background: rgba(11, 11, 14, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
}

/* ================== NAVBAR ================== */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition-smooth);
}

.logo {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.logo span {
    color: var(--primary);
}

nav ul {
    display: flex;
    gap: 2rem;
    align-items: center;
}

nav a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

nav a:hover,
nav a.active {
    color: var(--text-main);
}

/* ================== BUTTONS ================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.75rem;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: var(--transition-bounce);
    gap: 0.5rem;
}

.btn:active {
    transform: scale(0.96);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(124, 92, 252, 0.3);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: var(--shadow-primary);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-main);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    background: var(--bg-surface-hover);
    border-color: rgba(255, 255, 255, 0.15);
}

/* ================== HERO SECTION ================== */
.hero {
    position: relative;
    padding: 10rem 5% 6rem;
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}


.hero-content {
    text-align: center;
    max-width: 800px;
    z-index: 1;
}

.hero p {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin: 1.5rem auto 3rem;
    max-width: 600px;
}

/* ================== FEATURED CAROUSEL ================== */
.featured-section {
    padding: 0 5% 4rem;
}

.featured-card {
    display: flex;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition-smooth);
}

.featured-card:hover {
    border-color: var(--border-focus);
}

.featured-cover {
    width: 40%;
    max-width: 350px;
    object-fit: cover;
}

.featured-info {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
}

.featured-badge {
    background: rgba(124, 92, 252, 0.15);
    color: var(--primary);
    padding: 0.4rem 1rem;
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    align-self: flex-start;
    margin-bottom: 1rem;
}

.featured-info h2 {
    margin-bottom: 0.5rem;
}

.featured-info .author {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.featured-info .synopsis {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ================== GENRES / FILTERS ================== */
.genres-container {
    padding: 2rem 5%;
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    scrollbar-width: none;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 2rem;
}

.genres-container::-webkit-scrollbar {
    display: none;
}

.chip {
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-pill);
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    white-space: nowrap;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition-smooth);
}

.chip:hover {
    background: var(--bg-surface);
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.2);
}

.chip.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(124, 92, 252, 0.25);
}

/* ================== BOOK GRID ================== */
.book-grid {
    padding: 0 5% 4rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 2rem 1.5rem;
}

.book-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.book-cover-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 3;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
}

.book-cover-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    pointer-events: none;
}

.book-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.book-card:hover .book-cover-wrapper {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.book-card:hover .book-cover {
    transform: scale(1.05);
}

.book-info h3 {
    font-size: 1.05rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-info .author {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    margin-top: 0.25rem;
}

.book-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 0.5rem;
    color: var(--text-secondary);
}

.book-stats span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* ================== SKELETONS ================== */
.skeleton {
    background: linear-gradient(90deg, var(--bg-surface) 25%, var(--bg-elevated) 50%, var(--bg-surface) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ================== LOGO & SPLASH ================== */
.logo-badge {
    height: 38px;
    width: 38px;
    object-fit: contain;
    border-radius: 4px;
    margin-right: 12px;
}

.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.6s ease, visibility 0.6s;
}

.splash-logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
    animation: pulseLogo 1.5s ease-in-out infinite alternate;
}

@keyframes pulseLogo {
    from {
        transform: scale(1);
        filter: drop-shadow(0 0 0px var(--primary));
    }

    to {
        transform: scale(1.1);
        filter: drop-shadow(0 0 20px var(--primary));
    }
}

.splash-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* ================== INTERACTIONS (Likes & Comments) ================== */
.interactions-section {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-light);
}

.like-button-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin: 3rem 0;
}

.btn-like {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 2px solid var(--border-light);
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-like.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 0 20px var(--primary-glow);
}

.btn-like:hover {
    transform: scale(1.1);
    border-color: var(--primary);
}

.comment-input-area {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-light);
}

.comment-input-area textarea {
    width: 100%;
    background: transparent;
    border: none;
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    resize: none;
    outline: none;
    margin-bottom: 1rem;
}

.comment-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.comment-item {
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.comment-author {
    color: var(--primary);
    font-weight: 700;
}

.comment-date {
    color: var(--text-tertiary);
}

.comment-text {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ================== RELATED BOOKS ================== */
.related-section {
    margin-top: 4rem;
    padding: 3rem 5%;
    background: rgba(255, 255, 255, 0.02);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

/* ================== RESPONSIVE ================== */
@media (max-width: 900px) {
    .featured-card {
        flex-direction: column;
    }

    .featured-cover {
        width: 100%;
        max-width: 100%;
        aspect-ratio: 21/9;
    }

    .featured-info {
        padding: 2rem;
    }
}

@media (max-width: 600px) {
    h1 {
        font-size: 2.2rem;
    }

    .book-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 1.5rem 1rem;
    }

    nav ul {
        gap: 1rem;
    }

    nav a {
        font-size: 0.85rem;
    }

    .logo {
        font-size: 1.4rem;
    }
}

/* ================== ADMIN LOGIN PREMIUM ================== */
.admin-login {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, #1a1a20 0%, #0b0b0e 100%);
}

.admin-login-card {
    width: 90%;
    max-width: 400px;
    padding: 3rem 2rem;
    text-align: center;
    border-radius: var(--radius-lg);
    background: rgba(21, 21, 26, 0.8) !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-light);
}

.admin-login-card h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.admin-login-card h2 span {
    color: var(--primary);
}

.admin-login-card input[type="password"] {
    width: 100%;
    padding: 1rem;
    background: var(--bg-main);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: #fff;
    margin: 1.5rem 0;
    text-align: center;
    font-size: 1.1rem;
    transition: var(--transition-fast);
}

.admin-login-card input[type="password"]:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 15px var(--primary-glow);
}

.alert {
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert.error {
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.alert.success {
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.3);
}

/* ================== ADMIN DASHBOARD LAYOUT ================== */
.admin-layout {
    display: flex;
    min-height: 100vh;
    background: var(--bg-main);
}

.admin-sidebar {
    width: 280px;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-light);
    z-index: 100;
}

.admin-sidebar .logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    margin-bottom: 3rem;
    padding-bottom: 1rem;
}

.admin-sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.admin-sidebar nav .btn {
    justify-content: flex-start;
    padding: 1rem;
    font-size: 0.95rem;
    border: 1px solid transparent;
}

.admin-sidebar nav .btn:hover,
.admin-sidebar nav .btn.active {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-light);
}

.admin-content {
    flex: 1;
    margin-left: 280px;
    padding: 3rem 5%;
    max-width: 1200px;
}

.view-section {
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.admin-form-card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    border: 1px solid var(--border-light);
    margin-top: 2rem;
}

.data-table {
    width: 100%;
    margin-top: 2rem;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.data-table th {
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem;
    text-align: left;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-tertiary);
}

.data-table td {
    padding: 1rem;
    border-top: 1px solid var(--border-light);
    color: var(--text-secondary);
}

@media (max-width: 1024px) {
    .admin-sidebar {
        width: 80px;
        padding: 2rem 0.5rem;
    }

    .admin-sidebar span,
    .admin-sidebar .logo-badge+span {
        display: none;
    }

    .admin-content {
        margin-left: 80px;
    }
}