:root {
    --primary-color: #4CAF50;
    --primary-hover: #45a049;
    --background-dark: #121212;
    --background-light: #1e1e1e;
    --surface-color: #2d2d2d;
    --text-primary: rgba(255, 255, 255, 0.87);
    --text-secondary: rgba(255, 255, 255, 0.6);
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    --transition-speed: 0.3s;
}

td#scraper-source {
    font-size: 13px;
    padding: 8px;
}

/* Container for source badges */
td#scraper-source .source-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
}

/* Style for each badge/tag */
td#scraper-source .source-badge {
    display: block;
    padding: 0px 12px;
    background: linear-gradient(135deg, rgb(53 129 255 / 21%) 0%, rgb(30 141 247 / 34%) 100%);
    border: 1px solid rgb(53 155 255 / 40%);
    border-radius: 8px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 12px;
    text-align: center;
    width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.2s ease;
}

html, body {
    min-height: 100vh;
    height: auto;
    margin: 0;
    padding: 0;
    background-color: var(--background-dark);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}
.loading-message p {
    margin: 0 0 10px 0;
    font-size: 1.1rem;
    color: #fff;
}

/* Loading overlay styles defined in base.css */

body {
    padding-top: 60px;
}

/* Add class to prevent scrolling when modal is open */
body.modal-open {
    overflow: hidden;
    padding-right: 15px; /* Prevent layout shift when scrollbar disappears */
}

#scraper-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-bottom: 30px;
}

form#search-form {
    text-align: center;
    padding: var(--spacing-md);
    background-color: var(--surface-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-radius: var(--border-radius-md);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin: var(--spacing-lg) auto;
    max-width: 600px;
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    opacity: 77%;
    min-width: 70vw;
    margin-top: 10px;
}

form#search-form input, 
form#search-form select, 
form#search-form button {
    padding: var(--spacing-sm) var(--spacing-md);
    background-color: var(--background-light);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-radius: var(--border-radius-sm);
    transition: none;
    -webkit-appearance: none;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

form#search-form input:focus,
form#search-form select:focus,
form#search-form input:active,
form#search-form select:active {
    outline: none;
    border: 1px solid var(--primary-color);
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
    background-color: var(--background-light);
}

/* Override autofill styles */
form#search-form input:-webkit-autofill,
form#search-form input:-webkit-autofill:hover,
form#search-form input:-webkit-autofill:focus,
form#search-form input:-webkit-autofill:active {
    -webkit-text-fill-color: var(--text-primary) !important;
    -webkit-box-shadow: 0 0 0 30px var(--background-light) inset !important;
    box-shadow: none;
    transition: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Additional focus prevention */
form#search-form *:focus {
    outline: none !important;
}

form#search-form input::selection {
    background-color: var(--primary-color);
    color: var(--text-primary);
}

/* For Firefox */
form#search-form input:autofill {
    background-color: var(--background-light) !important;
    color: var(--text-primary) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* For Edge */
form#search-form input:-ms-input-placeholder {
    color: var(--text-primary) !important;
}

.movie-list, .show-list, .anime-list {
    position: relative;
    padding: var(--spacing-md) 0;
    margin: 0 calc(-1 * var(--spacing-md));
    overflow: visible;
}

.scroll-container {
    position: relative;
    display: flex;
    overflow-x: auto;
    gap: 0;
    padding: 40px var(--spacing-md);
    padding-right: 40px;
    margin: -40px 0;
    scroll-behavior: smooth;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE and Edge */
    -webkit-overflow-scrolling: touch;
    width: 100%;
    min-width: 0;
}

.scroll-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

/* Common poster styles */
.media-card,
.sresult {
    flex: 0 0 auto;
    width: 176px;
    transition: transform var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    padding: 16px;
    margin: -8px 8px;
    z-index: 1;
}

/* Apply consistent hover behavior */
.media-card:hover,
.sresult:hover {
    transform: none;
}

/* Ensure consistent poster container styling */
.media-card .poster-container,
.sresult .poster-container {
    position: relative;
    width: 176px;
    height: 264px;
    transition: transform var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(0);
    border-radius: var(--border-radius-lg);
    background-color: #000;
    box-shadow: 
        0 4px 6px rgba(0, 0, 0, 0.2),
        0 0 25px rgba(255, 255, 255, 0.15);
    overflow: hidden;
}

/* Consistent hover transform for both types */
.media-card .poster-container:hover,
.sresult .poster-container:hover {
    box-shadow: 
        0 8px 16px rgba(0, 0, 0, 0.3),
        0 0 50px rgba(255, 255, 255, 0.5);
}

/* Ensure request-icon is consistent */
.media-card .poster-container .request-icon,
.sresult .poster-container .request-icon {
    position: absolute;
    bottom: -6px;
    right: -1px;
    z-index: 10;
    transition: transform var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1), 
                background-color var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 0 40px 40px;
    border-color: transparent transparent var(--primary-color) transparent;
    background-color: transparent !important;
    border-radius: 0 !important;
    transform-origin: bottom right;
    transform: none !important;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
}

/* Mirrored tester-icon */
.media-card .poster-container .tester-icon,
.sresult .poster-container .tester-icon {
    position: absolute;
    bottom: -6px;
    left: -1px;
    z-index: 10;
    transition: transform var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1), 
                background-color var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 40px 0 0 40px;
    border-color: transparent transparent transparent var(--primary-color);
    background-color: transparent !important;
    transform-origin: bottom left;
    transform: none !important;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    cursor: pointer;
}

/* Consistent poster overlay styling */
.media-card .poster-overlay,
.sresult .poster-overlay {
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    padding: var(--spacing-md);
    color: var(--text-primary);
    z-index: 3;
    text-align: center;
    border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
}

/* Remove the old sresult specific image styling */
.sresult img {
    width: 100%;
    height: 100%;
    border-radius: var(--border-radius-lg);
    object-fit: cover;
    position: relative;
    z-index: 1;
}

.media-poster,
.sresult button {
    position: relative;
    width: 176px;
    cursor: pointer;
    z-index: 1;
    display: block;
    padding: 0;
    margin: 0;
    border: none;
    background: none;
    overflow: visible; /* Keep overflow visible to allow glow */
}

.media-poster-img,
.mediatype-tv,
.mediatype-mv {
    transition: box-shadow var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
}

/* Apply the same transitions to search result elements */
.sresult img,
.sresult .mediatype-tv,
.sresult .mediatype-mv {
    transition: box-shadow var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
}

.media-poster-img {
    width: 100%;
    height: 100%;
    border-radius: var(--border-radius-lg);
    object-fit: cover;
    position: relative;
    z-index: 1;
    display: block;
    mask-image: linear-gradient(
        to bottom,
        black 95%,
        transparent 100%
    );
    -webkit-mask-image: linear-gradient(
        to bottom,
        black 95%,
        transparent 100%
    );
}

.poster-container {
    position: relative;
    width: 176px;
    height: 264px;
    transition: transform var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(0);
    border-radius: var(--border-radius-lg);
    background-color: #000; /* Dark background to prevent white edges */
    box-shadow: 
        0 4px 6px rgba(0, 0, 0, 0.2),
        0 0 25px rgba(255, 255, 255, 0.15);
    overflow: hidden; /* Ensure the triangle is cut off at the poster boundaries */
}

