/* Down The Rabbit Hole - Shared Styles */
@import url('https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css');

/* Dark Mode Toggle */
.dark-mode-toggle {
    float: right;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid #00d9ff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2em;
    color: #00d9ff;
    margin-left: 15px;
}

.dark-mode-toggle:hover {
    background: rgba(0, 217, 255, 0.2);
    transform: scale(1.1);
}

/* Dark Mode Styles */
body.dark-mode {
    background: linear-gradient(135deg, #0a0e27 0%, #16213e 100%);
    color: #e0e0e0;
}

body.dark-mode .container-fluid {
    background: #1a1a2e;
}

body.dark-mode .dark-mode-toggle {
    background: rgba(26, 26, 46, 0.9);
    border-color: #00d9ff;
    color: #00d9ff;
}

body.dark-mode .controls,
body.dark-mode .stats {
    background: #16213e;
    border-color: #2a3f5f;
}

body.dark-mode .search-box {
    background: #16213e;
    color: #e0e0e0;
    border-color: #00a8cc;
}

body.dark-mode .search-box:focus {
    background: #1a2332;
    border-color: #00d9ff;
}

body.dark-mode .filter-group select {
    background: #16213e;
    color: #e0e0e0;
    border-color: #00a8cc;
}


body.dark-mode .my-take,
body.dark-mode .background-text {
    background: #16213e;
    border-left-color: #00d9ff;
}

body.dark-mode footer {
    background: #0a0e27 !important;
}

body.dark-mode details summary {
    color: #00d9ff;
}

body.dark-mode .artist-nav-footer {
    background: #16213e !important;
    border-top-color: #2a3f5f !important;
}

/* Reset Bootstrap container-fluid padding for full-width layout */
.container-fluid {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* But add padding back for content sections */
.artist-content .row {
    margin-left: 0;
    margin-right: 0;
}

.artist-content .col,
.artist-content .col-auto {
    padding-left: 20px;
    padding-right: 20px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #1a1a2e;
    background: linear-gradient(135deg, #0f3460 0%, #16213e 100%);
    min-height: 100vh;
    padding: 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    border: 2px solid #00d9ff;
}

.container-fluid {
    background: white;
}

/* Header Styles */
header {
    background: linear-gradient(135deg, #00d9ff 0%, #00a8cc 100%);
    color: #1a1a2e;
    padding: 40px;
    text-align: center;
}

/* Lineup Page Header */
.lineup-header {
    background: linear-gradient(135deg, #00d9ff 0%, #00a8cc 100%);
    color: #1a1a2e;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    width: 100%;
}

.lineup-header .artist-header-content {
    text-align: left;
    flex: 1;
}

.lineup-header .page-header-content {
    text-align: left;
    flex: 1;
}

.header {
    background: linear-gradient(135deg, #00d9ff 0%, #00a8cc 100%);
    color: #1a1a2e;
    padding: 40px;
    text-align: center;
}

h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

.lineup-header h1 {
    font-size: 2em;
    margin-bottom: 8px;
}

.subtitle {
    font-size: 1.2em;
    opacity: 0.9;
    margin-bottom: 0;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.header .nav {
    margin-top: 20px;
}

.header .nav a {
    color: #1a1a2e;
    text-decoration: none;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 0;
    font-size: 0.9em;
    transition: all 0.3s;
    border: 1px solid rgba(255, 255, 255, 1);
}

.header .nav a:hover {
    background: white;
    transform: translateY(-2px);
}

/* Controls & Filters */
.controls {
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.search-box {
    width: 100%;
    padding: 12px 20px;
    font-size: 16px;
    border: 2px solid #00a8cc;
    border-radius: 0;
    transition: border-color 0.3s;
}

.search-box:focus {
    outline: none;
    border-color: #00d9ff;
    background: #f0fbff;
}

.filters {
    display: flex;
    gap: 15px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
}

.filter-group select {
    width: 100%;
    padding: 10px;
    border: 2px solid #00a8cc;
    border-radius: 0;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: normal;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

/* Table Styles */
.table-container {
    overflow-x: auto;
    padding: 0 20px 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    table-layout: auto;
}

th {
    background: linear-gradient(135deg, #00a8cc 0%, #0086a8 100%);
    color: white;
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    position: sticky;
    top: 0;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

th:hover {
    background: linear-gradient(135deg, #00d9ff 0%, #00a8cc 100%);
}

th.sortable::after {
    content: ' ⇅';
    opacity: 0.5;
}

th.sort-asc::after {
    content: ' ↑';
    opacity: 1;
}

th.sort-desc::after {
    content: ' ↓';
    opacity: 1;
}

td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}

/* Artist cell - clickable */
td.artist-cell-clickable {
    cursor: pointer;
    position: relative;
}

/* Artist cell with background image */
td.artist-cell-with-bg {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 50px;
    position: relative;
    overflow: hidden;
}

td.artist-cell-with-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: inherit;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.6s ease-in-out;
    z-index: 0;
}

td.artist-cell-with-bg:hover::before {
    transform: scale(1.1);
}

td.artist-cell-with-bg strong {
    display: inline-block;
    background: rgba(0, 168, 204, 0.95);
    padding: 8px 12px;
    border-left: 3px solid #00d9ff;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}


tr.hidden {
    display: none;
}

/* Badge Styles */
.badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 30px;
}

.badge-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: fit-content;
}

/* Override Bootstrap badge defaults for table context */
table .badge {
    font-size: 11px;
    margin: 2px 0;
    padding: 4px 8px;
    white-space: nowrap;
}

table .badge-container {
    width: auto;
    min-width: 0;
}

/* Artist Page Badge Styles */
.badges .badge {
    font-size: 14px;
}

/* Link Styles */
.link-icon {
    display: inline-block;
    margin-left: 4px;
    font-size: 0.8em;
    opacity: 0.6;
    transition: opacity 0.2s;
}

a:hover .link-icon {
    opacity: 1;
}

/* Larger emoji for gender and POC columns */
td[title*="Gender"],
td[title*="Person of Color"] {
    font-size: 1.4em;
}

.rating {
    font-weight: 700;
    color: #00a8cc;
    font-size: 1.1em;
}

.spotify-link {
    display: inline-block;
    padding: 6px 12px;
    background: #1DB954;
    color: white;
    text-decoration: none;
    border-radius: 0;
    font-size: 12px;
    font-weight: 600;
    transition: background 0.3s;
}

.spotify-link:hover {
    background: #1ed760;
}

/* Stats */
.stats {
    padding: 20px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    text-align: center;
    color: #666;
}

/* Artist Page Specific Styles */
.page-header {
    background: linear-gradient(135deg, #00d9ff 0%, #00a8cc 100%);
    color: #1a1a2e;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
}

.artist-header {
    background: linear-gradient(135deg, #00d9ff 0%, #00a8cc 100%);
    color: #1a1a2e;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
}

.page-header-content {
    flex: 1;
    text-align: left;
}

.page-header h1 {
    margin: 0;
    font-size: 2em;
    margin-bottom: 0.5rem;
}

.page-header .subtitle {
    margin: 0;
    font-size: 0.8em;
}

/* Hamburger Menu Styles */
.hamburger-menu {
    position: relative;
    flex-shrink: 0;
}

.hamburger-btn {
    font-size: 1.5em;
    transition: all 0.2s;
    flex-shrink: 0;
    border-color: rgba(255, 255, 255, 0.5) !important;
    background: transparent;
    cursor: pointer;
    padding: 8px 12px;
}

.hamburger-btn:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.8) !important;
}

.dropdown-menu-custom {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 250px;
    z-index: 1000;
    display: none;
    max-height: 80vh;
    overflow-y: auto;
}

.dropdown-menu-custom.show {
    display: block;
}

.dropdown-menu-custom a {
    display: block;
    padding: 10px 16px;
    color: #333;
    text-decoration: none;
    transition: background 0.2s;
    border-bottom: 1px solid #f0f0f0;
}

.dropdown-menu-custom a:last-child {
    border-bottom: none;
}

.dropdown-menu-custom a:hover {
    background: #f8f9fa;
    color: #00a8cc;
}

.dropdown-menu-custom a.home-link {
    font-weight: bold;
    background: linear-gradient(135deg, #00d9ff 0%, #00a8cc 100%);
    color: white;
    border-bottom: 2px solid #0097b8;
}

.dropdown-menu-custom a.home-link:hover {
    background: linear-gradient(135deg, #00a8cc 0%, #008ba8 100%);
    color: white;
}

.dropdown-menu-custom .festival-section {
    padding: 8px 16px;
    font-weight: bold;
    color: #666;
    font-size: 0.85em;
    text-transform: uppercase;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.dropdown-menu-custom .festival-links {
    padding: 10px 16px 10px 28px;
    font-size: 0.95em;
    border-bottom: 1px solid #f0f0f0;
}

.dropdown-menu-custom .festival-links a {
    display: inline;
    padding: 0;
    border: none;
    color: #00a8cc;
    text-decoration: none;
}

.dropdown-menu-custom .festival-links a:hover {
    text-decoration: underline;
    background: transparent;
}

.dropdown-menu-custom a.festival-year {
    padding-left: 28px;
    font-size: 0.95em;
}

/* Dark mode styles for dropdown */
body.dark-mode .dropdown-menu-custom {
    background: #16213e;
    border-color: #2a3f5f;
}

body.dark-mode .dropdown-menu-custom .festival-links {
    color: #00d9ff;
}

body.dark-mode .dropdown-menu-custom .festival-links a,
body.dark-mode .dropdown-menu-custom .festival-links a:visited {
    color: #00d9ff;
}

body.dark-mode .dropdown-menu-custom .festival-links .festival-link-sep {
    color: #00d9ff;
}

body.dark-mode .dropdown-menu-custom a {
    color: #e0e0e0;
    border-bottom-color: #2a3f5f;
}

body.dark-mode .dropdown-menu-custom a:hover {
    background: #1e2d4a;
    color: #00d9ff;
}

body.dark-mode .dropdown-menu-custom .festival-section {
    background: #0a1628;
    color: #00d9ff;
    border-bottom-color: #2a3f5f;
}

body.dark-mode .dropdown-menu-custom a.home-link {
    background: linear-gradient(135deg, #00a8cc 0%, #0a4a5c 100%);
    color: white;
    border-bottom-color: #00d9ff;
}

body.dark-mode .dropdown-menu-custom a.home-link:hover {
    background: linear-gradient(135deg, #0a4a5c 0%, #083a48 100%);
}

.artist-header-content {
    flex: 1;
}

.artist-header h1 {
    font-size: 2em;
    margin-bottom: 8px;
}

.artist-header .badges {
    margin-bottom: 0;
}

.artist-nav {
    flex-shrink: 0;
}

.artist-nav .btn {
    border-color: rgba(255, 255, 255, 0.5) !important;
}

.artist-nav .btn:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.8) !important;
    transform: translateY(-2px);
}

.artist-content {
    padding: 20px;
}

.left-column {
    flex: 0 0 670px;
    max-width: 670px;
}

.right-column {
    flex: 1;
    min-width: 0;
}

@media (max-width: 991px) {
    .left-column {
        flex: 0 0 100%;
        max-width: 100%;
        width: 100% !important;
    }
}

.content {
    padding: 40px;
}

.my-take {
    background: #f0fbff;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #00d9ff;
}

.background-text {
    background: #f0fbff;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #00d9ff;
}

.my-rating {
    background: linear-gradient(135deg, #00d9ff 0%, #00a8cc 100%) !important;
    color: white !important;
}

.hero-image {
    width: 100%;
    margin-bottom: 30px;
}

.hero-image img {
    width: auto;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 2px solid #00d9ff;
}

/* Carousel specific styles */
.carousel.hero-image {
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #00d9ff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.carousel.hero-image img {
    border-radius: 0;
    border: none;
    box-shadow: none;
}

.carousel-indicators {
    margin-bottom: 0.5rem;
}

.carousel-indicators [data-bs-target] {
    background-color: #00d9ff;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    background-color: rgba(0, 217, 255, 0.8);
    border-radius: 50%;
    padding: 10px;
}

body.dark-mode .carousel-control-prev-icon,
body.dark-mode .carousel-control-next-icon {
    background-color: rgba(0, 168, 204, 0.9);
}

/* Print Styles */
@media print {
    body {
        background: white;
    }

    /* Ensure all stat-card text is readable in dark mode (e.g., Top Genres bars) */
    body.dark-mode .stat-card,
    body.dark-mode .stat-card * {
        color: #e0e0e0 !important;
    }

    .controls,
    .stats {
        display: none;
    }

    .badge,
    .country-badge {
        border: 1px solid #333;
        background: white !important;
        color: black !important;
    }

    .country-badge {
        border: 2px solid #333;
    }

    /* Remove custom alternating row backgrounds for dark mode, use Bootstrap defaults */

    a {
        color: black;
        text-decoration: underline;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    body {
        padding: 5px;
        font-size: 13px;
    }

    header,
    .header {
        padding: 15px 10px;
    }

    h1,
    .header h1 {
        font-size: 1.4em;
        margin-bottom: 5px;
    }

    .subtitle {
        font-size: 0.9em;
    }

    .controls {
        padding: 12px 10px;
    }

    .table-container {
        padding: 0 5px 15px;
    }

    .search-box {
        padding: 8px 12px;
        font-size: 14px;
    }

    .filters {
        gap: 8px;
        margin-top: 10px;
    }

    .filter-group {
        min-width: 100px;
    }

    .filter-group label {
        font-size: 12px;
        margin-bottom: 3px;
    }

    .filter-group select {
        padding: 6px;
        font-size: 12px;
    }

    table {
        margin-top: 10px;
    }

    th,
    td {
        padding: 6px 4px;
        font-size: 11px;
    }

    .bio,
    .take {
        max-width: 180px;
        font-size: 11px;
        line-height: 1.3;
    }

    .badge {
        padding: 2px 6px;
        font-size: 10px;
    }

    .spotify-link {
        padding: 4px 8px;
        font-size: 10px;
    }

    .rating {
        font-size: 0.95em;
    }

    .stats {
        padding: 12px 10px;
        font-size: 12px;
    }

    /* Mobile table column optimization */
    table th:nth-child(1),
    /* Artist */
    table td:nth-child(1) {
        width: 100px;
    }

    table th:nth-child(2),
    /* Genre */
    table td:nth-child(2) {
        width: 50px;
    }

    table th:nth-child(3),
    /* Country */
    table td:nth-child(3) {
        width: 50px;
    }

    table th:nth-child(4),
    /* Bio */
    table td:nth-child(4) {
        min-width: 110px;
    }

    table th:nth-child(5),
    /* AI Summary */
    table td:nth-child(5) {
        min-width: 110px;
    }

    table th:nth-child(6),
    /* AI Rating */
    table td:nth-child(6) {
        width: 60px;
    }

    /* Artist Page Mobile */
    .artist-header {
        padding: 15px 10px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .artist-header h1 {
        font-size: 1.4em;
    }

    .hamburger-btn {
        font-size: 1.2em;
    }

    .dropdown-menu-custom {
        min-width: 200px;
        max-width: 90vw;
    }

    .artist-header-content {
        flex: 1;
        min-width: 200px;
    }

    .artist-nav {
        width: 100%;
        justify-content: space-between;
    }

    .artist-content {
        padding: 20px;
    }

    .content {
        padding: 20px;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .container {
        max-width: 900px;
    }
}

/* Rotate device message - only show in portrait on mobile */
.rotate-message {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 99999;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
}

body.dark-mode .rotate-message {
    background: #1a1a2e;
}

.rotate-content {
    color: #1a1a2e;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 40px 30px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border: 2px solid #00d9ff;
    position: relative;
}

body.dark-mode .rotate-content {
    background: rgba(26, 26, 46, 0.95);
    color: #e0e0e0;
}

.rotate-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 2rem;
    color: #666;
    cursor: pointer;
    padding: 5px 10px;
    line-height: 1;
    transition: all 0.2s ease;
    opacity: 0.6;
}

.rotate-close:hover {
    opacity: 1;
    color: #00d9ff;
    transform: scale(1.1);
}

body.dark-mode .rotate-close {
    color: #ccc;
}

body.dark-mode .rotate-close:hover {
    color: #00d9ff;
}

.rotate-content p {
    font-size: 1.2rem;
    max-width: 300px;
    margin: 0;
}

@media (max-width: 768px) and (orientation: portrait) and (hover: none) {
    .rotate-message {
        display: flex;
    }
}

/* Ensure .profile-text is readable in dark mode */
body.dark-mode .profile-text,
body[data-theme="dark"] .profile-text {
    color: #e0e0e0 !important;
}