/* PotterPlex - Glassmorphism Media Interface */

:root {
    --primary-dark: #0A1628;
    --primary-blue: #0D1F3C;
    --accent-blue: #2D9CDB;
    --accent-glow: #4FB3F6;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-hover: rgba(255, 255, 255, 0.08);
    --text-primary: #FFFFFF;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);
    --status-green: #10B981;
    --status-yellow: #F59E0B;
    --status-blue: #3B82F6;
    --status-gray: #6B7280;
    --status-red: #EF4444;
    --movie-accent: #E50914;
    --tv-accent: #6366F1;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --shadow-glow: 0 0 40px rgba(45, 156, 219, 0.15);
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--primary-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Movie Poster Grid Background */
.poster-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.poster-background.poster-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
    padding: 8px;
    opacity: 0.15;
    filter: blur(2px);
    animation: posterFloat 60s ease-in-out infinite;
}

.poster-background.poster-grid img {
    width: 100%;
    height: auto;
    aspect-ratio: 2/3;
    object-fit: cover;
    border-radius: var(--radius-sm);
    opacity: 0;
    animation: posterFadeIn 1s ease forwards;
}

@keyframes posterFadeIn {
    to { opacity: 1; }
}

@keyframes posterFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-20px) scale(1.02); }
}

.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(
        180deg,
        rgba(10, 22, 40, 0.85) 0%,
        rgba(10, 22, 40, 0.95) 50%,
        rgba(10, 22, 40, 0.98) 100%
    );
    z-index: 1;
}

/* Glass Card Base */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: visible;
}

/* Login Screen */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 40px;
    padding-top: 80px;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

.logo-icon {
    font-size: 56px;
    display: block;
    margin-bottom: 16px;
    animation: float 3s ease-in-out infinite;
}

