/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;700&family=Playfair+Display:ital,wght@0,400;0,700;1,400&display=swap');

:root {
    --bg-dark: #0a0a0a;
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-glass: rgba(0, 0, 0, 0.7);
    --primary: #ff4757;
    /* Vibrant Red */
    --accent: #2ed573;
    /* Vibrant Green for ratings */
    --text-main: #ffffff;
    --text-muted: #a4b0be;
    --font-main: 'Outfit', sans-serif;
    --font-serif: 'Playfair Display', serif;
    --radius: 12px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: var(--primary);
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 40px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -1px;
    background: linear-gradient(45deg, var(--primary), #ffa502);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

nav ul {
    display: flex;
    gap: 20px;
    list-style: none;
}

/* Chronique Detail Page */
.chronique-hero {
    position: relative;
    width: 100%;
    /*height: 60vh;*/
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    margin-bottom: -50px;
    /* Overlap effect */
    mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(20px) brightness(0.4);
    z-index: -1;
    transform: scale(1.1);
    /* Prevent blur edges */
}

.hero-content {
    padding: 60px 20px;
    padding-bottom: 80px;
    width: 100%;
    background: linear-gradient(to top, var(--bg-dark), transparent);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 30px;
    text-align: center;
}

.album-cover-xl {
    width: 300px;
    height: 300px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 10px;
}

.meta-info h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 10px;
    font-family: var(--font-serif);
}

.meta-info h2 {
    font-size: 2rem;
    color: var(--text-muted);
    font-weight: 300;
    margin-bottom: 25px;
}

.tags {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    font-size: 1rem;
    justify-content: center;
}

.tag {
    background: var(--bg-card);
    padding: 5px 15px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
}

.rating-badge {
    background: rgba(46, 213, 115, 0.2);
    color: var(--accent);
    border-color: rgba(46, 213, 115, 0.3);
    font-weight: bold;
}

/* Content Area */
.content-wrapper {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    background: rgba(20, 20, 20, 0.8);
    backdrop-filter: blur(20px);
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 50px;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
}

.review-text {
    font-size: 1.15rem;
    line-height: 1.8;
    color: #dcdde1;
}

/* Preserve HTML formatting but style it */
.review-text b,
.review-text strong {
    color: white;
    font-weight: 700;
}

.review-text i,
.review-text em {
    color: var(--text-muted);
}

.review-footer {
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Homepage Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 30px;
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    display: flex;
    /* Flex to stretch content */
    flex-direction: column;
    height: 100%;
    /* Fill grid cell */
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
    border-color: rgba(255, 255, 255, 0.2);
}

.card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    flex-shrink: 0;
    /* Never shrink image */
}

.card-info {
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Center content vertically if space */
    flex-grow: 1;
    /* Fill remaining space */
}

.card-title {
    font-weight: 700;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-artist {
    color: var(--text-muted);
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-rating {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--accent);
}

/* Utilities */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    border-radius: 5px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
    border: none;
    cursor: pointer;
}

/* Nav Active State */
.active-link {
    color: var(--primary);
    font-weight: bold;
}

/* Year Navigation */
.year-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    background: var(--bg-card);
    padding: 20px;
    border-radius: var(--radius);
}

.year-item {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    font-weight: 600;
    transition: 0.2s;
    border: 1px solid transparent;
}

.year-item:hover,
.year-item.active {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 71, 87, 0.4);
}

.alphabet-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 40px;
    justify-content: center;
    padding: 20px;
    background: var(--bg-card);
    border-radius: var(--radius);
}

.alphabet-nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--text-muted);
}

.alphabet-nav a:hover,
.alphabet-nav a.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 5px 15px rgba(255, 71, 87, 0.4);
}

.page-title {
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.artist-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.artist-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.05);
    font-weight: 500;
    transition: 0.2s;
    position: relative;
    /* For dropdown positioning */
}

.artist-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
    color: var(--primary);
}

nav ul li a.active-link {
    color: var(--primary);
    font-weight: 700;
}

nav ul li a:hover {
    color: var(--primary);
}

