/* --- Frontend Styles (from style.css) --- */

/* Archive Header */
.tmdb-archive-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
}

.tmdb-archive-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.5rem 0;
}

.tmdb-search-query {
    color: #64748b;
    font-size: 1.1rem;
}

/* Search Container */
.tmdb-search-container {
    background: #ffffff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.tmdb-search-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.search-input-group {
    display: flex;
    gap: 10px;
}

.tmdb-search-input {
    flex: 1;
    padding: 12px 20px;
    font-size: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.tmdb-search-input:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

.tmdb-search-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #2271b1;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tmdb-search-button:hover {
    background: #135e96;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.3);
}

/* Filters */
.search-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

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

.filter-group label {
    font-size: 14px;
    font-weight: 600;
    color: #475569;
}

.filter-group select {
    padding: 10px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-group select:focus {
    outline: none;
    border-color: #2271b1;
}

.filter-group select:hover {
    border-color: #cbd5e1;
}

.filter-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 10px;
    margin-top: 0.5rem;
}

.filter-apply-btn {
    padding: 12px 28px;
    background: #059669;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-apply-btn:hover {
    background: #047857;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.filter-clear-btn {
    padding: 12px 28px;
    background: #ffffff;
    color: #64748b;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
}

.filter-clear-btn:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
    color: #475569;
}

/* Movie Grid */
.tmdb-movie-grid,
.movie-archive-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); 
    gap: 20px; 
}

.movie-card { 
    border: 1px solid #ddd; 
    border-radius: 8px; 
    overflow: hidden; 
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s ease-in-out;
}

.movie-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.movie-card img { 
    max-width: 100%; 
    height: auto; 
    display: block;
}

.movie-card-title { 
    padding: 10px; 
    font-weight: bold; 
}

/* Movie Card Director */
.tmdb-movie-director {
    padding: 0 10px 5px;
    font-size: 13px;
    color: #666;
}

.tmdb-movie-director em {
    font-style: italic;
}

/* --- Single Movie Page Styles --- */

/* Hero Section */
.tmdb-hero {
    position: relative;
    width: 100%;
    height: 400px;
    background-size: cover;
    background-position: center;
    margin: -20px -20px 30px -20px;
    border-radius: 0 0 16px 16px;
}

/* Back Button */
.tmdb-back-button {
    margin-bottom: 20px;
}

.tmdb-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.tmdb-button-outline {
    background: #ffffff;
    color: #1e293b;
    border: 2px solid #e5e7eb;
}

.tmdb-button-outline:hover {
    background: #f8fafc;
    border-color: #2271b1;
    color: #2271b1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Movie Header */
.tmdb-movie-header {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.tmdb-movie-poster {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    transition: transform 0.3s ease;
}

.tmdb-movie-poster:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.2);
}

.tmdb-movie-poster img {
    width: 100%;
    height: auto;
    display: block;
}

.tmdb-poster-placeholder {
    width: 100%;
    aspect-ratio: 2/3;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    font-weight: 600;
}

/* Title Row with Rating */
.tmdb-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 30px;
    margin-bottom: 20px;
}

.tmdb-movie-title {
    font-size: 3rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 10px 0;
    line-height: 1.1;
}

.tmdb-movie-tagline {
    font-size: 1.25rem;
    color: #64748b;
    font-style: italic;
    margin: 0;
    font-weight: 400;
}

/* Rating Badge */
.tmdb-rating-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.tmdb-rating-circle {
    position: relative;
    width: 90px;
    height: 90px;
}

.tmdb-rating-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.tmdb-rating-bg {
    fill: none;
    stroke: #e5e7eb;
    stroke-width: 8;
}

.tmdb-rating-fill {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dasharray 1s ease;
}

.tmdb-rating-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.tmdb-rating-number {
    font-size: 24px;
    font-weight: 800;
    color: #0f172a;
    display: block;
    line-height: 1;
}

.tmdb-rating-max {
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
}

.tmdb-vote-count {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

/* Meta Items */
.tmdb-movie-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 20px 0;
}

.tmdb-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #f1f5f9;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #475569;
}

.tmdb-meta-icon {
    width: 16px;
    height: 16px;
    color: #64748b;
}