.logo-image {
    width: 100px;
    height: 100px;
    aspect-ratio: 1 / 1;
    display: block;
    margin: 0 auto 16px;
    animation: float 3s ease-in-out infinite;
    object-fit: contain;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.login-logo h1 {
    font-size: 32px;
    font-weight: 600;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group {
    position: relative;
}

.input-group input {
    width: 100%;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 16px;
    font-family: inherit;
    transition: all var(--transition-normal);
    outline: none;
}

.input-group input::placeholder {
    color: var(--text-muted);
}

.input-group input:focus {
    border-color: var(--accent-blue);
    background: rgba(45, 156, 219, 0.05);
}

.input-glow {
    position: absolute;
    inset: 0;
    border-radius: var(--radius-md);
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 0 30px rgba(45, 156, 219, 0.4);
    transition: opacity var(--transition-normal);
}

.input-group input:focus + .input-glow {
    opacity: 1;
}

.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--accent-blue) 0%, #1E7BB8 100%);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-normal);
    margin-top: 8px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(45, 156, 219, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary svg {
    width: 20px;
    height: 20px;
    transition: transform var(--transition-normal);
}

.btn-primary:hover svg {
    transform: translateX(4px);
}

.login-error {
    color: var(--status-red);
    font-size: 14px;
    text-align: center;
    min-height: 20px;
}

/* App Container */
.app-container {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Header */
.app-header {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: rgba(10, 22, 40, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 50;
}

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

.logo-icon-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.logo-text {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    background: var(--glass-hover);
    color: var(--text-primary);
    border-color: var(--accent-blue);
}

.btn-icon svg {
    width: 20px;
    height: 20px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-name {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.version-badge {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 400;
    opacity: 0.6;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    margin-left: 8px;
}

.btn-library {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--accent-blue) 0%, #1E7BB8 100%);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.btn-library:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(45, 156, 219, 0.4);
}

.btn-library svg {
    width: 20px;
    height: 20px;
}

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 24px 80px;
}

/* Search Section */
.search-section {
    text-align: center;
    margin-bottom: 48px;
}

.search-title {
    font-size: 36px;
    font-weight: 600;
    margin-bottom: 32px;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.search-container {
    max-width: 700px;
    margin: 0 auto;
}

.search-input-wrapper {
    position: relative;
    margin-bottom: 20px;
}

.search-input-wrapper input {
    width: 100%;
    padding: 20px 56px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    color: var(--text-primary);
    font-size: 18px;
    font-family: inherit;
    outline: none;
    transition: all var(--transition-normal);
}

.search-input-wrapper input::placeholder {
    color: var(--text-muted);
}

.search-input-wrapper input:focus {
    border-color: var(--accent-blue);
    background: rgba(45, 156, 219, 0.05);
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    color: var(--text-muted);
    pointer-events: none;
    transition: color var(--transition-normal);
}

.search-input-wrapper input:focus ~ .search-icon {
    color: var(--accent-blue);
}

.search-glow {
    position: absolute;
    inset: 0;
    border-radius: var(--radius-xl);
    opacity: 0;
    pointer-events: none;
    box-shadow: var(--shadow-glow);
    transition: opacity var(--transition-normal);
}

.search-input-wrapper input:focus ~ .search-glow {
    opacity: 1;
}

.clear-search {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.clear-search:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.clear-search svg {
    width: 16px;
    height: 16px;
}

/* Search Filters */
.search-filters {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.filter-checkbox:hover {
    background: var(--glass-bg);
}

.filter-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: relative;
    height: 20px;
    width: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--glass-border);
    border-radius: 6px;
    transition: all var(--transition-fast);
}

.filter-checkbox:hover .checkmark {
    border-color: var(--text-muted);
}

.filter-checkbox input:checked ~ .checkmark {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.filter-checkbox input:checked ~ .checkmark:after {
    display: block;
}

.filter-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color var(--transition-fast);
}

.filter-checkbox input:checked ~ .filter-label {
    color: var(--text-primary);
}

/* Results Section */
.results-section {
    display: none;
}

.results-section.active {
    display: block;
}

/* Category Headers with Movie/TV distinction */
.results-category {
    margin-bottom: 48px;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--glass-border);
}

.category-header svg {
    width: 24px;
    height: 24px;
}

/* Movie category styling */
#moviesCategory .category-header {
    border-bottom-color: rgba(229, 9, 20, 0.3);
}

#moviesCategory .category-header svg {
    color: var(--movie-accent);
}

#moviesCategory .category-header h3 {
    color: var(--movie-accent);
}

/* TV category styling */
#tvCategory .category-header {
    border-bottom-color: rgba(99, 102, 241, 0.3);
}

#tvCategory .category-header svg {
    color: var(--tv-accent);
}

#tvCategory .category-header h3 {
    color: var(--tv-accent);
}

/* People/Cast category styling */
#peopleCategory .category-header {
    border-bottom-color: rgba(16, 185, 129, 0.3);
}

#peopleCategory .category-header svg {
    color: var(--status-green);
}

#peopleCategory .category-header h3 {
    color: var(--status-green);
}

/* People Grid */
.people-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important;
}

/* Person Card */
.person-card {
    position: relative;
    cursor: pointer;
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all var(--transition-normal);
    animation: cardFadeIn 0.4s ease backwards;
    text-align: center;
}

.person-card:hover {
    transform: translateY(-8px) scale(1.02);
}

.person-photo {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: var(--glass-bg);
    border-radius: var(--radius-md);
}

.person-info {
    padding: 12px 8px;
}

.person-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.3;
}

.person-role {
    font-size: 12px;
    color: var(--text-muted);
}