/* Dropdown Menu */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: rgba(20, 20, 20, 0.85);
    /* Semi-transparent */
    backdrop-filter: blur(12px);
    /* Blur effect */
    -webkit-backdrop-filter: blur(12px);
    /* Safari support */
    min-width: 120px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 2000;
    /* Higher Z-Index */
    border-radius: var(--radius);
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content a {
    color: var(--text);
    padding: 10px 20px;
    text-decoration: none;
    display: block;
    font-size: 0.9rem;
    white-space: nowrap;
}

.dropdown-content a:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--primary);
}

.artist-item .arrow {
    opacity: 0;
    transition: 0.2s;
}

.artist-item:hover .arrow {
    opacity: 1;
    transform: translateX(5px);
}

/* Artist Detail Header */
.artist-header {
    background: linear-gradient(135deg, #2c3e50, #000);
    padding: 60px 0;
    margin-top: -40px;
    margin-bottom: 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.artist-header h1 {
    font-size: 3rem;
    font-family: var(--font-serif);
    margin-bottom: 10px;
}

.artist-stats {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-family: monospace;
}

/* Active Filter Tags */
.active-filter-tag {
    display: inline-flex;
    align-items: center;
    background: var(--primary);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-right: 5px;
    margin-bottom: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.active-filter-tag .remove-filter {
    margin-left: 8px;
    cursor: pointer;
    font-weight: bold;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.active-filter-tag .remove-filter:hover {
    opacity: 1;
}

.active-filter-group {
    margin-bottom: 10px;
    font-size: 0.85rem;
    color: #ccc;
}

.active-filter-label {
    font-weight: bold;
    color: var(--text-muted);
    margin-right: 5px;
    display: block;
    margin-bottom: 3px;
    font-size: 0.75rem;
    text-transform: uppercase;
}

/* Multi-Review Styling */
.review-separator {
    border: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
    margin: 40px 0;
}

.review-date {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    font-style: italic;
}

h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    font-family: var(--font-serif);
}

/* --- Mobile Menu --- */
.menu-toggle {
    display: none;
    cursor: pointer;
    z-index: 1001;
    /* Above mobile menu */
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: var(--text-main);
    transition: all 0.3s ease-in-out;
}

/* Burger Animation */
.menu-toggle.is-active .bar:nth-child(2) {
    opacity: 0;
}

.menu-toggle.is-active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.menu-toggle.is-active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    nav .nav-list {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.95);
        backdrop-filter: blur(10px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: right 0.3s ease-in-out;
        z-index: 1000;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
    }

    nav .nav-list.active {
        right: 0;
    }

    nav ul li {
        margin: 5px 0;
        /* Tightened from 15px */
        width: 100%;
        text-align: center;
    }

    /* Adjust dropdown for mobile */
    .dropdown {
        width: 100%;
        /* Ensure click area spans width */
    }

    .dropdown-content {
        position: static;
        background: transparent;
        /* Remove blocky background */
        box-shadow: none;
        display: none;
        text-align: center;
        padding: 0;
        margin-top: 5px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        /* Subtle separator */
        transform: none;
        /* Reset desktop transform */
        left: auto;
        /* Reset desktop left */
    }

    .dropdown-content a {
        padding: 10px 0;
        color: var(--text-muted);
        /* Distinct color for sub-items */
        font-size: 0.85rem;
    }

    .dropdown-content a:hover {
        color: var(--primary);
    }

    /* Disable hover on mobile, use class instead */
    .dropdown:hover .dropdown-content {
        display: none;
    }

    .dropdown.active .dropdown-content {
        display: block;
        animation: fadeIn 0.3s;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }

}

/* --- Explore Page Styles --- */
.explore-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 40px;
    align-items: start;
    margin-top: 40px;
}

.filters-sidebar {
    background: var(--bg-card);
    padding: 30px;
    border-radius: var(--radius);
    position: sticky;
    top: 40px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.filter-group {
    margin-bottom: 25px;
}

.filter-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.filter-group select {
    width: 100%;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 5px;
}

/* Select2 Dark Theme Overrides */
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    min-height: 40px;
}

/* Force Search Field to take full width and show text */
.select2-container--default .select2-selection--multiple .select2-selection__rendered {
    display: block;
    padding: 0;
}

.select2-container--default .select2-selection--multiple .select2-selection__rendered li.select2-search--inline {
    display: block;
    width: 100%;
    margin: 0;
}

.select2-container--default .select2-search--inline .select2-search__field {
    width: calc(100% - 20px) !important;
    margin-top: 5px;
    margin-left: 10px;
    color: #fff !important;
    font-family: inherit;
    background-color: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.select2-search__field::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
    opacity: 1;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: white;
    line-height: 40px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 38px;
}

.select2-dropdown {
    background-color: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.select2-search__field {
    background-color: #000 !important;
    color: white !important;
}

.select2-results__option {
    color: #ccc;
}

/* Select2 Theme (Red/Dark) */
body .select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--primary) !important;
    color: white !important;
}