.poster-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30%;
    background: linear-gradient(to top, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.80) 60%, rgba(0, 0, 0, 0.6) 85%, transparent 100%);
    z-index: 2;
    border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
    pointer-events: none; /* Allow clicks to pass through */
}

/* Add a darkening gradient overlay for the bottom 5% */
.poster-container::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 5%;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.8) 100%);
    z-index: 2;
    border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
    pointer-events: none;
}

/* Apply the same box-shadow to search result images */
.sresult img {
    width: 176px;
    height: 264px;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    object-fit: cover;
    position: relative;
    z-index: 1;
    box-shadow: 
        0 4px 6px rgba(0, 0, 0, 0.2),
        0 0 25px rgba(255, 255, 255, 0.15);
}

.mediatype-tv, .mediatype-mv {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 4px 8px;
    border-radius: 12px;
    background-color: rgba(0, 0, 0, 0.75);
    color: var(--text-primary);
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 2;
    backdrop-filter: blur(4px);
    pointer-events: none;  /* Ensure hover works through the badge */
}

.mediatype-tv, .mediatype-mv {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 4px 8px;
    border-radius: 12px;
    background-color: rgba(0, 0, 0, 0.75);
    color: var(--text-primary);
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 2;
    backdrop-filter: blur(4px);
    pointer-events: none;  /* Ensure hover works through the badge */
}

.sresult .mediatype-tv,
.sresult .mediatype-mv {
    top: 8px;
    left: 8px;
}

.media-title,
.searchresult-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--spacing-md);
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    color: var(--text-primary);
    opacity: 0;
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    backdrop-filter: blur(4px);
    z-index: 2;
    border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
}

.searchresult-info {
    display: block;
}

.media-title {
    display: block;
}

/* Title/Year overlay for posters - now positioned over the ::after gradient */
.poster-overlay {
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    padding: var(--spacing-md);
    background: none; /* Remove background as it's now handled by ::after */
    color: var(--text-primary);
    z-index: 3; /* Above the gradient */
    text-align: center;
    border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
}

.poster-overlay h3 {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #ffffff; /* Pure white */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8); /* Add shadow for better readability */
}

.poster-overlay p {
    margin: 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7); /* Lighter grey */
    opacity: 1; /* Override previous opacity */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8); /* Add shadow for better readability */
}

/* Keep hover effects for regular media items */
.media-poster:hover .poster-container {
    box-shadow: 
        0 8px 16px rgba(0, 0, 0, 0.3),
        0 0 50px rgba(255, 255, 255, 0.5);
}

/* Override the template-defined animation for request-icon */
.media-poster:hover .request-icon {
    transform: none !important;
}

/* Enhanced media poster image box-shadow on hover (keep this enhancement) */
.media-poster:hover .media-poster-img {
    /* No separate box-shadow needed as it's on the container */
    transform: none !important; /* Force no transform on the img itself */
}

.poster-container .request-icon {
    position: absolute;
    bottom: -6px;
    right: -1px;
    z-index: 10;
    transition: transform var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1), 
                background-color var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    /* Corner triangle styling */
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 0 40px 40px; /* Larger triangle */
    border-color: transparent transparent var(--primary-color) transparent;
    background-color: transparent !important; /* Override any background */
    transform-origin: bottom right;
    transform: none !important;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
}

/* Style for the plus icon that sits inside the triangle */
.poster-container .request-icon::after {
    content: "+";
    position: absolute;
    bottom: -30px; /* Adjusted for larger triangle */
    right: 5px; /* Adjusted for larger triangle */
    color: white;
    font-size: 18px; /* Slightly larger for better visibility */
    font-weight: bold;
    line-height: 1;
}
/* Style specifically for search results to adjust the plus size */
.sresult .poster-container .request-icon::after {
    font-size: 12px; /* Smaller font size to better match trending page */
    bottom: -28px; /* Further adjust vertical position */
    right: 8px;
    scale: 1.2;
}

/* Only scale when directly hovering the icon */
.request-icon:hover {
    transform: scale(1) !important;
    border-color: transparent transparent #2980b9 transparent;
    background-color: transparent !important;
}

/* Hover styles for tester-icon */
.tester-icon:hover {
    transform: none !important;
    border-color: transparent transparent transparent #2980b9;
    background-color: transparent !important;
}

/* Fix for combined hover - override template styles */
.media-poster:hover .request-icon:hover {
    transform: scale(1) !important;
    border-color: transparent transparent #2980b9 transparent;
    background-color: transparent !important;
}

/* Fix for combined hover - tester-icon */
.media-poster:hover .tester-icon:hover {
    transform: none !important;
    border-color: transparent transparent transparent #2980b9;
    background-color: transparent !important;
}

/* Apply same hover animations for search results */
.sresult:hover {
    z-index: 2; /* Keep raised z-index on hover */
}

/* Ensure nested elements in search results don't have their own transforms */
.sresult:hover .poster-container,
.sresult:hover .media-poster,
.sresult:hover .media-poster-img {
    transform: none !important; /* Prevent double animations */
}

/* Apply same hover animations for search results */
.sresult:hover .mediatype-tv,
.sresult:hover .mediatype-mv {
    transform: none !important;
}

/* Keep effects for regular media titles */
.media-poster:hover .media-title {
    opacity: 1;
    transform: none !important; /* Don't move the title independently */
}

/* Apply enhanced box-shadow for search results */
.sresult:hover img {
    box-shadow: 
        0 8px 16px rgba(0, 0, 0, 0.3),
        0 0 50px rgba(255, 255, 255, 0.5);
    transform: none; /* No transform on the img itself */
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
}

/* Move glow effect to the media-poster for search results */
.sresult .media-poster {
    overflow: visible;
}

.sresult:hover .media-poster::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: var(--border-radius-lg);
    box-shadow: none;
    z-index: -1;
    pointer-events: none;
}

/* Remove the effect from the sresult itself */
.sresult:hover::after {
    content: none;
}

/* Apply same effects for search result info */
.sresult:hover .searchresult-info {
    opacity: 1;
    transform: none; /* No transform as it's on the card itself */
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
}

/* Apply hover effects for search results without TMDB API key */
.no-tmdb-api .media-poster:hover .media-title,
.no-tmdb-api .sresult:hover .searchresult-info,
.placeholder-poster:hover + .media-title,
.placeholder-poster:hover + .searchresult-info {
    transform: none; /* Remove transform as it's now on the parent */
}

/* Ensure the badge stays visible for placeholder posters */
.no-tmdb-api .mediatype-tv,
.no-tmdb-api .mediatype-mv,
.placeholder-poster + .mediatype-tv,
.placeholder-poster + .mediatype-mv {
    opacity: 1;
}

.no-tmdb-api .media-title,
.no-tmdb-api .searchresult-info,
.placeholder-poster + .media-title,
.placeholder-poster + .searchresult-info {
    opacity: 1;
    transform: translateY(0);
    display: block;
}

.no-tmdb-api .media-poster:hover .media-title,
.no-tmdb-api .sresult:hover .searchresult-info,
.placeholder-poster:hover + .media-title,
.placeholder-poster:hover + .searchresult-info {
    transform: none; /* Remove transform as it's now on the parent */
}