.person-known-for {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.category-header h3 {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.result-count {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 400;
}

/* Results Grid - Desktop: 7 per row */
.results-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 20px;
}

/* View All Button */
.view-all-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 16px 24px;
    margin-top: 24px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.view-all-btn:hover {
    background: var(--glass-hover);
    border-color: var(--accent-blue);
    color: var(--text-primary);
}

.view-all-btn svg {
    width: 18px;
    height: 18px;
    transition: transform var(--transition-fast);
}

.view-all-btn:hover svg {
    transform: translateY(2px);
}

/* Result Card */
.result-card {
    position: relative;
    cursor: pointer;
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all var(--transition-normal);
    animation: cardFadeIn 0.4s ease backwards;
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.result-card:hover {
    transform: translateY(-8px) scale(1.02);
    z-index: 10;
}

.result-card:hover .card-overlay {
    opacity: 1;
}

.card-poster {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    background: var(--glass-bg);
    display: block;
}

.card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        0deg,
        rgba(10, 22, 40, 0.95) 0%,
        rgba(10, 22, 40, 0.6) 50%,
        transparent 100%
    );
    opacity: 0;
    transition: opacity var(--transition-normal);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 16px;
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-rating {
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-rating svg {
    width: 12px;
    height: 12px;
    fill: #FCD34D;
    stroke: none;
}

/* Badge Stack Container - top left */
.card-badges {
    position: absolute;
    top: 6px;
    left: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 2;
}

/* Media Type Badge */
.card-type-badge {
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.card-type-badge.movie {
    background: var(--movie-accent);
    color: white;
}

.card-type-badge.tv {
    background: var(--tv-accent);
    color: white;
}

.card-type-badge.hidden {
    display: none;
}

/* Status Badge - stacks below type */
.status-badge-placeholder {
    display: none;
}

.status-badge {
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}

/* RT Badge - bottom right corner */
.rt-badge-placeholder {
    display: none;
}

.card-rt-badge {
    position: absolute !important;
    bottom: 6px !important;
    right: 6px !important;
    left: auto !important;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
    z-index: 10;
}

.card-rt-badge.fresh {
    color: #FA320A;
}

.card-rt-badge.rotten {
    color: #8B9A5B;
}

.status-badge.in-library {
    background: rgba(16, 185, 129, 0.9);
    color: white;
}

.status-badge.downloading {
    background: rgba(59, 130, 246, 0.9);
    color: white;
}

.status-badge.requested {
    background: rgba(245, 158, 11, 0.9);
    color: white;
}

.status-badge.available {
    background: rgba(107, 114, 128, 0.9);
    color: white;
}

/* Download Progress Bar */
.download-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(0, 0, 0, 0.5);
}

.download-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-glow));
    transition: width 0.5s ease;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.no-results svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.no-results p {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.no-results span {
    font-size: 14px;
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    justify-content: center;
    padding: 60px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--glass-border);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Trending Section */
/* Activity Section (Collapsible) */
.activity-section {
    margin-top: 20px;
    margin-bottom: 40px;
}

.activity-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    transition: all var(--transition-fast);
}

.activity-header:hover {
    color: var(--accent-blue);
}

.activity-count {
    display: inline-block;
    background: var(--accent-blue);
    color: white;
    font-size: 14px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 12px;
}

.expand-icon {
    font-size: 20px;
    transition: transform var(--transition-fast);
}

.expand-icon.collapsed {
    transform: rotate(-90deg);
}

.activity-content {
    margin-top: 20px;
    transition: all var(--transition-normal);
}

.activity-content.collapsed {
    display: none;
}

/* Library Page */
.library-header {
    margin-bottom: 40px;
}

.library-controls {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.library-filters {
    display: flex;
    gap: 16px;
    align-items: center;
}

.library-grid {
    min-height: 400px;
}

.back-btn:hover {
    background: var(--glass-hover);
    color: var(--text-primary);
}

.downloads-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: none; /* Show all downloads */
}

#recentGrid {
    margin-top: 12px;
}

.download-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    min-height: 80px; /* Compact single-row height */
}

.download-item:hover {
    background: var(--glass-hover);
    border-color: var(--accent-blue);
}

.download-poster {
    width: 45px;
    height: 67px;
    border-radius: 4px;
    background-size: cover;
    background-position: center;
    background-color: var(--glass-bg);
    flex-shrink: 0;
}

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

