/* static/style.css */

/* Variables & Base System */
:root {
    --bpp-green: #2dcc70;
    --bpp-green-dark: #25a85c;
    --bpp-green-light: #52d68a;

    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);

    --card-radius: 16px;
    --transition-fast: 0.2s ease-in-out;
    --transition-smooth: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

body {
    background-color: var(--bpp-green);
    font-family: 'Quicksand', sans-serif;
    color: #333;
    padding-bottom: 40px;
}

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

.glass-panel-dark {
    background: rgba(33, 37, 41, 1);
    border-radius: 5px;
    color: #fff;
}

/* Navbar Enhancements */
.navbar-custom {
    background: rgba(33, 37, 41, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 15px 0;
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Base Components (Replaces old styles in base.html) */

/* Panel Card Redesign */
.panel-card {
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--card-radius);
    padding: 16px;
    margin-bottom: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transition: var(--transition-smooth);
}

.panel-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.panel-content img {
    border-radius: 8px;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    margin-bottom: 12px;
}

.text-panel {
    font-family: "Courier New", Courier, monospace;
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.7);
    padding: 24px;
    border-radius: 8px;
    border-left: 4px solid var(--bpp-green);
    margin: 0 0 16px 0;
    color: #444;
}

.panel-chars {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.panel-chars a {
    text-decoration: none;
    font-weight: 600;
    color: var(--bpp-green-dark);
}

.panel-chars a:hover {
    text-decoration: underline;
}

.panel-book {
    margin-top: 8px;
    word-break: break-word;
}

.panel-book a {
    text-decoration: none;
    color: #666;
    font-weight: 500;
}

.panel-footer {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    color: #777;
    font-weight: 500;
}

.panel-footer a {
    color: #333;
    text-decoration: none;
    font-weight: 700;
}

/* Book Preview Card */
.book-preview-card {
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--card-radius);
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.book-preview-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.preview-image {
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #f0f0f0;
}

.preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.book-preview-card:hover .preview-image img {
    transform: scale(1.05);
}

.placeholder-img {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
    font-family: monospace;
    font-size: 1.2rem;
}

.preview-caption {
    padding: 16px;
    background: white;
    flex-grow: 1;
}

.preview-caption h5 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
}

.preview-footer {
    padding: 12px 16px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
    font-size: 0.85rem;
    color: #666;
}

.preview-footer a {
    color: var(--bpp-green-dark);
    font-weight: 600;
    text-decoration: none;
}

/* Game Preview Card */
.game-preview-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.game-preview-card .card {
    border: none;
    border-radius: var(--card-radius);
    overflow: hidden;
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    transition: var(--transition-smooth);
}

.game-preview-card .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.game-preview-card img {
    height: 200px;
    object-fit: cover;
}

.game-preview-card .card-body {
    padding: 20px;
}

/* Typography Enhancements */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
}

.display-5 {
    font-weight: 800;
    letter-spacing: -1px;
}

/* Customizing Buttons */
.btn-primary {
    background-color: var(--bpp-green-dark);
    border-color: var(--bpp-green-dark);
    font-weight: 600;
    padding: 10px 24px;
    border-radius: 8px;
    transition: var(--transition-fast);
}

.btn-primary:hover {
    background-color: #1e8749;
    border-color: #1e8749;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 168, 92, 0.3);
}

.btn-outline-secondary {
    border-color: rgba(0, 0, 0, 0.2);
    color: #555;
    font-weight: 600;
    border-radius: 8px;
    transition: var(--transition-fast);
}

.btn-outline-secondary:hover {
    background-color: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.3);
    color: #333;
}

/* Layout Utilities */
.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.mt-5-custom {
    margin-top: 3rem;
}

/* Grid Layout for Panels (Flows Left-to-Right, then Top-to-Bottom, Squeezed Vertically via JS) */
.masonry-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    grid-auto-rows: 1px;
    gap: 0 1.5rem;
    align-items: start;
}

@media (min-width: 576px) {
    .masonry-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .masonry-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 992px) {
    .masonry-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1200px) {
    .masonry-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

.masonry-grid .panel-card {
    margin-bottom: 0; /* JS handles spacing via spans */
}

.masonry-item {
    min-width: 0; /* Prevents overflow in grid items */
}

/* Image loading placeholder */
@keyframes skeleton-loading {
    0% {
        background-color: #e2e5e7;
    }
    100% {
        background-color: #f1f3f5;
    }
}

.img-loading {
    animation: skeleton-loading 1s linear infinite alternate;
    color: transparent; /* Hide broken image alt text while loading */
    background-size: 200% 100%;
    min-height: 200px;
}