:root, [data-theme="dark"] {
    --bg-dark: #0d1117;
    --bg-card: #161b22;
    --bg-table: #21262d;
    --bg-table-alt: #1a1f26;
    --bg-table-hover: #2d333b;
    --border-color: #30363d;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --accent: #e94560;
    --green: #3fb950;
    --yellow: #d29922;
    --red: #f85149;
    --imdb-gold: #f5c518;
}

[data-theme="light"] {
    --bg-dark: #f5f5f5;
    --bg-card: #ffffff;
    --bg-table: #f0f0f0;
    --bg-table-alt: #f8f8f8;
    --bg-table-hover: #e8e8e8;
    --border-color: #d0d0d0;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --accent: #e94560;
    --green: #2da44e;
    --yellow: #bf8700;
    --red: #cf222e;
    --imdb-gold: #f5c518;
}

body {
    background: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Segoe UI', system-ui, sans-serif;
    min-height: 100vh;
}

/* Login Overlay */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.login-overlay.hidden {
    display: none;
}

.login-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    margin: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header img {
    margin-bottom: 16px;
}

.login-header h2 {
    color: var(--text-primary);
    font-size: 1.5em;
    margin-bottom: 8px;
}

.login-header p {
    font-size: 0.9em;
}

.login-form .form-label {
    color: var(--text-secondary);
    font-size: 0.9em;
    margin-bottom: 6px;
}

.login-form .form-control {
    background: var(--bg-table);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 16px;
    font-size: 1em;
}

.login-form .form-control:focus {
    background: var(--bg-table);
    border-color: var(--accent);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.15);
}

.login-form .form-control::placeholder {
    color: var(--text-secondary);
}

.login-form .btn-danger {
    padding: 12px;
    font-weight: 600;
    margin-top: 8px;
}

.login-form .alert {
    font-size: 0.9em;
    padding: 10px 14px;
}

/* Logo Animation */
.logo-container {
    position: relative;
    cursor: pointer;
    min-width: 120px;
    height: 32px;
    display: flex;
    align-items: center;
}

.logo-container .logo-img {
    transition: opacity 0.15s ease;
}

.logo-container.expanded .logo-img {
    opacity: 0;
    position: absolute;
    pointer-events: none;
}

.logo-expanded {
    display: none;
    align-items: center;
    gap: 6px;
    font-family: 'Arial Black', sans-serif;
    font-weight: 900;
    white-space: nowrap;
}

.logo-container.expanded .logo-expanded {
    display: flex !important;
}

.logo-skull {
    font-size: 1.3em;
    filter: drop-shadow(0 0 6px rgba(220, 53, 69, 0.8));
    animation: skullPulse 0.4s ease-out;
}

.logo-text {
    font-size: 0.95em;
    letter-spacing: 0.5px;
}

.logo-text .char {
    display: inline-block;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    opacity: 0;
    transform: translateY(-10px) scale(0.8);
    filter: blur(4px);
    transition: all 0.2s ease-out;
}

.logo-text .char.revealed {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
}

.logo-text .space {
    display: inline-block;
    width: 0.25em;
}

@keyframes skullPulse {
    0% { transform: scale(0.3) rotate(-15deg); opacity: 0; }
    60% { transform: scale(1.15) rotate(3deg); opacity: 1; }
    100% { transform: scale(1) rotate(0deg); }
}

.navbar {
    background: var(--bg-card) !important;
    border-bottom: 2px solid var(--accent);
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.modal-content {
    background: var(--bg-card);
    color: var(--text-primary);
}

/* Table Dark Theme */
.table {
    color: var(--text-primary);
    background: var(--bg-card);
    margin-bottom: 0;
}

.table thead th {
    background: var(--bg-table) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
    font-weight: 600;
    white-space: nowrap;
    padding: 12px 10px;
}

.table tbody td {
    background: var(--bg-card);
    border-color: var(--border-color);
    vertical-align: middle;
    padding: 10px;
}

.table tbody tr:nth-of-type(odd) td {
    background: var(--bg-table-alt);
}

.table tbody tr:hover td {
    background: var(--bg-table-hover) !important;
}

/* Override DataTables striping */
.table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-accent-bg: var(--bg-table-alt);
    color: var(--text-primary);
}

.table-striped > tbody > tr:nth-of-type(even) > * {
    --bs-table-accent-bg: var(--bg-card);
    color: var(--text-primary);
}