/* Add styles for placeholder images */
.placeholder-poster {
    width: 176px !important;
    height: 264px !important;
    object-fit: cover !important;
}

h2.searchresult-item {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.2;
    color: var(--text-primary);
}

.season-info-container {
    display: flex;
    align-items: flex-start;
    position: relative;
    z-index: 1;
    padding-top: 20px;
    padding-bottom: 20px;
    border-radius: 10px;
    height: 300px;
}

.season-poster {
    height: 100%;
    object-fit: cover;
    margin-right: 20px;
    flex-shrink: 0;
    margin-left: 10px;
}

.season-details {
    flex: 1;
    max-width: 950px;
    background-color: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: 4px;
    max-height: 300px;
    position: relative;
}

.season-details > p {
    font-style: italic;
    font-size: 0.9rem;
}

.season-details .season-overview p {
    font-style: normal;
}

.season-overview {
    height: 7em; /* Approximately 2 lines of text */
    overflow: hidden;
    position: relative;
}

.season-controls {
    display: inline-flex;
    gap: var(--spacing-sm);
    align-items: center;
    padding: var(--spacing-sm);
    border-radius: var(--border-radius-md);
    margin-top: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    margin-left: 10px;
    z-index: 2;
    position: relative;
}

.season-controls select,
.season-controls button {
    padding: var(--spacing-sm) var(--spacing-md);
    background-color: var(--background-light);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-speed) ease;
    min-width: 120px;
}

.season-controls button {
    background-color: var(--primary-color);
    cursor: pointer;
}

.season-controls button:hover {
    background-color: var(--primary-hover);
}

.season-controls select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.season-overview p {
    margin: 0;
    position: absolute;
    width: 100%;
    max-width: 900px;
    max-height: 7em;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.season-bg-image {
    position: absolute;
    top: -200px;
    left: 0;
    width: 100%;
    height: 1200px;
    background-size: cover;
    background-position: left calc((24vw - 170px) - 340px) top;
    z-index: -1;
}

body {
    background: linear-gradient(to bottom, #333 0px, #333 450px, #000 650px) !important;
    background-attachment: initial !important;
}

.season-bg-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, 
        rgba(0, 0, 0, 1) 0%,
        rgba(0, 0, 0, 0.7) 20%,
        rgba(0, 0, 0, 0) 40%,
        rgba(0, 0, 0, 0.6) 50%,
        rgba(0, 0, 0, 1) 100%
    );
}

#episodeResults > div {
    position: relative;
    width: auto;
    max-width: 1600px;
    margin: 0 auto;
    /*top: 140px;*/
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    justify-items: center !important;
    /*margin-top: 190px;*/
    margin-bottom: 170px;
}

.episode {
    width: 100%;
    max-width: 300px;
    transition: transform var(--transition-speed) ease;
    background-color: var(--surface-color);
    border-radius: var(--border-radius-md);
    overflow: hidden;
}

.episode button {
    border-radius: var(--border-radius-md);
    background-color: rgba(22, 21, 21, 0.5);
    padding: 8px;
    border: none;
    width: 100%;
    cursor: pointer;
    transition: transform var(--transition-speed) ease;
}

.episode button:hover {
    transform: scale(1.02);
}

.episode button:disabled {
    cursor: default;
}

.episode button:disabled:hover {
    transform: none;
}

.episode img {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: 8px;
}

.episode-info {
    flex: 1;
}

p.episode-sub {
    font-size: .888rem;
    line-height: 3rem;
    color: rgb(191 191 190);
}

p.episode-sub img {
    width: 15px;
    height: auto;
    margin-right: 3px;
    vertical-align: bottom;
}

.episode-rating {
    position: absolute;
    margin: 5px;
    width: 27px;
    height: 15px;
    color: rgb(255 255 255 / 80%);
    font-size: 12px;
    font-weight: bold;
    line-height: 16px;
    text-align: center;
    border-radius: 11px;
    background: linear-gradient(to right, rgba(24, 170, 135, 1) 0%, rgba(1, 144, 182, 1) 100%);
    z-index: 1;
}

h2.episode-title {
    font-size: 0.999rem;
    line-height: 1.3rem;
    color: rgb(191 191 190);
    margin-block-end: -10px;
    padding-top: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    max-width: 280px;
}

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(8px);
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-top: 30px;
}

.overlay-content {
    position: relative;
    background-color: var(--surface-color);
    /* padding: 0 20px 20px 20px; */
    border-radius: var(--border-radius-lg);
    width: 85%;
    max-width: 1200px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.24);
    border: 1px solid rgba(255, 255, 255, 0.1);
    scrollbar-width: none;
    -ms-overflow-style: none;
    margin-top: 0;
    display: flex;
    flex-direction: column;
}

.overlay-content h3 {
    position: sticky;
    top: 0;
    background-color: var(--surface-color);
    margin-top: 0;
    padding-top: 10px;
    padding-bottom: 15px;
    margin-bottom: 15px;
    z-index: 3;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.close-btn {
    position: sticky;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 32px;
    font-size: 24px;
    border: none;
    background-color: transparent;
    color: var(--text-secondary);
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    z-index: 5;
    margin-left: auto;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.overlay-content table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    table-layout: fixed; /* Ensures fixed column widths */
}

.overlay-content thead {
    position: sticky;
    top: 55px; /* Position below the modal title */
    background-color: var(--surface-color);
    z-index: 2;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.overlay-content th {
    padding: 12px;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    background-color: var(--surface-color);
}

.overlay-content td {
    padding: 12px;
    text-align: left;
    border-bottom: none;
    width: auto; /* Allow columns to size naturally */
    vertical-align: middle; /* Explicitly align all cells vertically */
}

/* Title column - allow wrapping */
.overlay-content td .torrent-title-wrapper {
    max-height: 4.5em; /* Match line-height * line-clamp */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    line-height: 1.5em; /* Set a consistent line height */
    word-wrap: break-word;
    white-space: normal;
}

.overlay-content td:first-child {
    width: 90%; /* Give title column more space */
    white-space: normal;
}

/* Cache status column */
.overlay-content td:nth-child(2) {
    width: 25%;
    text-align: center;
}

/* Action column */
.overlay-content td:last-child {
    width: 25%;
    text-align: center;
}

/* Cache status badges */
.cache-status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: bold;
    margin-left: 5px;
    text-align: center;
    min-width: 80px;
}

.cached {
    background-color: #4CAF50;
    color: white;
}

.not-cached {
    background-color: #F44336;
    color: white;
}

.not-checked {
    background-color: #9E9E9E;
    color: white;
    animation: pulse 1.5s infinite;
}

.check-unavailable {
    background-color: #607D8B;
    color: white;
}

.unknown {
    background-color: #FF9800;
    color: white;
}

/* Status update animation */
.status-updated {
    animation: highlight 1s ease-in-out;
}

@keyframes highlight {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 10px 5px rgba(255, 255, 255, 0.7);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
}

/* Cache check completion indicator */
.cache-check-complete {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    font-size: 14px;
    z-index: 1000;
    animation: fadeInOut 3s ease-in-out forwards;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.cache-check-complete:before {
    content: '✓';
    color: #4CAF50;
    font-size: 16px;
    margin-right: 8px;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(20px); }
    10% { opacity: 1; transform: translateY(0); }
    80% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-20px); }
}