.download-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.download-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 4px;
}

.download-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), #1E7BB8);
    transition: width 0.3s ease;
}

.download-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.download-status {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.download-status.downloading {
    background: rgba(45, 156, 219, 0.2);
    color: var(--accent-blue);
}

.download-status.complete {
    background: rgba(16, 185, 129, 0.2);
    color: var(--status-green);
}

.trending-section {
    margin-top: 20px;
}

.section-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.trending-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 20px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 22, 40, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform var(--transition-slow);
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    z-index: 10;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: rotate(90deg);
}

.modal-close svg {
    width: 20px;
    height: 20px;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 300px;
    background-size: cover;
    background-position: center;
    opacity: 0.3;
    mask-image: linear-gradient(to bottom, black, transparent);
    -webkit-mask-image: linear-gradient(to bottom, black, transparent);
}

.modal-body {
    position: relative;
    display: flex;
    gap: 32px;
    padding: 32px;
    overflow-y: auto;
    max-height: 90vh;
}

.modal-poster {
    flex-shrink: 0;
    width: 200px;
    aspect-ratio: 2/3;
    border-radius: var(--radius-md);
    background-size: cover;
    background-position: center;
    background-color: var(--glass-bg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.modal-info {
    flex: 1;
    padding-top: 20px;
}

.modal-status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.modal-title {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 12px;
}

.modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 16px;
}

.modal-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.modal-meta .content-rating {
    background: rgba(255, 255, 255, 0.15);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.modal-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.modal-rating .stars {
    display: flex;
    gap: 2px;
}

.modal-rating svg {
    width: 18px;
    height: 18px;
    fill: #FCD34D;
}

.modal-rating .score {
    font-size: 16px;
    font-weight: 600;
}

/* Rating Badges (RT, IMDB, Metacritic, TMDB) */
.rating-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.rating-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
}

.rating-badge.loading {
    background: var(--glass-bg);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 400;
}

.rating-badge .rating-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

.rating-badge .rating-icon {
    font-size: 16px;
}

.rating-badge .rating-score {
    font-size: 15px;
}

/* Rotten Tomatoes */
.rating-badge.rt {
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
    color: white;
}

.rating-badge.rt.fresh {
    border: 1px solid #FA320A;
}

.rating-badge.rt.rotten {
    border: 1px solid #6B8E23;
}

/* IMDB */
.rating-badge.imdb {
    background: linear-gradient(135deg, #f5c518, #e6b800);
    color: #000;
}

/* Metacritic */
.rating-badge.metacritic {
    color: white;
}

.rating-badge.metacritic.good {
    background: #66CC33;
}

.rating-badge.metacritic.mixed {
    background: #FFCC33;
    color: #000;
}

.rating-badge.metacritic.bad {
    background: #FF0000;
}

/* TMDB */
.rating-badge.tmdb {
    background: linear-gradient(135deg, #01b4e4, #90cea1);
    color: #0d253f;
}

.modal-overview {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 28px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-request {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--accent-blue) 0%, #1E7BB8 100%);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.btn-request:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(45, 156, 219, 0.4);
}

.btn-request:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

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

.btn-secondary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-secondary:hover {
    background: var(--glass-hover);
    border-color: var(--text-muted);
}

/* Bio toggle */
.bio-toggle {
    background: none;
    border: none;
    color: var(--accent-blue);
    cursor: pointer;
    font-size: 13px;
    padding: 0;
    margin-left: 4px;
}

.bio-toggle:hover {
    text-decoration: underline;
}

/* Filmography Grid in Modal */
.filmography-section {
    width: 100%;
    margin-bottom: 16px;
}

.filmography-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    margin-bottom: 12px;
    transition: all var(--transition-fast);
}

.filmography-header:hover {
    background: var(--glass-hover);
    border-color: var(--accent-blue);
}

.filmography-header h4 {
    margin: 0;
    font-size: 14px;
    color: var(--text-primary);
}

.filmography-header.collapsed {
    opacity: 0.7;
}

.filmography-header.collapsed:hover {
    opacity: 1;
}

.expand-icon {
    font-size: 12px;
    color: var(--text-muted);
    transition: transform var(--transition-fast);
}

.filmography-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 12px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 8px;
}

.filmography-item {
    cursor: pointer;
    text-align: center;
    transition: all var(--transition-fast);
    border-radius: var(--radius-sm);
    padding: 8px;
}

.filmography-item:hover {
    background: var(--glass-bg);
    transform: scale(1.05);
}

.filmography-item img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.filmography-item .no-poster-small {
    width: 100%;
    aspect-ratio: 2/3;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass-bg);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    font-size: 24px;
}

