/* Variables for easy tweaking */
:root {
    --bg-color: #f4f7f9;
    --card-bg: #ffffff;
    --accent: #0078d4;
    --text-main: #201f1e;
    --text-muted: #605e5c;
    --radius: 12px;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    --unit: 160px; /* Base unit for your 2:1 ratio cards */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    height: 100vh;
    width: 100vw;
    overflow: hidden; /* Keeps it fullscreen */
    padding: 15px; /* The "floating" padding you asked for */
    color: var(--text-main);
}

.app-container {
    display: flex;
    width: 100%;
    height: 100%;
    gap: 15px;
}

/* --- SIDEBAR --- */
.sidebar {
    width: 280px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    padding: 24px;
    transition: all 0.3s ease;
}

.logo {
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 40px;
    color: var(--accent);
}

.nav-links {
    flex-grow: 1;
}

.nav-item {
    padding: 12px 0;
    cursor: pointer;
    color: var(--text-muted);
    font-weight: 500;
}

.nav-item.active {
    color: var(--accent);
}

.btn-back {
    text-decoration: none;
    color: white;
    background: var(--text-main);
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    transition: opacity 0.2s;
}

.btn-back:hover {
    opacity: 0.8;
}

/* --- MAIN SECTION --- */
.main-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.top-bar {
    height: 70px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
}
.letter-anchor {
    grid-column: 1 / -1; 
    scroll-margin-top: 100px; /* Adjust based on your top-bar height */
    visibility: hidden;
    height: 0;
}
.profile-circle {
    width: 35px;
    height: 35px;
    background: #ddd;
    border-radius: 50%;
}
.bigtext {
    font-size:24px;
    font-weight: 800;
}
.boldtext {
    font-weight:800;
}
.content-view {
    flex-grow: 1;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 25px;
    overflow-y: auto;
}
.btn-reserve {
    display: inline-block;
    background-color: #ff2424; /* Clean "Accent" Blue */
    color: #ffffff;
    padding: 20px;
    border-radius: 8px; /* Modern slightly rounded look */
    text-decoration: none;
    font-weight: 600;
    font-family: inherit;
    transition: background-color 0.2s ease, transform 0.1s ease;
    border: none;
    cursor: pointer;
    text-align: center;
    margin-top: 15px;
}

/* The "Interaction" feel */
.btn-reserve:hover {
    background-color: #0056b3; /* Slightly darker on hover */
}

.btn-reserve:active {
    transform: scale(0.98); /* Tactile "click" feel */
}
/* --- THE DYNAMIC ELEMENT CONTAINER --- */
.element-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--unit), 1fr));
    gap: 20px;
    justify-items: center;
}

.custom-card {
    /* Height is 2x Unit, Width is 1x Unit */
    width: var(--unit);
    height: calc(var(--unit) * 2);
    background: #fff;
    border: 1px solid #edf2f7;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    transition: transform 0.2s ease;
}

.custom-card:hover {
    transform: translateY(-5px);
}

.image-placeholder {
    width: 100%;
    height: 90%; /* Image takes 90% of total card height */
    background: #f9f9f9;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
}

.image-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-text {
    width: 100%;
    text-align: left;
}

.card-title {
    font-size: 0.9rem;
    font-weight: 700;
}

.card-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 1024px) {
    body {
        padding: 8px;
    }
    body, html {
        height: auto;
        overflow: visible; /* Force the scrollbars back */
    }
    .app-container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        padding: 15px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    .top-bar {
        height: 60px;
    }
}

.custom-card {
    opacity: 0;
    animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.detail-layout {
    max-width: 900px;
    margin: 0 auto;
    animation: fadeIn 0.4s ease forwards;
}
.custom-card {

    cursor: pointer;
}
.detail-header {
    display: flex;
    flex-wrap: wrap; /* Allows wrapping on smaller mobile screens */
    gap: 40px;
    align-items: center; 
    margin-bottom: 50px;
}

.detail-img {
    /* Set to your 1x2 unit scale if desired */
    width: 280px; 
    height: 420px; 
    object-fit: cover;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    background: #eee;
}

.detail-info {
    flex: 1;
    min-width: 300px; /* Prevents text from getting too squished */
}

.detail-title {
    font-size: 3rem;
    font-weight: 800;
    margin: 0;
    line-height: 1.1;
}

.detail-creator {
    font-size: 1.4rem;
    color: var(--text-muted);
    margin: 10px 0;
}

.detail-genre {
    display: inline-block;
    padding: 6px 16px;
    background: var(--accent); /* Or #f0f0f0 for subtle vibe */
    color: white;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.detail-body {
    border-top: 1px solid rgba(0,0,0,0.05);
    padding-top: 40px;
}

.detail-body h3 {
    font-size: 0.85rem;
    color: var(--text-muted);
    letter-spacing: 3px;
    margin-bottom: 20px;
}

.detail-desc {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--text-main);
}

/* Top Bar Structural Layout */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    height: 70px;
    padding: 15px;
}

.top-bar-left {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.search-container {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #f1f3f5;
    padding: 5px 15px;
    border-radius: 30px;
    border: 1px solid #e9ecef;
}

.breadcrumb-label {
    font-weight: 800;
    font-size: 0.75rem;
    color: var(--accent);
    letter-spacing: 1px;
    border-right: 1px solid #ccc;
    padding-right: 12px;
}

#search-input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.9rem;
    width: 150px; /* Compact search */
    transition: width 0.3s ease;
}

#search-input:focus {
    width: 200px;
}

/* Center Navigation (The Alphabet) */
.top-bar-center {
    flex: 1;
    display: flex;
    justify-content: center;
    overflow: hidden;
}

.letter-nav {
    display: flex;
    gap: 15px;
}

.nav-letter {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.nav-letter:hover {
    color: var(--accent);
    transform: scale(1.2);
}

/* Right Side Controls */
.top-bar-right {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 15px;
}

.browser-default-select {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid #ddd;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

.grid-section-header {
    grid-column: 1 / -1;
    width: 100%;
    display: flex;
    align-items: center;
    text-align: center;
    margin: 40px 0 20px 0;
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--text-main);
    scroll-margin-top: 100px; /* Important for the jump */
}

/* The Lines */
.grid-section-header::before,
.grid-section-header::after {
    content: '';
    flex: 1;
    border-bottom: 2px solid #e0e0e0; /* The line color */
}

/* The Spacing around the letter */
.grid-section-header span {
    padding: 0 20px;
    text-transform: uppercase;
}

/* Optional: Make the lines a bit more subtle */
.grid-section-header::before {
    margin-right: 15px;
}
.grid-section-header::after {
    margin-left: 15px;
}