@keyframes pulse {
    0% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.6;
    }
}

.torresult {
    width: 300px;
    margin-bottom: 5px;
    border-radius: var(--border-radius-md);
    background-color: var(--surface-color);
    padding: var(--spacing-md);
    transition: transform var(--transition-speed) ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.torresult:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.torresult button {
    background-color: #f9080800;
    border: solid;
    border-color: #2220;
    padding: 10px;
}

p.torresult-item {
    font-size: 0.999rem;
    line-height: 1.3rem;
    color: rgb(191 191 190);
    text-align: center;
    word-break: normal;
    overflow-wrap: anywhere;
    white-space: normal;
    hyphens: none;
}

p.torresult-title {
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    line-height: 1.3rem;
    color: rgb(191 191 190);
    text-align: left;
}

/* Custom scrollbar styles */
#overlayContentRes > div::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

#overlayContentRes > div {
    padding-top: 10px;
    max-width: 1024px; /* (300px * 5) + (20px * 4) for gaps */
    min-width: 312px;
    margin: 0 auto; /* Centers the container if it's narrower than its parent */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE and Edge */
}

#trending-rating, #trending-watchers {
    display: none;
}

#trendingContainer {
    max-width: 85vw;
}

/* Search results container styles */
.search-results-container {
    background-color: #1e1e1e;
    border-radius: var(--border-radius-md);
    padding: var(--spacing-md);
    margin: var(--spacing-lg) auto;
    width: 95%;
    max-width: 1200px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: var(--spacing-sm);
}

.search-results-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.search-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
    row-gap: 40px;
    column-gap: var(--spacing-md);
    justify-items: center;
    margin: 30px;
}

/* Adjust sresult for grid layout */
.sresult {
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
}

/* Media queries for better responsive design */
@media (max-width: 768px) {
    .movie-list, .show-list {
        gap: var(--spacing-sm);
        padding: var(--spacing-sm);
    }
    
    .media-card,
    .sresult {
        width: 140px;
    }
    
    .media-poster,
    .sresult button {
        width: 140px;
    }
    
    .media-poster-img,
    .sresult img {
        width: 140px;
        height: 210px;
    }
    
    .media-title,
    .searchresult-info {
        padding: var(--spacing-sm);
    }
    
    .media-title h2,
    .searchresult-info h2 {
        font-size: 0.9rem;
    }
    
    .media-title p,
    .searchresult-info p {
        font-size: 0.8rem;
    }
    
    .show-rating {
        width: 32px;
        height: 32px;
        font-size: 14px;
        line-height: 32px;
    }

    /* Responsive search results container */
    .search-results-container {
        width: 100%;
        padding: var(--spacing-sm);
    }

    .search-results-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: var(--spacing-sm);
    }
}

.show-rating {
    position: absolute;
    right: var(--spacing-md);
    top: var(--spacing-md);
    width: 40px;
    height: 40px;
    color: white;
    font-size: 16px;
    font-weight: bold;
    line-height: 40px;
    text-align: center;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(64, 64, 64, 0.95), rgba(32, 32, 32, 0.85));
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 2;
}

.media-title h2,
.searchresult-info h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.media-title p,
.searchresult-info p {
    margin: 4px 0 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.placeholder-poster {
    background-color: var(--surface-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Ensure title is always visible for placeholder posters */
.placeholder-poster + .media-title,
.placeholder-poster + .searchresult-info {
    opacity: 1;
    transform: translateY(0);
    display: block;
}

.overlay-content td button {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: bold;
    text-transform: uppercase;
    width: 90%; /* Take up most of the cell width */
    max-width: 200px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background-color: var(--primary-color);
    border: none;
    color: white;
    margin: 5px 0;
    cursor: pointer;
    transition: background-color var(--transition-speed) ease;
}

.overlay-content td button:hover {
    background-color: var(--primary-hover);
}

/* Remove glow effect for normal media cards (revert changes) */
.media-card:hover {
    z-index: auto;
}

.media-card:hover::after {
    content: none;
}

.trending-nav-button {
    background-color: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6); /* Light grey when active but not hovered */
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.trending-nav-button:hover {
    color: rgba(255, 255, 255, 1); /* Brighter white when hovered */
    background-color: rgba(255, 255, 255, 0.1);
}

.trending-nav-button:disabled {
    opacity: 0.5;
    cursor: default;
    pointer-events: none;
}

/* Additional styling for the trending navigation section */
.trending-navigation {
    display: flex;
    gap: 8px;
}

/* Normalize hover animation distances between search results and media posters */
.media-card {
    transition: transform var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
}

.media-card:hover {
    transform: none; /* Keep this to ensure consistency with posters */
}

.media-poster:hover .poster-overlay {
    transform: translateY(0); /* Keep overlay aligned with container during animation */
}

/* Style for the plus icon that sits inside the tester-icon triangle */
.tester-icon::after {
    content: "⚙";
    position: absolute;
    bottom: 8px;
    left: -35px;
    color: white;
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
    scale: 0.7;
}

.overlay-content {
    padding-top: 0px !important;
}

/* Shared style for action buttons in table */
.overlay-content td button.action-button {
    width: calc(100% - 10px); /* Adjust width */
    max-width: 100px; /* Limit max width */
    margin: 2px 5px; /* Adjust margin */
    padding: 4px 8px; /* Adjust padding */
    font-size: 0.8em;
}

.overlay-content td button.add-button:hover {
    background-color: var(--primary-hover); /* Darker green */
}

/* --- NEW: Style for Assign button --- */
.overlay-content td button.assign-button {
    background-color: #FFC107; /* Amber color */
    color: #333; /* Darker text for better contrast on amber */
}

.overlay-content td button.assign-button:hover {
    background-color: #FFA000; /* Darker amber */
}
/* --- END NEW --- */

.filtered-out-item td,
.torresult.filtered-out-item .torresult-info p {
    color: #ff7b7b !important; /* Light red text */
}

/* Style for filter reason in score column */
.filtered-out-item td:nth-child(4) {
    color: #ff6b6b !important; /* Brighter red for filter reason */
    font-style: italic;
    font-size: 0.9em;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: help;
    position: relative;
}

/* Remove CSS tooltips - we'll use JavaScript instead */

.torresult.filtered-out-item {
    background-color: transparent !important; /* Override any potential base color */
}

/* Style for filter reason in mobile view */
.torresult.filtered-out-item .torresult-item:first-of-type {
    /* No special styling needed here anymore */
}

tr.filtered-out-item {
    background-color: rgba(255, 0, 0, 0.05) !important;
}

tr.filtered-out-item:hover {
    background-color: rgba(255, 0, 0, 0.15) !important; 
}

/* Ensure normal items don't get overridden if they also match a generic 'tr' hover */
.overlay-content tbody tr:not(.filtered-out-item):hover {
    background-color: rgba(255, 255, 255, 0.05); /* Or your default hover color */
}

/* ========================================
   Optimized Torrent Overlay Styles
   ======================================== */

/* Torrent Table Structure */
.torrent-table {
    width: 100%;
    border-collapse: collapse;
}

.torrent-table-header {
    color: rgb(191 191 190);
}

.torrent-name-cell {
    width: 38%;
    font-weight: 600;
    text-transform: uppercase;
    color: rgb(191 191 190);
    word-wrap: break-word;
    white-space: normal;
    padding: 10px;
}

.torrent-name-wrapper {
    display: block;
    line-height: 1.4;
    min-height: fit-content;
}

.torrent-size-cell {
    width: 12%;
    text-align: right;
    color: rgb(191 191 190);
}

.torrent-source-cell {
    width: 10%;
    color: rgb(191 191 190);
}

.torrent-score-cell {
    width: 10%;
    text-align: right;
    color: rgb(191 191 190);
}

.torrent-cache-cell {
    width: 10%;
    text-align: center;
    color: rgb(191 191 190);
}

.torrent-action-cell {
    width: 10%;
    text-align: center;
    color: rgb(191 191 190);
}

/* Mobile Torrent Grid */
.torrent-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

/* Virtualization container */
.torrent-results-container {
    position: relative;
    min-height: 200px;
}

.torrent-results-spacer {
    width: 100%;
}

/* Loading more indicator */
.loading-more-torrents {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

#version-select {
    display: none;
}

.db-status-partial {
    background-color: #2196F3;
    color: white;
}

/* Apply same hover animations for search results */
.sresult:hover .mediatype-tv,
.sresult:hover .mediatype-mv {
    transform: none !important;
}/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    overflow-x: hidden;
}

.mt-4 {
    margin-top: 1.5rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.ms-2 {
    margin-left: 0.5rem;
}

/* Alert styles */
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.25rem;
}

.alert-warning {
    background-color: #2c2c2c;
    border-color: #444;
    color: #f4f4f4;
}

/* Navigation tabs */
.nav-tabs {
    display: flex;
    border-bottom: 1px solid #444;
    margin-bottom: 1rem;
    padding-left: 0;
    list-style: none;
}

.nav-item {
    margin-bottom: -1px;
}

.nav-link {
    display: block;
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: #f4f4f4;
    background: none;
    border: 1px solid transparent;
    border-radius: 0.25rem 0.25rem 0 0;
}

.nav-link:hover {
    border-color: #444;
    background-color: #2a2a2a;
}

.nav-link.active {
    color: #fff;
    background-color: #1a1a1a;
    border-color: #444 #444 transparent;
}

/* Letter navigation */
.letter-nav {
    margin: 2rem 0;
    background-color: #1a1a1a;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid #444;
    text-align: center;
    overflow-x: auto;
}

.letter-nav .d-flex {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem;
    padding: 0 1rem;
    min-width: min-content;
}

.letter-nav .btn {
    min-width: 2.5rem;
    padding: 0.5rem;
}

.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    font-weight: 400;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 0.25rem;
    transition: all 0.15s ease-in-out;
}

.btn-primary {
    background-color: #007bff;
    border-color: #0056b3;
    color: #fff;
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #004085;
}

.btn-outline-light {
    color: #f4f4f4;
    border-color: #f4f4f4;
    background: transparent;
}

.btn-outline-light:hover {
    background-color: #f4f4f4;
    color: #1a1a1a;
}

/* Grid layout */
.row {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1rem;
    margin: 0 auto;
    max-width: 800px;
    padding: 0 1rem;
}

@media (min-width: 768px) {
    .row {
        grid-template-columns: repeat(2, minmax(0, 400px));
        justify-content: center;
    }
}

@media (min-width: 992px) {
    .row {
        grid-template-columns: repeat(2, minmax(0, 400px));
        max-width: 850px;
    }
}

/* Card styles */
.card {
    background-color: #1a1a1a;
    border: 1px solid #444;
    border-radius: 0.25rem;
    overflow: hidden;
    width: 100%;
}

.card-header {
    padding: 0.8rem 1.25rem;
    background-color: #1a1a1a;
    border-bottom: 1px solid #444;
}

.btn-link {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    color: #f4f4f4;
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    min-width: 0;
}

.btn-link span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 0.5rem;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
    background-color: #6c757d;
    color: #fff;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    overflow-y: auto;
    padding: 1rem;
}