/* IMDB Rating Styles */
.imdb-rating {
    font-size: 1.1em;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    display: inline-block;
    min-width: 45px;
    text-align: center;
    text-decoration: none;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    transition: all 0.2s ease;
}

.imdb-rating:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.rating-high {
    background: linear-gradient(135deg, #2ea043 0%, #238636 100%);
    color: #ffffff !important;
}

.rating-medium {
    background: linear-gradient(135deg, #d29922 0%, #bb8009 100%);
    color: #ffffff !important;
}

.rating-low {
    background: linear-gradient(135deg, #f85149 0%, #da3633 100%);
    color: #ffffff !important;
}

.rating-na {
    background: var(--bg-table);
    color: var(--text-secondary) !important;
    font-weight: 500;
    font-size: 0.95em;
}

.movie-title {
    color: #fff;
    font-weight: 500;
}

/* Season/Episode badge for TV shows */
.season-episode {
    font-size: 0.85em;
    color: #60a5fa;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 8px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Movie Title Cell - prevent wrapping */
#moviesTable td:first-child {
    white-space: nowrap;
}

#moviesTable td:first-child > span,
#moviesTable td:first-child > button {
    display: inline-block;
    vertical-align: middle;
}

.original-name {
    color: var(--text-secondary);
    font-size: 0.85em;
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    display: block;
}

.btn-magnet {
    background: var(--accent);
    border: none;
    color: white;
    padding: 5px 14px;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-magnet:hover {
    background: #ff6b6b;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(233, 69, 96, 0.4);
}

.actions-cell {
    white-space: nowrap;
}

.btn-hide {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 5px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-hide:hover {
    background: var(--red);
    border-color: var(--red);
    color: white;
}

.btn-unhide {
    background: var(--green);
    border: none;
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-unhide:hover {
    background: #2ea043;
}

.seeders {
    color: var(--green);
    font-weight: 600;
}

.leechers {
    color: var(--red);
    font-weight: 500;
}

.votes-cell {
    color: var(--text-secondary);
    font-size: 0.85em;
    white-space: nowrap;
}

.genre-cell {
    color: var(--text-secondary);
    font-size: 0.8em;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-fix {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-fix:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.btn-trailer {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--red);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75em;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 8px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.btn-trailer:hover {
    background: var(--red);
    border-color: var(--red);
    color: white;
}

.btn-trailer svg {
    width: 12px;
    height: 12px;
}

/* Category Switch Buttons */
.btn-category {
    background: var(--bg-table);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 16px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-category:hover {
    background: var(--bg-table-hover);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-category.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.btn-category:first-child {
    border-radius: 6px 0 0 6px;
}

.btn-category:last-child {
    border-radius: 0 6px 6px 0;
}

/* Time Period Switch Buttons */
.btn-time {
    background: var(--bg-table);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 12px;
    font-weight: 500;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.btn-time:hover {
    background: var(--bg-table-hover);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-time.active {
    background: #6c757d;
    color: white;
    border-color: #6c757d;
}

.btn-time:first-child {
    border-radius: 6px 0 0 6px;
}

.btn-time:last-child {
    border-radius: 0 6px 6px 0;
}

/* Last Refresh Indicator */
.last-refresh-indicator {
    font-size: 0.65em;
    color: #ff6b6b;
    white-space: nowrap;
    position: relative;
    top: -8px;
    margin-left: -4px;
    font-weight: 500;
}

/* Search Box */
.search-box {
    display: flex;
    align-items: stretch;
    background: var(--bg-table);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: visible;
    height: 31px;
}

.search-box .form-control {
    border: none;
    background: transparent;
    width: 150px;
    padding: 4px 10px;
    font-size: 0.85em;
    color: var(--text-primary);
    border-radius: 6px 0 0 6px;
    height: 100%;
}

.search-box .form-control:focus {
    box-shadow: none;
    background: transparent;
}

.search-box .form-control::placeholder {
    color: var(--text-secondary);
}

.btn-search {
    background: var(--accent);
    border: none;
    color: white;
    padding: 4px 10px;
    border-radius: 0 6px 6px 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-search:hover {
    background: #ff6b6b;
    color: white;
}

/* DataTables Dark Theme */
.dataTables_wrapper .dataTables_filter input {
    background: var(--bg-table) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    border-radius: 6px;
    padding: 6px 12px;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--accent) !important;
    outline: none;
    box-shadow: 0 0 0 2px rgba(233, 69, 96, 0.2);
}

.dataTables_wrapper .dataTables_length select {
    background: var(--bg-table) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    border-radius: 6px;
    padding: 4px 8px;
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
    color: var(--text-secondary) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    color: var(--text-primary) !important;
    background: var(--bg-table) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 4px;
    margin: 0 2px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--accent) !important;
    color: white !important;
    border-color: var(--accent) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--accent) !important;
    color: white !important;
    border-color: var(--accent) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    color: var(--text-secondary) !important;
    background: var(--bg-card) !important;
}

/* Sorting icons */
table.dataTable thead .sorting,
table.dataTable thead .sorting_asc,
table.dataTable thead .sorting_desc {
    background-color: var(--bg-table) !important;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    text-align: center;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
    color: var(--accent);
}

.form-control, .form-select {
    background: var(--bg-table);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.form-control:focus, .form-select:focus {
    background: var(--bg-table);
    border-color: var(--accent);
    color: var(--text-primary);
    box-shadow: 0 0 0 0.2rem rgba(233, 69, 96, 0.25);
}

.form-label {
    color: var(--text-primary);
    font-weight: 500;
}

.form-text {
    color: var(--text-secondary);
}

.settings-section {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.settings-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.settings-section h6 {
    color: var(--accent);
    margin-bottom: 1rem;
}

/* Card body padding */
.card-body {
    padding: 0;
}

/* DataTables wrapper */
.dataTables_wrapper {
    padding: 15px;
}

/* IMDB Fix Modal Styles */
.imdb-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.imdb-result-item:hover {
    background: var(--bg-table-hover);
    border-color: var(--accent);
}

.imdb-result-item.selected {
    background: var(--bg-table);
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(233, 69, 96, 0.3);
}

.imdb-result-poster {
    width: 50px;
    height: 75px;
    object-fit: cover;
    border-radius: 4px;
    background: var(--bg-table);
}

.imdb-result-info {
    flex: 1;
}

.imdb-result-title {
    font-weight: 600;
    color: var(--text-primary);
}

.imdb-result-year {
    color: var(--text-secondary);
    font-size: 0.9em;
}

.imdb-result-type {
    color: var(--accent);
    font-size: 0.8em;
    text-transform: uppercase;
}

/* Movie Hover Card */
.movie-title-hover {
    cursor: pointer;
    position: relative;
}

.movie-title-hover:hover {
    color: var(--accent);
}

.movie-hover-card {
    position: fixed;
    z-index: 10000;
    width: 360px;
    background: linear-gradient(145deg, #1a1f26 0%, #0d1117 100%);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    padding: 0;
    overflow: hidden;
    pointer-events: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.movie-hover-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.movie-hover-card-header {
    display: flex;
    gap: 14px;
    padding: 14px;
    background: rgba(233, 69, 96, 0.1);
    border-bottom: 1px solid var(--border-color);
}

.movie-hover-poster {
    width: 80px;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    background: var(--bg-table);
}

.movie-hover-info {
    flex: 1;
    min-width: 0;
}

.movie-hover-title {
    font-size: 1.1em;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.3;
}

.movie-hover-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.movie-hover-meta-item {
    font-size: 0.8em;
    color: var(--text-secondary);
    background: var(--bg-table);
    padding: 2px 8px;
    border-radius: 4px;
}

.movie-hover-rating {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 700;
    font-size: 1em;
    color: var(--imdb-gold);
}

.movie-hover-rating svg {
    width: 14px;
    height: 14px;
    fill: var(--imdb-gold);
}

.movie-hover-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.movie-hover-genre {
    font-size: 0.75em;
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 2px 8px;
    border-radius: 12px;
}

.movie-hover-body {
    padding: 14px;
}

.movie-hover-description {
    font-size: 0.85em;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 12px;
}

.movie-hover-credits {
    font-size: 0.8em;
}

.movie-hover-credits-label {
    color: var(--text-secondary);
    margin-right: 4px;
}

.movie-hover-credits-value {
    color: var(--text-primary);
}

.movie-hover-loading {
    padding: 40px;
    text-align: center;
    color: var(--text-secondary);
}

.movie-hover-loading .spinner-border {
    width: 1.5rem;
    height: 1.5rem;
    color: var(--accent);
}

/* TMDB Reviews in Hover Card */
.movie-hover-reviews {
    border-top: 1px solid var(--border-color);
    max-height: 200px;
    overflow-y: auto;
}

.movie-hover-reviews:empty {
    display: none;
}

.reviews-title {
    font-size: 0.75em;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 14px 6px;
    background: rgba(0, 0, 0, 0.2);
}

.review-item {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.review-item:last-child {
    border-bottom: none;
}

.review-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.review-author {
    font-size: 0.8em;
    font-weight: 600;
    color: var(--text-primary);
}

.review-rating {
    font-size: 0.7em;
    font-weight: 600;
    color: var(--imdb-gold);
    background: rgba(245, 197, 24, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
}

.review-content {
    font-size: 0.8em;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Movie Details Modal */
#reviewsModal .modal-content {
    background: var(--bg-card);
}

#reviewsModal .modal-header {
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--border-color);
}

#reviewsModal .modal-title {
    font-size: 1.1em;
    color: var(--text-primary);
}

#reviewsModal .modal-body {
    padding: 0;
}

.details-modal-content {
    padding: 0;
}

/* Hero section with poster */
.details-hero {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.2) 100%);
    border-bottom: 1px solid var(--border-color);
}

.details-poster {
    width: 150px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    flex-shrink: 0;
}

.details-hero-info {
    flex: 1;
    min-width: 0;
}

.details-title {
    font-size: 1.4em;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.details-year {
    font-weight: 400;
    color: var(--text-secondary);
}

.details-tagline {
    font-style: italic;
    color: var(--text-secondary);
    font-size: 0.9em;
    margin: 0 0 12px 0;
}

.details-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.details-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255,255,255,0.1);
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8em;
    color: var(--text-secondary);
}

.details-badge.cert {
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
}

.details-badge.rating {
    color: var(--imdb-gold);
    border-color: var(--imdb-gold);
}

.details-badge.rating .star {
    color: var(--imdb-gold);
}

.details-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.genre-tag {
    background: var(--accent);
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 500;
}

/* Sections */
.details-section {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.details-section:last-child {
    border-bottom: none;
}

.details-section h4 {
    font-size: 0.9em;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 12px 0;
}

.details-overview {
    font-size: 0.95em;
    color: var(--text-primary);
    line-height: 1.6;
    margin: 0;
}

/* Directors/Creators */
.details-people-small {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.person-small {
    display: flex;
    align-items: center;
    gap: 10px;
}

.person-photo-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-table);
}

.person-photo-small.no-photo {
    background: var(--bg-table);
}

.person-small span {
    font-size: 0.9em;
    color: var(--text-primary);
}

/* Cast grid */
.details-cast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.cast-card {
    display: flex;
    gap: 10px;
    background: rgba(0,0,0,0.15);
    border-radius: 8px;
    padding: 8px;
    align-items: center;
}

.cast-photo {
    width: 50px;
    height: 75px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}

.cast-photo.no-photo {
    background: var(--bg-table);
}

.cast-info {
    min-width: 0;
    flex: 1;
}

.cast-name {
    font-size: 0.85em;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cast-character {
    font-size: 0.75em;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Info grid */
.details-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}

.info-row {
    display: flex;
    gap: 8px;
}

.info-label {
    font-size: 0.85em;
    color: var(--text-secondary);
    min-width: 80px;
}

.info-value {
    font-size: 0.85em;
    color: var(--text-primary);
}

/* Collapsible Reviews List */
.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.review-item-collapsible {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.15);
    overflow: hidden;
    transition: all 0.2s ease;
}

.review-item-collapsible:hover {
    border-color: var(--accent);
}

.review-header-collapsible {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    cursor: pointer;
    user-select: none;
}

.review-header-collapsible:hover {
    background: rgba(255, 255, 255, 0.03);
}

.review-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

#reviewsModal .review-author {
    font-weight: 600;
    font-size: 0.95em;
    color: var(--text-primary);
}

#reviewsModal .review-rating {
    font-size: 0.8em;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
}

#reviewsModal .review-rating.rating-positive {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.15);
}

#reviewsModal .review-rating.rating-negative {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
}

#reviewsModal .review-rating.rating-neutral {
    color: var(--imdb-gold);
    background: rgba(245, 197, 24, 0.15);
}

#reviewsModal .review-date {
    font-size: 0.8em;
    color: var(--text-secondary);
}

.review-expand-icon {
    color: var(--text-secondary);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.review-item-collapsible.expanded .review-expand-icon {
    transform: rotate(180deg);
}

.review-preview {
    padding: 0 16px 12px;
    font-size: 0.9em;
    color: var(--text-secondary);
    line-height: 1.5;
}

.review-item-collapsible.expanded .review-preview {
    display: none;
}

.review-full-content {
    display: none;
    padding: 0 16px 16px;
    border-top: 1px solid var(--border-color);
    margin-top: 0;
}

.review-item-collapsible.expanded .review-full-content {
    display: block;
    padding-top: 12px;
}

.review-full-text {
    font-size: 0.9em;
    color: var(--text-secondary);
    line-height: 1.7;
    white-space: pre-wrap;
    max-height: 400px;
    overflow-y: auto;
}

#reviewsModal .review-link {
    display: inline-block;
    margin-top: 12px;
    font-size: 0.85em;
    color: var(--accent);
    text-decoration: none;
}

#reviewsModal .review-link:hover {
    text-decoration: underline;
}

/* Trailer Modal */
#trailerModal .modal-dialog {
    max-width: 900px;
}

