:root {
    --primary-color: #6A0DAD;
    --secondary-color: #4B0082;
    --background-color: #0A001A;
    --card-background: #1A0A2A;
    --text-color: #ffffff;
    --footer-height: 40px;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: 'Roboto', sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    padding-bottom: 0;
}

.container {
    max-width: 600px;
    padding: 20px;
}

.card {
    background-color: var(--card-background);
    border: none;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease-in-out;
}

.card:hover {
    transform: translateY(-5px);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    border-radius: 25px;
    padding: 10px 20px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: #8A2BE2;
    border-color: #8A2BE2;
    transform: scale(1.05);
}

.btn-secondary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    border-radius: 25px;
    padding: 10px 20px;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background-color: #6A5ACD;
    border-color: #6A5ACD;
    transform: scale(1.05);
}

.form-control {
    background-color: #2A1A3A;
    border-color: #4A3A5A;
    color: var(--text-color);
    border-radius: 10px;
}

.form-control:focus {
    background-color: #3A2A4A;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(106, 13, 173, 0.25);
}

.custom-file-upload {
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.custom-file-upload input[type="file"] {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    cursor: pointer;
}

.custom-file-upload label {
    display: inline-block;
    padding: 10px 20px;
    cursor: pointer;
}

.progress {
    height: 25px;
    border-radius: 12.5px;
    background-color: #2A1A3A;
}

.progress-bar {
    background-color: var(--primary-color);
    border-radius: 12.5px;
}

#status-message {
    font-size: 14px;
    margin-top: 10px;
}

.page-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
}

footer {
    background-color: var(--card-background);
    color: var(--text-color);
    text-align: center;
    padding: 10px 0;
    width: 100%;
    flex-shrink: 0;
    font-size: 12px;
    line-height: 1.5;
}

#process-another-file {
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    footer {
        font-size: 11px;
    }
}

@media (max-width: 576px) {
    footer {
        font-size: 10px;
        padding: 8px 0;
    }
    
    #process-another-file {
        margin-bottom: 15px;
    }
}

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.logo {
    max-width: 340px;
}

.header-title {
    font-size: 1.5rem;
}

.header-subtitle {
    font-size: 1.25rem;
}

/* Enhanced Dashboard Styles */
.dashboard-card {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.dashboard-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
}

/* Gradient backgrounds for dashboard cards */
.bg-gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.bg-gradient-success {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.bg-gradient-info {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.bg-gradient-warning {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

/* Enhanced table styling */
.table-hover tbody tr:hover {
    background-color: rgba(106, 13, 173, 0.1);
}

.table-dark th,
.table-dark td {
    border-color: #4A3A5A;
    vertical-align: middle;
    padding: 1rem;
}

/* Chart containers */
#genre-chart,
#trends-chart {
    background-color: transparent;
    border-radius: 8px;
}

/* Enhanced spacing for dashboard */
.g-4 {
    --bs-gutter-x: 1.5rem;
    --bs-gutter-y: 1.5rem;
}

/* Code styling */
code {
    background-color: #2A1A3A;
    color: #BB86FC;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.875em;
}

/* Badge enhancements */
.badge {
    border-radius: 6px;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
}

/* Responsive dashboard adjustments */
@media (max-width: 768px) {
    .dashboard-card {
        margin-bottom: 1rem;
    }
    
    .dashboard-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    .col-xl-8 {
        margin-bottom: 2rem;
    }
    
    #genre-chart,
    #trends-chart {
        height: 300px !important;
        min-height: 300px !important;
    }
    
    .dashboard-card .card-body {
        padding: 1rem;
    }
}

/* Modern Navigation Styles */
.modern-navbar {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-bottom: 1px solid #2d3748;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    padding: 0.75rem 0;
    backdrop-filter: blur(10px);
}

.modern-brand {
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: 1.5rem;
    color: #ffffff !important;
    text-decoration: none;
    transition: all 0.3s ease;
}

.modern-brand:hover {
    color: #BB86FC !important;
    transform: scale(1.05);
}

.brand-logo {
    margin-right: 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.brand-text {
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #ffffff 0%, #BB86FC 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modern-nav-link {
    color: #e2e8f0 !important;
    font-weight: 500;
    padding: 0.75rem 1.25rem !important;
    border-radius: 8px;
    margin: 0 0.25rem;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
}

.modern-nav-link:hover {
    color: #ffffff !important;
    background: rgba(187, 134, 252, 0.1);
    transform: translateY(-2px);
}

.modern-nav-link.active {
    color: #BB86FC !important;
    background: rgba(187, 134, 252, 0.15);
    font-weight: 600;
}

.modern-nav-link.active::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    background: linear-gradient(90deg, #BB86FC, #667eea);
    border-radius: 2px;
}

.modern-dropdown {
    background: #1a1a2e;
    border: 1px solid #2d3748;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    min-width: 220px;
    z-index: 9999 !important;
}

.modern-dropdown .dropdown-header {
    color: #BB86FC;
    font-weight: 600;
    padding: 0.75rem 1.25rem 0.5rem;
    font-size: 0.875rem;
}

.modern-dropdown .dropdown-item {
    color: #e2e8f0;
    padding: 0.75rem 1.25rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 8px;
    margin: 0 0.5rem;
    display: flex;
    align-items: center;
}

.modern-dropdown .dropdown-item:hover {
    background: rgba(187, 134, 252, 0.1);
    color: #ffffff;
    transform: translateX(5px);
}

.modern-dropdown .dropdown-item.text-danger {
    color: #ff7b72;
}

.modern-dropdown .dropdown-item.text-danger:hover {
    background: rgba(255, 123, 114, 0.1);
    color: #ff7b72;
}

.modern-dropdown .dropdown-divider {
    border-color: #2d3748;
    margin: 0.5rem 0;
}

.custom-toggler {
    border: none;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.custom-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(187, 134, 252, 0.25);
}

.custom-toggler .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.85%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Mobile navigation improvements */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background: #1a1a2e;
        border-radius: 12px;
        margin-top: 1rem;
        padding: 1rem;
        border: 1px solid #2d3748;
    }
    
    .modern-nav-link {
        margin: 0.25rem 0;
    }
    
    .modern-dropdown {
        position: static;
        box-shadow: none;
        border: none;
        background: transparent;
        margin-top: 0;
    }
    
    .modern-dropdown .dropdown-item {
        margin: 0;
        border-radius: 6px;
    }
}