.filmography-title {
    font-size: 11px;
    font-weight: 500;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 2px;
}

.filmography-year {
    font-size: 10px;
    color: var(--text-muted);
}

.filmography-role {
    font-size: 9px;
    color: var(--accent);
    font-weight: 500;
    margin-top: 2px;
}

/* Full filmography grid (scrollable, more items) */
.filmography-grid.filmography-full {
    max-height: 60vh;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
}

/* Year badge on filmography item */
.filmography-year-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    background: rgba(0, 0, 0, 0.8);
    color: var(--accent);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    z-index: 1;
}

.filmography-item {
    position: relative;
}

/* Person modal poster (circular) */
.modal-poster[data-is-person="true"] {
    border-radius: 50% !important;
    aspect-ratio: 1 !important;
    width: 150px !important;
    height: 150px !important;
}

/* Interactive Search (Admin Only) */
.interactive-search-container {
    width: 100%;
    margin-top: 16px;
}

.search-loading {
    text-align: center;
    padding: 40px 20px;
}

.search-loading p {
    margin-top: 16px;
    color: var(--text-secondary);
}

.search-hint {
    font-size: 12px;
    color: var(--text-muted) !important;
}

.releases-title {
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-size: 14px;
}

.releases-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.sort-controls {
    display: flex;
    gap: 8px;
}

.sort-btn {
    padding: 6px 12px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 11px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.sort-btn:hover {
    background: var(--glass-hover);
    color: var(--text-primary);
}

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

.releases-list {
    max-height: 50vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 8px;
}

.release-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.release-item:hover {
    background: var(--glass-hover);
    border-color: var(--accent-blue);
}

.release-quality {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 90px;
}

.quality-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    background: var(--glass-hover);
    color: var(--text-primary);
    text-align: center;
}

.quality-badge.quality-4k {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white;
}