.modal.show {
    display: block;
}

.modal-dialog {
    position: relative;
    width: auto;
    margin: 3rem auto;
    max-width: 800px;
    display: flex;
    align-items: flex-start;
    min-height: calc(100% - 6rem);
}

.modal-content {
    position: relative;
    background-color: #1a1a1a;
    border: 1px solid #444;
    border-radius: 0.3rem;
    outline: 0;
    width: 100%;
    margin: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid #444;
}

.modal-title {
    margin: 0;
    color: #f4f4f4;
}

.btn-close {
    background: transparent;
    border: 0;
    color: #f4f4f4;
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-body {
    position: relative;
    padding: 1rem;
    max-height: 70vh;
    overflow-y: auto;
}

/* Version items */
.version-item {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background-color: #2a2a2a;
    border-radius: 0.25rem;
    border: 1px solid #444;
    color: #f4f4f4;
    cursor: pointer;
    width: 100%;
    text-align: left;
}

.version-item:hover {
    background-color: #333;
}

.text-muted {
    color: #aaa;
}

/* Utility classes */
.d-flex {
    display: flex;
}

.justify-content-between {
    justify-content: space-between;
}

.align-items-center {
    align-items: center;
}

.w-100 {
    width: 100%;
}

.text-light {
    color: #f4f4f4;
}

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

.bg-dark {
    background-color: #1a1a1a;
}

.bg-secondary {
    background-color: #6c757d;
}


/* ========================================
   Inline CSS from scraper.html
   ======================================== */
.trending-container p {
    font-style: italic;
    color: #888;
    text-align: center;
}

.tmdb-info {
    margin-top: 10px;
    margin-bottom: 0px;
    padding: 10px;
    color: #be1600;
    font-style: italic;
    text-align: center;
}

.requester-notice {
    background-color: #f39c12;
    color: white;
    padding: 10px 15px;
    text-align: center;
    border-radius: 5px;
    margin: 10px 0;
    font-weight: bold;
}

.loading {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

/* Table styles */
table {
    border-spacing: 0;
    border-collapse: separate;
}

td, th {
    padding: 10px;
    vertical-align: middle;
}

tr {
    line-height: 1.4;
}

/* Cache status badges */
.cache-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: bold;
    text-transform: uppercase;
    margin-top: 5px;
    min-width: 40px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cache-status.cached {
    background-color: #4CAF50;
    color: white;
}

.cache-status.not-cached {
    background-color: #f44336;
    color: white;
}

.cache-status.not-checked {
    background-color: #9e9e9e;
    color: white;
}

.cache-status.check-unavailable {
    background-color: #607D8B;
    color: white;
}

.cache-status.unknown {
    background-color: #607d8b;
    color: white;
}

/* Simple CSS reset for checkbox */
#skip-cache-check {
    /* Reset to browser defaults */
    -webkit-appearance: checkbox !important;
    -moz-appearance: checkbox !important;
    appearance: checkbox !important;
    
    /* Remove any custom styling */
    all: revert !important;
    
    /* Optional: add minimal styling if needed */
    margin-right: 5px !important;
    vertical-align: middle !important;
}

.checkbox-container label {
    cursor: pointer !important;
    vertical-align: middle !important;
}

#skip-cache-check-container {
    display: none !important;
}


.checkbox-container input[type="checkbox"] {
    all: revert !important;
}