/* Modern Main Page Styles */
.hero-section {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f172a 100%);
    min-height: calc(100vh - 80px);
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 20%, rgba(187, 134, 252, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(102, 126, 234, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 4rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff 0%, #BB86FC 50%, #667eea 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: #94a3b8;
    font-weight: 300;
    letter-spacing: 0.05em;
}

.hero-description h2 {
    color: #ffffff;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.hero-description .lead {
    color: #cbd5e1;
    font-size: 1.1rem;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

.upload-card {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid #334155;
    border-radius: 20px;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    margin: 3rem 0;
}

.upload-card .card-header {
    background: linear-gradient(135deg, rgba(187, 134, 252, 0.1) 0%, rgba(102, 126, 234, 0.1) 100%);
    border-bottom: 1px solid #334155;
    padding: 2rem;
}

.upload-card .card-title {
    color: #ffffff;
    font-weight: 600;
    font-size: 1.5rem;
}

.upload-card .card-subtitle {
    color: #94a3b8;
    font-size: 1rem;
    margin: 0;
}

.upload-card .card-body {
    padding: 2.5rem;
}

.file-upload-area {
    position: relative;
}

.file-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-upload-label {
    display: block;
    padding: 3rem 2rem;
    border: 2px dashed #475569;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.5);
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: center;
}

.file-upload-label:hover {
    border-color: #BB86FC;
    background: rgba(187, 134, 252, 0.05);
    transform: translateY(-2px);
}

.upload-icon {
    font-size: 3rem;
    color: #BB86FC;
    margin-bottom: 1rem;
}

.upload-text h4 {
    color: #ffffff;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.upload-text p {
    color: #94a3b8;
    margin-bottom: 0.5rem;
}

.selected-files {
    color: #10b981;
    font-weight: 500;
}

.form-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.process-btn {
    background: linear-gradient(135deg, #BB86FC 0%, #667eea 100%);
    border: none;
    color: white;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(187, 134, 252, 0.3);
}

.process-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(187, 134, 252, 0.4);
    color: white;
}

.help-btn {
    background: transparent;
    border: 2px solid #475569;
    color: #cbd5e1;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.help-btn:hover {
    border-color: #667eea;
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.progress-section {
    background: rgba(15, 23, 42, 0.8);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #334155;
}

.progress {
    height: 12px;
    border-radius: 6px;
    background: #1e293b;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(90deg, #BB86FC, #667eea);
    border-radius: 6px;
    transition: width 0.3s ease;
    position: relative;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
}

.progress-status {
    color: #94a3b8;
    text-align: center;
    font-weight: 500;
}

.features-grid {
    margin-top: 4rem;
}

.feature-item {
    text-align: center;
    padding: 2rem 1rem;
    border-radius: 16px;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid #334155;
    transition: all 0.3s ease;
    height: 100%;
}

.feature-item:hover {
    transform: translateY(-5px);
    background: rgba(30, 41, 59, 0.8);
    border-color: #BB86FC;
    box-shadow: 0 10px 30px rgba(187, 134, 252, 0.2);
}

.feature-icon {
    font-size: 2.5rem;
    color: #BB86FC;
    margin-bottom: 1rem;
}

.feature-item h4 {
    color: #ffffff;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.feature-item p {
    color: #94a3b8;
    line-height: 1.5;
    margin: 0;
}

/* Mobile responsiveness for main page */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-description h2 {
        font-size: 1.75rem;
    }
    
    .upload-card .card-header,
    .upload-card .card-body {
        padding: 1.5rem;
    }
    
    .file-upload-label {
        padding: 2rem 1rem;
    }
    
    .upload-icon {
        font-size: 2rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .process-btn,
    .help-btn {
        width: 100%;
        max-width: 280px;
    }
}

/* Movies page specific styles */
.movie-controls-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.search-wrapper {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    z-index: 5;
}

.search-input {
    padding-left: 40px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.search-input:focus {
    border-color: #6a5acd;
    box-shadow: 0 0 0 0.2rem rgba(106, 90, 205, 0.25);
    background: rgba(255, 255, 255, 0.95);
}

.genre-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.genre-badge {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border: 1px solid rgba(106, 90, 205, 0.2);
    border-radius: 20px;
    padding: 0.3rem 0.7rem;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.genre-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(106, 90, 205, 0.2);
}

.genre-name {
    color: #6a5acd;
    font-weight: 600;
    text-transform: capitalize;
}

.genre-score {
    background: #6a5acd;
    color: white;
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 0.4rem;
    min-width: 20px;
    text-align: center;
}

.batch-badge {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.processed-date {
    font-weight: 600;
    color: #495057;
    font-size: 0.85rem;
}

.action-buttons {
    display: flex;
    gap: 0.3rem;
    justify-content: center;
}

.action-buttons .btn {
    border-radius: 8px;
    transition: all 0.2s ease;
}

.action-buttons .btn:hover {
    transform: translateY(-1px);
}

.empty-state {
    padding: 3rem 2rem;
}

.empty-state .display-4 {
    opacity: 0.5;
}

/* Modern Footer Styling */
.modern-footer {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #ffffff;
    padding: 1.5rem 0;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    font-weight: 400;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    justify-content: flex-end;
}

.footer-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.footer-link:hover {
    color: #ffffff;
    text-decoration: none;
}

.footer-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.3s ease;
}

.footer-link:hover::after {
    width: 100%;
}

@media (max-width: 768px) {
    .footer-links {
        justify-content: center;
        margin-top: 1rem;
    }
    
    .modern-footer .col-md-6 {
        text-align: center !important;
    }
}

/* Admin Settings Navigation Active State */
.modern-nav-link.active {
    color: #667eea !important;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 6px;
}

/* Settings Page Specific Styling */
.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-check-input:checked {
    background-color: #667eea;
    border-color: #667eea;
}

.form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Improve text visibility in admin settings */
.form-text {
    color: rgba(255, 255, 255, 0.7) !important;
}

.analytics-card .card-body .table {
    color: #ffffff;
}

.analytics-card .card-body .table td {
    color: rgba(255, 255, 255, 0.9) !important;
    border-color: rgba(255, 255, 255, 0.1);
}

.analytics-card .card-body .table th {
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.2);
}

.badge {
    color: #ffffff !important;
}

/* Fix subtitle and description text visibility */
.lead, .card-subtitle, .text-muted {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* Admin settings page specific fixes */
.admin-settings .card-header p {
    color: rgba(255, 255, 255, 0.8) !important;
}

.admin-settings .table td {
    color: rgba(255, 255, 255, 0.9) !important;
    background-color: rgba(26, 26, 46, 0.8) !important;
}

.admin-settings .table th {
    color: #ffffff !important;
    background-color: rgba(26, 26, 46, 0.9) !important;
}

.admin-settings .table {
    --bs-table-bg: rgba(26, 26, 46, 0.6) !important;
}

/* Override Bootstrap table striping */
.table-striped > tbody > tr:nth-of-type(odd) > td {
    background-color: rgba(26, 26, 46, 0.8) !important;
}

.table-striped > tbody > tr:nth-of-type(even) > td {
    background-color: rgba(26, 26, 46, 0.6) !important;
}

/* Fix any remaining dark text issues */
body .text-dark {
    color: rgba(255, 255, 255, 0.9) !important;
}

body .text-secondary {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* Fix dropdown z-index issues */
.navbar {
    z-index: 10000 !important;
    position: relative;
}

.dropdown-menu.show {
    z-index: 10001 !important;
}