#trailerModal .modal-body {
    padding: 0;
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

#trailerModal .modal-body iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

#trailerModal .modal-header {
    padding: 10px 16px;
}

#trailerModal .modal-title {
    font-size: 1em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Hidden movie item */
.hidden-movie-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 8px;
}

.hidden-movie-name {
    color: var(--text-primary);
}

/* Privacy Banner */
.privacy-banner {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(147, 51, 234, 0.15) 100%);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.privacy-banner-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    min-width: 20px;
    max-width: 20px;
    color: #60a5fa;
    margin-top: 2px;
}

.privacy-banner-content {
    flex: 1;
}

.privacy-banner-title {
    font-weight: 600;
    color: #60a5fa;
    font-size: 0.95em;
    margin-bottom: 4px;
}

.privacy-banner-text {
    font-size: 0.85em;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.privacy-banner-text strong {
    color: var(--text-primary);
}

/* Compact privacy note for modal footer */
.privacy-note {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8em;
    color: #60a5fa;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 6px;
    padding: 6px 10px;
}

.privacy-note svg {
    color: #60a5fa;
    flex-shrink: 0;
}

/* Font Size Slider */
.form-range {
    width: 100%;
    height: 6px;
    background: var(--bg-table);
    border-radius: 3px;
    cursor: pointer;
}

.form-range::-webkit-slider-thumb {
    background: var(--accent);
    border: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    cursor: pointer;
}

.form-range::-moz-range-thumb {
    background: var(--accent);
    border: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    cursor: pointer;
}

/* Theme Toggle Buttons */
.theme-toggle {
    display: flex;
    gap: 0;
}

.btn-theme {
    background: var(--bg-table);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 20px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-theme:hover {
    background: var(--bg-table-hover);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-theme.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.btn-theme:first-child {
    border-radius: 6px 0 0 6px;
}

.btn-theme:last-child {
    border-radius: 0 6px 6px 0;
}

/* Light theme specific overrides */
[data-theme="light"] .navbar {
    background: #ffffff !important;
    border-bottom-color: var(--accent);
}

[data-theme="light"] .navbar-brand,
[data-theme="light"] .navbar .btn-outline-light {
    color: var(--text-primary) !important;
}

[data-theme="light"] .navbar .btn-outline-light {
    border-color: var(--border-color);
}

[data-theme="light"] .navbar .btn-outline-light:hover {
    background: var(--bg-table);
    color: var(--text-primary);
}

[data-theme="light"] .modal-content {
    background: var(--bg-card);
}

[data-theme="light"] .btn-close-white {
    filter: invert(1);
}

[data-theme="light"] .movie-title {
    color: var(--text-primary);
}

[data-theme="light"] .dataTables_wrapper .dataTables_filter input,
[data-theme="light"] .dataTables_wrapper .dataTables_length select {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
}

/* Navbar left/right grouping on mobile */
@media (max-width: 767.98px) {
    .navbar-controls {
        justify-content: center !important;
    }

    .navbar-left,
    .navbar-right {
        justify-content: center;
    }
}

/* ============ MOBILE RESPONSIVE ============ */

/* Mobile navbar */
@media (max-width: 767.98px) {
    body {
        overflow-x: hidden;
    }

    .navbar {
        padding: 8px;
        width: 100%;
    }

    .navbar .container-fluid {
        padding: 0;
        width: 100%;
        max-width: 100%;
    }

    .navbar-controls {
        width: 100%;
    }

    .search-box {
        flex: 1;
        min-width: 100px;
    }

    .search-box .form-control {
        width: 100%;
        min-width: 60px;
    }

    .btn-category, .btn-time {
        padding: 4px 8px;
        font-size: 0.8rem;
    }

    .container-fluid.px-4 {
        padding-left: 4px !important;
        padding-right: 4px !important;
    }

    /* Table mobile adjustments */
    .card {
        border-radius: 6px;
        overflow: hidden;
    }

    .card-body {
        padding: 0 !important;
    }

    .dataTables_wrapper {
        padding: 4px;
        width: 100%;
        overflow-x: auto;
    }

    /* Make table scroll horizontally if needed */
    #moviesTable {
        width: 100% !important;
        font-size: 0.75rem;
    }

    /* Hide less important columns on mobile */
    #moviesTable th:nth-child(2),
    #moviesTable td:nth-child(2),
    #moviesTable th:nth-child(4),
    #moviesTable td:nth-child(4),
    #moviesTable th:nth-child(5),
    #moviesTable td:nth-child(5),
    #moviesTable th:nth-child(9),
    #moviesTable td:nth-child(9) {
        display: none;
    }

    /* Compact table cells */
    .table tbody td {
        padding: 4px 2px;
        font-size: 0.75em;
        white-space: nowrap;
    }

    .table thead th {
        padding: 6px 2px;
        font-size: 0.75em;
        white-space: nowrap;
    }

    .imdb-rating {
        font-size: 0.85em;
        padding: 2px 4px;
        min-width: 32px;
    }

    .btn-magnet {
        padding: 3px 6px;
        font-size: 0.7em;
    }

    .btn-hide {
        display: none;
    }

    .btn-fix {
        display: none;
    }

    .btn-trailer {
        display: none;
    }

    .last-refresh-indicator {
        display: none;
    }

    .original-name {
        max-width: 100px;
    }

    .movie-title-hover {
        display: inline-block;
        max-width: 90px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        vertical-align: middle;
    }

    /* DataTables mobile */
    .dataTables_filter, .dataTables_length {
        float: none !important;
        text-align: center !important;
        margin-bottom: 6px;
    }

    .dataTables_filter input {
        width: 120px !important;
    }

    .dataTables_info, .dataTables_paginate {
        float: none !important;
        text-align: center !important;
        margin-top: 6px;
    }

    .dataTables_paginate .paginate_button {
        padding: 3px 6px !important;
        margin: 1px !important;
        font-size: 0.8em;
    }

    /* Movie hover card - disable on mobile */
    .movie-hover-card {
        display: none !important;
    }

    /* Modal adjustments */
    .modal-dialog {
        margin: 8px;
        max-width: calc(100% - 16px);
    }

    .modal-body {
        padding: 12px;
    }

    .privacy-note {
        font-size: 0.7em;
        padding: 4px 8px;
    }
}

/* Small mobile (< 576px) */
@media (max-width: 575.98px) {
    .navbar img {
        height: 24px;
    }

    .btn-category, .btn-time {
        padding: 3px 6px;
        font-size: 0.75rem;
    }

    #refreshBtn {
        padding: 3px 8px;
        font-size: 0.75rem;
    }

    .search-box .form-control {
        padding: 3px 6px;
        font-size: 0.8em;
    }

    .search-box .btn-search {
        padding: 3px 8px;
    }

    /* Even more compact table */
    #moviesTable {
        font-size: 0.7rem;
    }

    .table tbody td, .table thead th {
        padding: 3px 1px;
        font-size: 0.7em;
    }

    .movie-title-hover {
        max-width: 70px;
    }

    .imdb-rating {
        font-size: 0.75em;
        padding: 2px 3px;
        min-width: 28px;
    }

    .btn-magnet {
        padding: 2px 4px;
        font-size: 0.65em;
    }

    .seeders, .leechers {
        font-size: 0.7em;
    }
}