/* Genres */
.tmdb-movie-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.tmdb-genre-tag {
    display: inline-block;
    padding: 6px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Movie Content Layout */
.tmdb-movie-content {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 40px;
}

.tmdb-movie-main {
    min-width: 0;
}

.tmdb-movie-section {
    background: #ffffff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.tmdb-section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 20px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #e5e7eb;
}

.tmdb-movie-overview {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #475569;
}

.tmdb-movie-overview p {
    margin-bottom: 1rem;
}

/* Sidebar */
.tmdb-movie-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.tmdb-meta-box {
    background: #ffffff;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.tmdb-meta-box-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
}

.tmdb-meta-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tmdb-meta-list li {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

.tmdb-meta-list li:last-child {
    border-bottom: none;
}

.tmdb-meta-label {
    font-weight: 600;
    color: #64748b;
    font-size: 14px;
}

.tmdb-meta-value {
    font-weight: 600;
    color: #0f172a;
    text-align: right;
    font-size: 14px;
}

.tmdb-meta-value a {
    color: #2271b1;
    text-decoration: none;
    transition: color 0.2s ease;
}

.tmdb-meta-value a:hover {
    color: #135e96;
    text-decoration: underline;
}

/* SSCC Barcode */
.tmdb-sscc-container {
    text-align: center;
}

.tmdb-sscc-code {
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    padding: 12px;
    background: #f8fafc;
    border-radius: 6px;
    margin-bottom: 15px;
    letter-spacing: 2px;
}

.tmdb-barcode-container {
    padding: 15px;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 10px;
}

.tmdb-sscc-note {
    font-size: 12px;
    color: #64748b;
    margin: 0;
}

/* Responsive Single Movie */
@media (max-width: 1024px) {
    .tmdb-movie-content {
        grid-template-columns: 1fr;
    }
    
    .tmdb-movie-sidebar {
        order: 2;
    }
}

@media (max-width: 768px) {
    .tmdb-movie-header {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .tmdb-movie-poster {
        max-width: 300px;
        margin: 0 auto;
    }
    
    .tmdb-title-row {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .tmdb-movie-title {
        font-size: 2rem;
    }
    
    .tmdb-movie-tagline {
        font-size: 1rem;
    }
    
    .tmdb-movie-meta {
        justify-content: center;
    }
    
    .tmdb-hero {
        height: 250px;
    }
}

/* Movie Meta Styling */
.tmdb-movie-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 10px 10px;
}

.tmdb-movie-year,
.tmdb-movie-country,
.tmdb-movie-format {
    font-size: 12px;
    padding: 3px 8px;
    background: #f0f0f1;
    border-radius: 3px;
    color: #555;
}

.tmdb-movie-year {
    background: #e3f2fd;
    color: #1976d2;
}

.tmdb-movie-country {
    background: #fff3e0;
    color: #e65100;
}


/* --- Admin Import/Export Styles (from tmdb-import-export.css) --- */
.tmdb-import-export-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.tmdb-card {
    background: #fff;
    border: 1px solid #ccd0d4;
    padding: 1.5rem;
}

.tmdb-upload-area {
    border: 2px dashed #c3c4c7;
    padding: 2rem;
    text-align: center;
    border-radius: 4px;
    transition: all 0.3s ease;
    cursor: pointer;
    background: #fafafa;
}

.tmdb-upload-area:hover {
    border-color: #2271b1;
    background: #f0f6fc;
}

.tmdb-upload-area.tmdb-drag-over {
    border-color: #2271b1;
    background: #e3f2fd;
    border-style: solid;
    transform: scale(1.02);
}

.tmdb-upload-content p {
    margin: 0;
    font-size: 15px;
}

.wikidata-browse {
    color: #2271b1;
    text-decoration: underline;
    font-weight: 600;
}

.wikidata-browse:hover {
    color: #135e96;
}

.tmdb-import-progress {
    margin: 1.5rem 0;
}

.tmdb-progress-bar {
    height: 24px;
    background: #f0f0f1;
    overflow: hidden;
    border-radius: 4px;
    border: 1px solid #c3c4c7;
}

.tmdb-progress {
    height: 100%;
    background: linear-gradient(90deg, #2271b1 0%, #135e96 100%);
    width: 0;
    transition: width 0.3s ease;
}

.tmdb-progress-text {
    margin-top: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #1e1e1e;
}

.tmdb-progress-percent {
    color: #2271b1;
    font-size: 16px;
    font-weight: 700;
}

.tmdb-progress-count {
    color: #2271b1;
    font-weight: 700;
}

/* --- Wikidata Import Styles --- */
.tmdb-wikidata-import .tmdb-card {
    max-width: 900px;
}

.tmdb-info-box {
    background: #fff3cd;
    border: 1px solid #ffc107;
    padding: 15px;
    margin: 15px 0;
    border-radius: 4px;
}

.tmdb-info-box h4 {
    margin-top: 0;
    color: #856404;
}

.tmdb-info-box code {
    background: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    display: inline-block;
    word-break: break-all;
}

.wikidata-import-stats {
    animation: fadeIn 0.3s ease;
}

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

/* --- Meta Box Tabs --- */
.tmdb-meta-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
    border-bottom: 1px solid #c3c4c7;
}

.tmdb-tab-button {
    background: #f0f0f1;
    border: 1px solid #c3c4c7;
    border-bottom: none;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
    position: relative;
    top: 1px;
}

.tmdb-tab-button:hover {
    background: #e8e8e8;
}

.tmdb-tab-button.active {
    background: #fff;
    border-bottom: 1px solid #fff;
    font-weight: 600;
    color: #2271b1;
}

.tmdb-tab-content {
    padding-top: 10px;
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    .tmdb-archive-title {
        font-size: 2rem;
    }
    
    .tmdb-search-container {
        padding: 1.5rem;
    }
    
    .search-input-group {
        flex-direction: column;
    }
    
    .tmdb-search-button {
        width: 100%;
        justify-content: center;
    }
    
    .search-filters {
        grid-template-columns: 1fr;
    }
    
    .filter-actions {
        flex-direction: column;
    }
    
    .filter-apply-btn,
    .filter-clear-btn {
        width: 100%;
        text-align: center;
    }
    
    .tmdb-movie-grid,
    .movie-archive-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .tmdb-movie-grid,
    .movie-archive-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
}

/* --- Actor & Director Directory Styles --- */
.tmdb-directory-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.directory-header {
    text-align: center;
    margin-bottom: 40px;
}

.directory-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 30px 0;
}

.directory-search-box {
    position: relative;
    max-width: 600px;
    margin: 0 auto 20px;
}

.directory-search-input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    font-size: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 50px;
    transition: all 0.3s ease;
    outline: none;
}

.directory-search-input:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 4px rgba(34, 113, 177, 0.1);
}