/* Request icon styling - Current blue plus style */
.request-icon {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: #3498db; /* Blue */
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
}

.request-icon:hover {
    transform: scale(1.1);
    background-color: #2980b9; /* Darker blue on hover */
}

/* Additional color options - Uncomment to use

/* Purple style 
.request-icon {
    background-color: #9b59b6;
}
.request-icon:hover {
    background-color: #8e44ad;
}
*/

/* Teal style 
.request-icon {
    background-color: #1abc9c;
}
.request-icon:hover {
    background-color: #16a085;
}
*/

/* Orange style 
.request-icon {
    background-color: #e67e22;
}
.request-icon:hover {
    background-color: #d35400;
}
*/

/* Make request icon follow poster hover animation */
.media-poster:hover .request-icon {
    transform: translateY(0px);
}

/* Combine hover effects when hovering directly on the icon */
.media-poster:hover .request-icon:hover {
    transform: translateY(0px) scale(1);
    background-color: #2980b9; /* Match the darker blue for consistency */
}

.request-icon svg {
    width: 18px;
    height: 18px;
}

/* Version Modal Styles */
.version-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.version-modal-content {
    background-color: #333;
    padding: 20px;
    border-radius: 5px;
    width: 300px;
    max-width: 90%;
    color: white;
}

.version-modal h3 {
    margin-top: 0;
    margin-bottom: 15px;
    text-align: center;
}

.version-checkbox {
    margin-bottom: 10px;
}

.version-checkbox input[type="checkbox"] {
    margin-right: 10px;
}

.version-modal-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.version-modal-buttons button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.version-modal-buttons button:first-child {
    background-color: #2ecc71;
    color: white;
}

.version-modal-buttons button:last-child {
    background-color: #7f8c8d;
    color: white;
}

.media-poster {
    position: relative;
}

/* Season selection styles */
.version-section-header {
    margin: 15px 0 10px;
    border-bottom: 1px solid #555;
    padding-bottom: 5px;
}

.version-section-header h4 {
    margin: 0;
    font-size: 16px;
    color: #ccc;
}

.selection-type-container {
    margin: 10px 0;
}

.selection-type-option {
    margin-bottom: 8px;
}

.selection-type-option input[type="radio"] {
    margin-right: 8px;
}

.season-selection-container {
    margin: 10px 0;
    max-height: 200px;
    overflow-y: auto;
    padding: 5px;
    background-color: #444;
    border-radius: 4px;
}

.seasons-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.season-checkbox {
    margin-bottom: 5px;
}

hr {
    border: 0;
    height: 1px;
    background-color: #555;
    margin: 15px 0;
}

.sresult {
    position: relative;
    margin-bottom: 15px;
    transition: transform var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    overflow: visible;
    margin: -8px 8px; /* Restore original margin */
    z-index: 1;
}

.sresult .media-poster {
    position: relative;
    display: inline-block;
    overflow: visible;
    border-radius: 5px;
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
}

/* Apply hover effects to search results - THE ENTIRE CARD */
.sresult:hover {
    transform: translateY(0px);
    z-index: 2;
}

/* Remove the transform from the inner poster since it's now on the card */
.sresult:hover .media-poster {
    transform: none;
}

.sresult .media-poster img {
    max-width: 100%;
    display: block;
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 4px 6px rgba(0, 0, 0, 0.2),
        0 0 25px rgba(255, 255, 255, 0.15);
    border-radius: var(--border-radius-lg);
}

/* Apply box-shadow enhancement to the img on hover */
.sresult:hover .media-poster img {
    box-shadow: 
        0 8px 16px rgba(0, 0, 0, 0.3),
        0 0 50px rgba(255, 255, 255, 0.5);
}

/* Reduce glow intensity to match trending items */
.sresult:hover .media-poster::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: var(--border-radius-lg);
    box-shadow: none;
    z-index: -1;
    pointer-events: none;
}

/* Remove the effect from the sresult itself */
.sresult:hover::after {
    content: none;
}

.sresult .searchresult-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--spacing-md);
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    color: var(--text-primary);
    opacity: 0;
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    backdrop-filter: blur(4px);
    z-index: 2;
    border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
}

/* Make the info section visible on hover */
.sresult:hover .searchresult-info {
    opacity: 1;
}

.sresult .request-icon {
    position: absolute;
    bottom: 10px;
    right: 10px;
    z-index: 5;
}

/* No need for separate transform on the icon, it will move with the card */
.sresult:hover .request-icon {
    transform: none;
}

/* Maintain the icon hover effect */
.sresult .request-icon:hover {
    transform: scale(1.1);
    background-color: #2980b9;
}

/* Style for the Request Season button */
#requestSeasonButton {
    background-color: #3498db;
}

#requestSeasonButton:hover {
    background-color: #2980b9;
}

#searchResults {
    min-width: 95%;
}

/* Search results container similar to trending container */
.search-results-container {
    background-color: #1e1e1e;
    border-radius: var(--border-radius-md);
    padding: var(--spacing-md);
    margin: var(--spacing-lg) auto;
    width: 95%;
    max-width: 1200px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: var(--spacing-sm);
}

.search-results-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.search-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
    gap: var(--spacing-md);
    justify-items: center;
    row-gap: 40px;
}

/* Adjust sresult for grid layout */
.sresult {
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
}

/* DB Status Pip Styles */
.poster-container {
    position: relative; /* Ensure the container is positioned for the absolute pip */
}

.db-status-pip {
    position: absolute;
    top: 8px; /* Adjust as needed */
    right: 8px; /* Adjust as needed */
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.5); /* Optional border */
    z-index: 10; /* Ensure it's above the poster image/overlay */
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.db-status-collected {
    background-color: #4CAF50; /* Green */
}

.db-status-blacklisted {
    background-color: #f44336; /* Red */
}

.db-status-processing {
    background-color: #f39c12; /* Yellow/Orange */
}

/* New: partially collected (mix) */
.db-status-partial {
    background-color: #2196F3; /* Blue */
    color: white;
}