body .select2-container--default .select2-results__option[aria-selected="true"],
body .select2-container--default .select2-results__option--selected,
body .select2-container--default .select2-results__option--highlighted[aria-selected="true"],
body .select2-container--default .select2-results__option--selected.select2-results__option--highlighted {
    background-color: transparent !important;
    background: transparent !important;
    color: var(--primary) !important;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.select2-selection__choice {
    display: none !important;
}

.loading-overlay {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px;
    font-size: 1.5rem;
    color: var(--text-muted);
    display: none;
}

@media (max-width: 900px) {
    .explore-layout {
        grid-template-columns: 1fr;
    }

    .filters-sidebar {
        position: static;
    }
}

/* --- Mobile Responsiveness Improvements --- */
@media (max-width: 768px) {

    /* Responsive Grid: 2 columns on mobile */
    .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    /* Reduce Hero Height and Text */
    .chronique-hero {
        margin-bottom: 20px;
    }

    .meta-info h1 {
        font-size: 2rem;
        /* Was 3.5rem */
    }

    .meta-info h2 {
        font-size: 1.2rem;
        /* Was 2rem */
        margin-bottom: 15px;
    }

    .album-cover-xl {
        width: 150px;
        height: 150px;
        margin-bottom: 20px;
    }

    .hero-content {
        padding: 40px 15px;
        padding-bottom: 60px;
        gap: 15px;
    }

    /* Reduce Content Wrapper Width/Padding */
    .content-wrapper {
        padding: 25px 20px;
        margin-top: 0;
        border-radius: 0;
        /* Full width feel */
        border-left: none;
        border-right: none;
    }

    .review-text {
        font-size: 1rem;
        line-height: 1.6;
    }

    /* Artist/Label Lists Grid */
    .artist-list {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }

    .artist-item {
        padding: 15px;
        font-size: 0.9rem;
    }

    /* Header/Nav adjustments are handled by existing style.css logic? */
    /* Ensuring container has padding */
    .container {
        padding: 15px;
    }
}

@media (max-width: 480px) {

    /* Even smaller for very small screens */
    .grid {
        gap: 10px;
    }

    .meta-info h1 {
        font-size: 1.6rem;
    }

    .logo {
        font-size: 1.2rem;
    }

    .tags {
        gap: 8px;
    }

    .tag {
        padding: 4px 10px;
        font-size: 0.8rem;
    }
}

/* --- Critique Header Styling --- */
.critique-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    /* Allow wrapping on small screens */
    line-height: 1.4;
    margin-top: 0;
}

.critique-author {
    color: inherit;
    text-decoration: underline;
}

.critique-source {
    font-weight: normal;
    font-size: 0.9em;
    color: #888;
}

.critique-source-link {
    color: #888;
    text-decoration: underline;
}

.critique-rating {
    background: rgba(46, 213, 115, 0.1);
    color: #2ed573;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    border: 1px solid rgba(46, 213, 115, 0.2);
    white-space: nowrap;
    /* Keep rating on one line */
}

/* Mobile adjustments for critique header */
@media (max-width: 768px) {
    .critique-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .critique-rating {
        align-self: flex-start;
        margin-top: 5px;
    }
}