.directory-search-box .search-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    pointer-events: none;
}

.directory-count {
    font-size: 1rem;
    color: #64748b;
    font-weight: 500;
}

.directory-count .count-total,
.directory-count .count-filtered {
    font-weight: 700;
    color: #2271b1;
}

/* Directory Grid */
.directory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.directory-card {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.directory-card:hover {
    border-color: #2271b1;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    transform: translateY(-4px);
}

.directory-card-inner {
    display: flex;
    align-items: center;
    gap: 15px;
}

.directory-avatar {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.directory-avatar .avatar-icon {
    font-size: 36px;
    filter: brightness(0) invert(1);
}

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

.directory-person-name {
    margin: 0 0 8px 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
}

.directory-person-name a {
    color: #0f172a;
    text-decoration: none;
    transition: color 0.2s ease;
}

.directory-person-name a:hover {
    color: #2271b1;
}

.directory-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.movie-count {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 500;
    background: #f1f5f9;
    padding: 4px 12px;
    border-radius: 20px;
}

/* No Results Message */
.directory-no-results {
    text-align: center;
    padding: 60px 20px;
    background: #f8fafc;
    border-radius: 12px;
    border: 2px dashed #cbd5e1;
}

.directory-no-results p {
    font-size: 1.2rem;
    color: #64748b;
    margin: 0;
}

/* Responsive Directory */
@media (max-width: 768px) {
    .directory-title {
        font-size: 2rem;
    }
    
    .directory-search-input {
        font-size: 14px;
        padding: 12px 45px 12px 15px;
    }
    
    .directory-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 20px;
    }
    
    .directory-card {
        padding: 15px;
    }
    
    .directory-avatar {
        width: 60px;
        height: 60px;
    }
    
    .directory-avatar .avatar-icon {
        font-size: 30px;
    }
    
    .directory-person-name {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .tmdb-directory-wrapper {
        padding: 15px;
    }
    
    .directory-title {
        font-size: 1.75rem;
        margin-bottom: 20px;
    }
    
    .directory-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .directory-card-inner {
        gap: 12px;
    }
    
    .directory-avatar {
        width: 50px;
        height: 50px;
    }
    
    .directory-avatar .avatar-icon {
        font-size: 24px;
    }
    
    .directory-person-name {
        font-size: 1rem;
    }
    
    .movie-count {
        font-size: 0.85rem;
    }
}