/* Bitrate tooltip styling */
td[data-bitrate]:hover::after,
span[data-bitrate]:hover::after {
    content: attr(data-bitrate);
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.85em;
    white-space: nowrap;
    z-index: 1000;
    margin-top: 25px;
    margin-left: -50px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Ensure tooltips appear above overlay content */
.overlay-content td[data-bitrate] {
    position: relative;
}

/* Back Button Styles */
.back-button-container {
    display: none; /* Hidden by default, shown via JavaScript */
}

.back-button {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.back-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.back-button svg {
    width: 16px;
    height: 16px;
}

/* Hide back button on mobile */
@media (max-width: 768px) {
    .back-button-container {
        display: none !important;
    }
}

/* ==================================================
   DRAG AND DROP SCRAPER PRIORITY STYLES
   ================================================== */

/* Drag handle */
.drag-handle {
    cursor: grab;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.4);
    margin-right: 12px;
    padding: 4px 8px;
    user-select: none;
    transition: color 0.2s ease, transform 0.2s ease;
    display: inline-block;
    line-height: 1;
}

.drag-handle:hover {
    color: rgba(255, 255, 255, 0.7);
    transform: scale(1.1);
}

.drag-handle:active {
    cursor: grabbing;
    color: rgba(255, 255, 255, 0.9);
}

/* Sortable ghost (element being dragged) */
.sortable-ghost {
    opacity: 0.4;
    background-color: rgba(76, 175, 80, 0.1);
    border: 2px dashed rgba(76, 175, 80, 0.5);
}

/* Sortable chosen (element selected for dragging) */
.sortable-chosen {
    background-color: rgba(76, 175, 80, 0.05);
}

/* Sortable drag (the actual dragging element) */
.sortable-drag {
    opacity: 0.8;
    cursor: grabbing !important;
    transform: rotate(2deg);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    .drag-handle {
        font-size: 20px;
        padding: 8px 12px;
        margin-right: 8px;
    }

    /* Larger touch target for mobile */
    .drag-handle::before {
        content: '';
        position: absolute;
        top: -10px;
        left: -10px;
        right: -10px;
        bottom: -10px;
    }
}

/* Touch device specific */
@media (hover: none) and (pointer: coarse) {
    .drag-handle {
        color: rgba(255, 255, 255, 0.6);
    }

    .sortable-ghost {
        opacity: 0.6;
    }
}

/* Ensure drag handle is positioned correctly in header */
.settings-section-header {
    position: relative;
    display: flex;
    align-items: center;
}

.settings-section-header .drag-handle {
    position: relative;
}

/* ========================================
   SKELETON PLACEHOLDERS FOR SSR
   ======================================== */

/* Skeleton shimmer animation */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* Apply shimmer to images while loading */
.media-poster-img {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite linear;
}

/* Remove shimmer once image is loaded */
.media-poster-img[src]:not([src=""]) {
    animation: none;
    background: none;
}

/* Skeleton placeholder for poster containers */
.poster-container.loading {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite linear;
    border-radius: var(--border-radius-md);
}

/* Smooth fade-in when content loads */
.media-poster {
    opacity: 0;
    animation: fadeIn 0.3s ease-in forwards;
}

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

/* Stagger animation for trending items */
.scroll-container .media-poster:nth-child(1) { animation-delay: 0ms; }
.scroll-container .media-poster:nth-child(2) { animation-delay: 50ms; }
.scroll-container .media-poster:nth-child(3) { animation-delay: 100ms; }
.scroll-container .media-poster:nth-child(4) { animation-delay: 150ms; }
.scroll-container .media-poster:nth-child(5) { animation-delay: 200ms; }
.scroll-container .media-poster:nth-child(6) { animation-delay: 250ms; }
.scroll-container .media-poster:nth-child(7) { animation-delay: 300ms; }
.scroll-container .media-poster:nth-child(8) { animation-delay: 350ms; }
.scroll-container .media-poster:nth-child(9) { animation-delay: 400ms; }
.scroll-container .media-poster:nth-child(10) { animation-delay: 450ms; }

/* Skeleton state for empty containers during SSR */
.scroll-container:empty::before {
    content: '';
    display: block;
    width: 100%;
    height: 300px;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite linear;
    border-radius: var(--border-radius-md);
}

/* Performance optimization: reduce animation complexity on lower-end devices */
@media (prefers-reduced-motion: reduce) {
    .media-poster-img,
    .poster-container.loading,
    .scroll-container:empty::before {
        animation: none;
    }

    .media-poster {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

/* ========================================
   INSTANT SEARCH FEEDBACK
   ======================================== */

/* Spinner animation for search loading */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Search loading state */
.search-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    opacity: 0;
    animation: fadeIn 0.2s ease-in forwards;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Season and Episode Info Styling */
.season-info {
    color: #3b82f6;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(59, 130, 246, 0.1);
}

.ds-episode-info {
    color: #10b981;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(16, 185, 129, 0.1);
}

.season-count {
    color: #8b5cf6;
    font-weight: 500;
    font-size: 0.9em;
}

/* Mobile Torrent Controls */
@media (max-width: 1024px) {
    .mobile-torrent-controls {
        width: 100%;
        padding: 15px 15px 20px 15px;
        background: rgba(255, 255, 255, 0.03);
        border-radius: 12px;
        margin-bottom: 20px;
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .mobile-torrent-controls .torrent-version-dropdown-wrapper,
    .mobile-torrent-controls .torrent-folder-dropdown-wrapper {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .mobile-torrent-controls label {
        font-size: 14px;
        font-weight: 500;
        color: rgba(255, 255, 255, 0.9);
    }

    .mobile-torrent-controls select {
        width: 100%;
        padding: 12px 40px 12px 12px;
        min-height: 44px;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        color: #fff;
        font-size: 14px;
        cursor: pointer;
        transition: all 0.2s ease;
        appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23fff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 12px center;
    }

    .mobile-torrent-controls select:focus {
        outline: none;
        border-color: rgba(255, 255, 255, 0.3);
        background: rgba(255, 255, 255, 0.08);
    }

    .mobile-torrent-controls .torrent-version-dropdown-wrapper:last-child {
        padding-bottom: 10px;
    }

    .mobile-torrent-controls .torrent-folder-dropdown-wrapper {
        padding-bottom: 10px;
    }
}

/* Hide trailer text on mobile, show only play icon */
@media (max-width: 768px) {
    .trailer-text {
        display: none !important;
    }
}

/* ==========================================================================
   Torrent Results Modal - Modern Redesign (Classic Theme)
   Matches Tangerine theme design with Classic green color palette
   ========================================================================== */

/* Modal Header */
.overlay-content .torrent-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #444;
    position: sticky;
    top: 0;
    background: var(--surface-color, #1a1a1a);
    z-index: 10;
    margin-top: 20px;
}

.overlay-content .torrent-modal-title-section h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary, #f4f4f4);
    margin: 0 0 0.5rem 0;
    border: none;
    line-height: 10px;
}

.overlay-content .torrent-stats {
    font-size: 0.875rem;
    color: var(--text-secondary, #aaa);
    display: flex;
    gap: 1rem;
    padding-left: 18px;
}

.overlay-content .torrent-stats span {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.overlay-content .torrent-stats span:not(:last-child)::after {
    content: "";
    display: inline-block;
    width: 1px;
    height: 12px;
    background: #444;
    margin-left: 0.75rem;
}

.overlay-content .torrent-modal-actions {
    display: flex;
    align-self: start;
    gap: 0.5rem;
}

.overlay-content .torrent-modal-actions button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-secondary, #aaa);
    font-size: 0.875rem;
    cursor: pointer;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.overlay-content .torrent-modal-actions button:hover {
    background: #333333;
    color: var(--text-primary, #f4f4f4);
}

.overlay-content .torrent-modal-actions button svg {
    width: 1.5rem;
    height: 1.5rem;
}

.overlay-content .torrent-modal-actions .refresh-btn svg {
    animation: spin 1s linear infinite;
    animation-play-state: paused;
}

.overlay-content .torrent-modal-actions .refresh-btn.refreshing svg {
    animation-play-state: running;
}

/* Filter Section */
.overlay-content .torrent-filter-section {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 0.5rem;
    top: 90px;
    z-index: 9;
}

.overlay-content .torrent-filter-input-wrapper {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.overlay-content .torrent-version-dropdown-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.overlay-content .torrent-version-dropdown-wrapper label {
    color: #d4d4d4;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
}

.overlay-content .torrent-version-select {
    padding: 0.5rem 0.75rem;
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 0.375rem;
    color: var(--text-primary, #f4f4f4);
    font-size: 0.875rem;
    cursor: pointer;
    min-width: 120px;
    transition: all 0.2s ease;
}

.overlay-content .torrent-version-select:hover {
    border-color: #555;
}

.overlay-content .torrent-version-select:focus {
    outline: none;
    border-color: #4CAF50;
}

.overlay-content .torrent-folder-dropdown-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.overlay-content .torrent-folder-dropdown-wrapper label {
    color: #d4d4d4;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
}

.overlay-content .torrent-folder-select {
    padding: 0.5rem 0.75rem;
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 0.375rem;
    color: var(--text-primary, #f4f4f4);
    font-size: 0.875rem;
    cursor: pointer;
    min-width: 150px;
    transition: all 0.2s ease;
}

.overlay-content .torrent-folder-select:hover {
    border-color: #555;
}

.overlay-content .torrent-folder-select:focus {
    outline: none;
    border-color: #4CAF50;
}

.overlay-content .torrent-filter-toggles {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.overlay-content .torrent-filter-input-wrapper svg {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    color: #aaa;
    pointer-events: none;
}

.overlay-content .torrent-filter-input {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 2.5rem;
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 0.375rem;
    color: var(--text-primary, #f4f4f4);
    font-size: 0.875rem;
}

.overlay-content .torrent-filter-input:focus {
    outline: none;
    border-color: #4CAF50;
}

.overlay-content .torrent-filter-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #aaa;
    font-size: 0.875rem;
    cursor: pointer;
}

.overlay-content .torrent-filter-checkbox input[type="checkbox"] {
    cursor: pointer;
}

/* Table Styling - Modern Override */
.overlay-content table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    border: none;
    caret-color: transparent;
}

.overlay-content thead {
    position: sticky;
    top: 80px;
    background: var(--surface-color, #1a1a1a);
    z-index: 8;
}

.overlay-content th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #aaa;
    border-bottom: 1px solid #444;
    background-color: var(--surface-color, #1a1a1a);
}

.overlay-content th.sortable {
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
}

.overlay-content th.sortable:hover {
    color: var(--text-primary, #f4f4f4);
}

.overlay-content th.text-right {
    text-align: right;
}

.overlay-content th.text-center {
    text-align: center;
}

.overlay-content tbody tr {
    transition: background-color 0.2s;
}

.overlay-content tbody tr:hover {
    background: #262626;
}

.overlay-content tbody tr.filtered-row {
    opacity: 0.5;
}

.overlay-content td {
    padding: 1rem;
    font-size: 0.875rem;
    color: #e0e0e0;
    vertical-align: middle;
}

.overlay-content td.text-right {
    text-align: right;
}

.overlay-content td.text-center {
    text-align: center;
}

/* Release Name Column with Title and Tags */
.overlay-content .release-title-wrapper {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.overlay-content .release-title {
    font-size: 13px;
    color: var(--text-primary, #f4f4f4);
    line-height: 2;
    font-weight: 400;
}

.overlay-content .release-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-self: self-start;
}

/* Quality Badges */
.overlay-content .quality-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.overlay-content .quality-badge.resolution {
    background: rgba(139, 92, 246, 0.2);
    color: #c4b5fd;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.overlay-content .quality-badge.source {
    background: rgba(6, 182, 212, 0.2);
    color: #67e8f9;
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.overlay-content .quality-badge.codec {
    background: rgba(76, 175, 80, 0.2);
    color: #a5d6a7;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.overlay-content .quality-badge.audio {
    background: rgba(251, 146, 60, 0.2);
    color: #fdba74;
    border: 1px solid rgba(251, 146, 60, 0.3);
}

.overlay-content .quality-badge.hdr {
    background: rgba(234, 179, 8, 0.2);
    color: #fde047;
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.overlay-content .quality-badge.group {
    background: rgba(168, 85, 247, 0.2);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.overlay-content .quality-badge.extension {
    background: rgba(100, 116, 139, 0.2);
    color: #94a3b8;
    border: 1px solid rgba(100, 116, 139, 0.3);
}

/* Source Badge (Indexer) */
.overlay-content .source-badge {
    display: inline-block;
    padding: 4px;
    background: #2a2a2a;
    border: 1px solid #4CAF50;
    border-radius: 4px;
    color: #4CAF50;
    font-size: 11px;
    font-weight: 500;
    margin-right: 4px;
    margin-bottom: 4px;
    width: 100%;
    text-align: center;
}

/* Score Column */
.overlay-content .score-value {
    font-weight: 600;
    font-size: 0.875rem;
}

.overlay-content .score-value.high {
    color: #81c784;
}

.overlay-content .score-value.medium {
    color: #fde047;
}

.overlay-content .score-value.low {
    color: #fca5a5;
}

/* Cache Status Icons */
.overlay-content .cache-status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.375rem;
}

.overlay-content .cache-status-icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

.overlay-content .cache-status-icon.cached {
    background: rgba(76, 175, 80, 0.2);
    color: #81c784;
}

.overlay-content .cache-status-icon.not-cached {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.overlay-content .cache-status-icon.unknown {
    background: rgba(156, 163, 175, 0.2);
    color: #9ca3af;
}

/* Action Buttons - Modern Style
   Using 3-class specificity to override old td button.action-button rules */
.overlay-content .action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 0.375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-transform: none;
}

.overlay-content .action-button.add-button {
    background: #4CAF50;
    color: white;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    width: auto;
    max-width: none;
    margin: 0;
}

.overlay-content .action-button.add-button:hover {
    background: #388E3C;
}

.overlay-content .action-button.assign-button {
    background: transparent;
    color: #aaa;
    border: 1px solid #444;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    width: auto;
    max-width: none;
    margin: 0;
}

.overlay-content .action-button.assign-button:hover {
    background: #333333;
    color: var(--text-primary, #f4f4f4);
    border-color: #555;
}

.overlay-content .action-button svg {
    width: 1rem;
    height: 1rem;
}

/* Empty State */
.overlay-content .torrent-empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #aaa;
}

.overlay-content .torrent-empty-state svg {
    width: 3rem;
    height: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.overlay-content .torrent-empty-state h4 {
    font-size: 1.125rem;
    margin: 0 0 0.5rem;
    color: var(--text-primary, #f4f4f4);
}

.overlay-content .torrent-empty-state p {
    font-size: 0.875rem;
    margin: 0;
}

/* Responsive */
@media (max-width: 1024px) {
    .overlay-content .torrent-modal-header {
        position: relative;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .overlay-content .torrent-filter-section {
        position: relative;
        flex-direction: column;
        align-items: stretch;
    }

    .overlay-content .torrent-version-dropdown-wrapper {
        width: 100%;
    }

    .overlay-content .torrent-version-select {
        flex: 1;
        width: 100%;
    }

    .overlay-content .torrent-folder-dropdown-wrapper {
        width: 100%;
    }

    .overlay-content .torrent-folder-select {
        flex: 1;
        width: 100%;
    }

    .overlay-content thead {
        position: relative;
        top: auto;
    }

    .overlay-content table {
        font-size: 0.8125rem;
    }

    .overlay-content th,
    .overlay-content td {
        padding: 0.75rem 0.5rem;
    }
}