.quality-badge.quality-remux {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.quality-badge.quality-1080 {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.quality-badge.quality-720 {
    background: var(--glass-hover);
}

.cf-score {
    font-size: 10px;
    color: var(--accent);
    text-align: center;
}

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

.release-title {
    font-size: 12px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.release-meta {
    display: flex;
    gap: 12px;
    font-size: 11px;
    color: var(--text-muted);
}

.release-seeders.good { color: var(--status-green); }
.release-seeders.ok { color: var(--status-yellow); }
.release-seeders.bad { color: var(--status-red); }

.btn-grab {
    padding: 8px 16px;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn-grab:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: scale(1.05);
}

.btn-grab:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.no-releases {
    text-align: center;
    color: var(--text-muted);
    padding: 20px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    animation: toastIn 0.3s ease;
    min-width: 280px;
    max-width: 400px;
}

.toast.success {
    border-color: var(--status-green);
}

.toast.error {
    border-color: var(--status-red);
}

.toast.info {
    border-color: var(--accent-blue);
}

.toast svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.toast.success svg {
    color: var(--status-green);
}

.toast.error svg {
    color: var(--status-red);
}

.toast.info svg {
    color: var(--accent-blue);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Mobile Responsive */

/* Tablet - 5 per row */
@media (max-width: 1200px) {
    .results-grid,
    .trending-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 16px;
    }
}

/* Small tablet - 4 per row */
@media (max-width: 900px) {
    .results-grid,
    .trending-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 14px;
    }
    
    .search-filters {
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .search-title {
        font-size: 24px;
        margin-bottom: 24px;
    }
    
    .search-input-wrapper input {
        padding: 14px 48px;
        font-size: 16px;
    }
    
    .search-icon {
        left: 16px;
        width: 20px;
        height: 20px;
    }
    
    /* 3 per row on mobile */
    .results-grid,
    .trending-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
    
    .people-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
    
    .modal-body {
        flex-direction: column;
        padding: 20px;
    }
    
    .modal-poster {
        width: 140px;
        margin: 0 auto;
    }
    
    .modal-title {
        font-size: 22px;
        text-align: center;
    }
    
    .modal-info {
        padding-top: 0;
        text-align: center;
    }
    
    .modal-meta {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .modal-rating {
        justify-content: center;
    }
    
    .modal-actions {
        justify-content: center;
    }
    
    .main-content {
        padding: 20px 12px 60px;
    }
    
    .app-header {
        padding: 12px 16px;
    }
    
    .user-name {
        display: none;
    }
    
    .category-header h3 {
        font-size: 16px;
    }
    
    .search-filters {
        gap: 8px;
    }
    
    .filter-checkbox {
        padding: 6px 12px;
    }
    
    .filter-label {
        font-size: 13px;
    }
    
    .view-all-btn {
        padding: 14px 20px;
        font-size: 13px;
    }
    
    .filmography-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 32px 24px;
    }
    
    .logo-icon {
        font-size: 48px;
    }
    
    .login-logo h1 {
        font-size: 26px;
    }
    
    .search-title {
        font-size: 20px;
    }
    
    /* 2 per row on small phones */
    .results-grid,
    .trending-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .people-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    
    .poster-background.poster-grid {
        grid-template-columns: repeat(3, 1fr);
        opacity: 0.1;
    }
    
    .card-title {
        font-size: 12px;
    }
    
    .card-meta {
        font-size: 11px;
    }
    
    .status-badge {
        font-size: 9px;
        padding: 4px 6px;
    }
    
    .category-header {
        margin-bottom: 16px;
        padding-bottom: 12px;
    }
    
    .results-category {
        margin-bottom: 32px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Styles */
:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

/* SMS Notification Modal */
.sms-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 22, 40, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 250;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.sms-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sms-modal {
    width: 100%;
    max-width: 400px;
    padding: 40px;
    text-align: center;
    transform: scale(0.9) translateY(20px);
    transition: transform var(--transition-slow);
}

.sms-modal-overlay.active .sms-modal {
    transform: scale(1) translateY(0);
}

.sms-modal-icon {
    font-size: 56px;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

.sms-modal-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.sms-modal-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 28px;
    line-height: 1.6;
}

.sms-input-group {
    margin-bottom: 24px;
}

.sms-input-group input {
    width: 100%;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 18px;
    font-family: inherit;
    text-align: center;
    letter-spacing: 1px;
    transition: all var(--transition-normal);
    outline: none;
}

.sms-input-group input::placeholder {
    color: var(--text-muted);
}

.sms-input-group input:focus {
    border-color: var(--accent-blue);
    background: rgba(45, 156, 219, 0.05);
}

.sms-input-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
}

.sms-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-sms-notify {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.btn-sms-notify:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(16, 185, 129, 0.4);
}

.btn-sms-notify:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-sms-notify svg {
    width: 20px;
    height: 20px;
}

.btn-sms-skip {
    width: 100%;
    padding: 14px 24px;
    background: transparent;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-sms-skip:hover {
    color: var(--text-secondary);
    border-color: var(--text-muted);
}

/* Phone number formatting */
.sms-input-group input[type="tel"] {
    font-variant-numeric: tabular-nums;
}

