/**
 * Module 30: Common CSS Styles
 * 
 * Base styles shared across all themes
 * Includes reset, typography, layout, and utility classes
 * 
 * @version 1.1.1 - Stage 4: completed DELIBERATELY FIXED markers for lint
 * @version 1.1.0 - Stage 2: converted 110 hardcoded colour declarations to
 *                  tokens (incl. removing the Netflix-red #E50914 baked into
 *                  buttons/focus/pagination on every theme); added
 *                  --surface-subtle, --on-primary, --primary-hover; marked
 *                  deliberately-fixed colour families
 * @version 1.0.7 - Stage 1: added :root surface token defaults
 * @version 1.0.6
 * @created 2024-09-28
 * @updated 2024-12-19 - Added comprehensive search page styling
 */

/* ---------------------------------------------------------------------------
   SURFACE TOKEN DEFAULTS  (Stage 1)

   The five palette colours (--primary/secondary/accent/text/background) are
   injected per event by header.php. These tokens describe SURFACES rather than
   the palette, and every theme CSS overrides them in its own :root.

   These values are fallbacks only. They exist so that a theme which omits a
   token still resolves to something legible instead of inheriting the body
   colour -- which is exactly how the Canvas white-on-white bug happened.

     --card-background   background of a raised panel
     --surface-ink       body text ON that panel (NOT the same as --text-color:
                         a dark theme has light --text-color but still needs
                         dark ink on a white card)
     --surface-muted     secondary text on that panel
     --border-color      hairlines and dividers
     --shadow-color      resting shadow
     --hover-shadow      raised shadow
     --surface-subtle    recessed neutral strip (filter bars, image wells)
     --on-primary        text placed on a --primary-color background
     --primary-hover     hover shade of primary (defaults to primary itself)
   --------------------------------------------------------------------------- */
:root {
    --card-background: #FFFFFF;
    --surface-ink: #333333;
    --surface-muted: #666666;
    --border-color: #E0E0E0;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --hover-shadow: rgba(0, 0, 0, 0.2);
    --surface-subtle: #F5F5F5;                 /* recessed strip / filter bar / image well */
    --on-primary: #FFFFFF;                     /* text sitting ON --primary-color */
    --primary-hover: var(--primary-color);     /* hover shade of primary; themes may darken */
}

/* CSS Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color, #333);
    background: var(--background-color, #fff);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

/* Layout Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-fluid {
    width: 100%;
    padding: 0 20px;
}

/* Header */
.site-header {
    background: var(--card-background);
    box-shadow: 0 2px 4px var(--shadow-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.main-nav a {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background 0.3s ease;
}

/* DELIBERATELY FIXED: faint ink wash; themes restyle nav wholesale */
.main-nav a:hover,
.main-nav a.active {
    background: rgba(0,0,0,0.05);
}

/* Book Meeting Button */
.btn-book-meeting {
    background: var(--primary-color);
    color: var(--on-primary) !important;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-book-meeting:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--hover-shadow);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--surface-ink);
    margin: 5px 0;
    transition: 0.3s;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem 0;
}

/* Footer */
/* DELIBERATELY FIXED: dark neutral shell default; themes restyle the footer */
.site-footer {
    background: #222;
    color: #fff;
    padding: 2rem 0;
    margin-top: auto;
}

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

.social-links {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

/* DELIBERATELY FIXED: neutral plates on the fixed dark footer */
.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    transition: background 0.3s ease;
}

/* DELIBERATELY FIXED: see .social-links a */
.social-links a:hover {
    background: rgba(255,255,255,0.2);
}

/* Companies Page Layout - ADDED */
.companies-page-container,
.films-page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 20px;
}

.content-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.filter-sidebar-container {
    background: var(--surface-subtle);
    padding: 1.5rem;
    border-radius: 8px;
    height: fit-content;
    position: sticky;
    top: 80px;
}

.companies-content,
.films-content {
    min-height: 500px;
}

.controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--surface-subtle);
    border-radius: 8px;
}

/* Company Grid and Films Grid - Updated to support both */
.company-grid,
.companies-grid,
.films-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

/* Company Card - Works for both companies and films */
.company-card,
.film-card {
    background: var(--card-background);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px var(--shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.company-card-link,
.film-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.company-card:hover,
.film-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px var(--hover-shadow);
}

/* DELIBERATELY FIXED: scrims over imagery need black->transparent + white text on every theme */
.company-card-overlay,
.film-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    padding: 1rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.company-card:hover .company-card-overlay,
.film-card:hover .film-card-overlay {
    transform: translateY(0);
}

.view-details {
    font-weight: 600;
    display: block;
    text-align: right;
}

/* Company Logo - FIXED FOR TRANSPARENCY */
.company-logo,
.company-card-logo {
    width: 100%;
    height: 200px;
    object-fit: contain;
    padding: 1rem;
    background: transparent; /* Support transparent logos */
}

/* Film Poster - FIXED TO PREVENT CROPPING */
.film-poster {
    width: 100%;
    position: relative;
    background: var(--surface-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px; /* Minimum for placeholders */
    /* No max-height - let it grow as needed */
}

.company-logo-image,
.film-poster-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* CRITICAL FIX: Film poster images should never crop */
.film-poster-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain; /* Show entire image, no cropping */
    /* Removed object-fit: cover which was causing cropping */
}

/* DELIBERATELY FIXED: neutral placeholder gradient, palette-independent */
.company-logo-placeholder,
.film-poster-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.company-initial {
    font-size: 3rem;
    font-weight: bold;
}

.film-icon {
    font-size: 3rem;
}

/* Info Sections */
.company-info,
.company-card-info,
.film-info {
    padding: 1rem;
}

.company-name,
.company-card-name,
.film-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.film-company {
    font-size: 0.875rem;
    color: var(--surface-muted);
    margin-bottom: 0.5rem;
}

.activity-badges,
.company-activities,
.film-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.activity-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--surface-subtle);
    border-radius: 20px;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 500;
}

.company-content-counts {
    margin-top: 0.5rem;
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--surface-muted);
}

.content-count {
    display: inline-block;
}

/* Film Status Badge */
/* DELIBERATELY FIXED: white text on inline PHP status colour */
.film-status-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.875rem;
}

/* Quick Links Section */
.quick-links-section {
    background: var(--surface-subtle);
    padding: 3rem 0;
    margin-top: 3rem;
}

.quick-links-section h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--surface-ink);
}

.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.quick-link-card {
    display: block;
    background: var(--card-background);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 8px var(--shadow-color);
    transition: all 0.3s ease;
    cursor: pointer;
}

.quick-link-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px var(--hover-shadow);
    background: var(--primary-color);
    color: var(--on-primary);
}

.quick-link-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    display: block;
}

.quick-link-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: block;
}

.quick-link-desc {
    font-size: 0.875rem;
    opacity: 0.8;
    line-height: 1.4;
}

.quick-link-card:hover .quick-link-desc {
    opacity: 0.9;
    color: var(--on-primary);
    opacity: 0.9;
}

/* Content Grid (Films/Series) */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.content-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.content-card:hover {
    transform: scale(1.05);
}

.content-poster {
    width: 100%;
    height: 300px;
    object-fit: cover;
}

/* DELIBERATELY FIXED: scrim over imagery */
.content-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    color: white;
    padding: 1rem;
}

.content-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.content-company {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* Filter Bar */
.filter-bar {
    background: var(--surface-subtle);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.filter-group {
    margin-bottom: 1rem;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: block;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-checkbox {
    display: none;
}

.filter-checkbox + label {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-checkbox:checked + label {
    background: var(--primary-color);
    color: var(--on-primary);
    border-color: var(--primary-color);
}

/* Tabs */
.tab-navigation {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
}

.tab-button {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
    position: relative;
    transition: color 0.3s ease;
}

.tab-button.active {
    color: var(--primary-color);
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Modal */
/* DELIBERATELY FIXED: modal scrim, dark on every theme */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--card-background);
    border-radius: 12px;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

/* DELIBERATELY FIXED: faint ink wash on close control */
.modal-close:hover {
    background: rgba(0,0,0,0.1);
}

/* Film Detail Modal Specific */
.film-detail {
    padding: 2rem;
}

.film-detail-header {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

.film-detail-poster {
    flex-shrink: 0;
    width: 200px;
}

.film-detail-poster img {
    width: 100%;
    border-radius: 8px;
}

.film-detail-info {
    flex: 1;
}

.film-detail-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.film-detail-company {
    font-size: 1.125rem;
    color: var(--surface-muted);
    margin-bottom: 1rem;
}

.film-detail-status,
.film-detail-director,
.film-detail-stars {
    margin-bottom: 0.75rem;
}

.status-label,
.info-label {
    font-weight: 600;
    margin-right: 0.5rem;
}

.film-detail-section {
    margin-bottom: 2rem;
}

.film-detail-section h3 {
    margin-bottom: 1rem;
    color: var(--surface-ink);
}

.film-detail-actions {
    margin-top: 2rem;
    text-align: center;
}

/* Search Box */
.search-container {
    max-width: 600px;
    margin: 2rem auto;
}

.search-form {
    display: flex;
    gap: 1rem;
}

.search-input {
    flex: 1;
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-button {
    padding: 0.75rem 2rem;
    background: var(--primary-color);
    color: var(--on-primary);
    border: none;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.search-button:hover {
    background: var(--primary-hover);
}

/* Status Colors */
/* DELIBERATELY FIXED: semantic status colours; must not follow the theme palette */
.status-released-intl { color: #22c55e; }
/* DELIBERATELY FIXED: semantic status colour */
.status-released-thai { color: #eab308; }
/* DELIBERATELY FIXED: semantic status colour */
.status-post-prod { color: #3b82f6; }
/* DELIBERATELY FIXED: semantic status colour */
.status-in-prod { color: #3b82f6; }
/* DELIBERATELY FIXED: semantic status colour */
.status-in-dev { color: #a855f7; }
/* DELIBERATELY FIXED: semantic status colour */
.status-seeking-coprod { color: #ef4444; }
/* DELIBERATELY FIXED: semantic status colour */
.status-completed { color: #6b7280; }

/* Genre Badges */
/* DELIBERATELY FIXED: informational badge pair, palette-independent */
.genre-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #e0e7ff;
    color: #4338ca;
    border-radius: 12px;
    font-size: 0.875rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Video Embed */
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    margin: 2rem 0;
}

.video-container iframe,
.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--on-primary);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--hover-shadow);
}

/* DELIBERATELY FIXED: neutral action, intentionally outside the palette */
.btn-secondary {
    background: #6b7280;
    color: white;
}

/* DELIBERATELY FIXED: see .btn-secondary */
.btn-secondary:hover {
    background: #4b5563;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-0 { padding: 0; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-grid { display: grid !important; }

.flex-wrap { flex-wrap: wrap; }
.justify-center { justify-content: center; }
.align-center { align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* Loading State */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

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

/* Breadcrumbs */
.breadcrumbs {
    padding: 1rem 0;
    font-size: 0.875rem;
    color: var(--surface-muted);
}

.breadcrumbs a {
    color: var(--surface-muted);
}

.breadcrumbs a:hover {
    color: var(--primary-color);
}

.breadcrumbs span {
    margin: 0 0.5rem;
}

/* Event Banner */
.event-banner {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 2rem;
}

/* Company Page Layout */
.company-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.company-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.sidebar-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.company-main {
    min-height: 500px;
}

/* Representatives List */
.representatives-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.representative-card {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--surface-subtle);
    border-radius: 8px;
}

.representative-portrait {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.representative-info {
    flex: 1;
}

.representative-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.representative-title {
    font-size: 0.875rem;
    color: var(--surface-muted);
}

/* Page Header */
.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.page-subtitle {
    font-size: 1.125rem;
    color: var(--surface-muted);
}

/* Results Info */
.results-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.filtered-results,
.total-results {
    font-size: 1rem;
    color: var(--surface-ink);
}

/* Pagination - ADDED */
.pagination-container {
    margin-top: 3rem;
    display: flex;
    justify-content: center;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.pagination-list {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    padding: 0;
    margin: 0;
}

.pagination-item {
    display: inline-block;
}

.pagination-link {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--surface-ink);
    text-decoration: none;
    transition: all 0.3s ease;
}

.pagination-link:hover {
    background: var(--surface-subtle);
    border-color: var(--surface-muted);
}

.pagination-link.current {
    background: var(--primary-color);
    color: var(--on-primary);
    border-color: var(--primary-color);
}

.pagination-prev,
.pagination-next {
    font-weight: 600;
}

.pagination-ellipsis {
    padding: 0.5rem;
    color: var(--surface-muted);
}

/* No Results */
.no-results {
    text-align: center;
    padding: 3rem;
    color: var(--surface-muted);
}

.no-results p {
    margin-bottom: 1.5rem;
    font-size: 1.125rem;
}

/* ============================================
   SEARCH PAGE STYLES - Added v1.0.6
   ============================================ */

/* Search Page Container */
.search-page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 20px;
}

/* Search Form Section */
.search-form-section {
    margin-bottom: 3rem;
}

.search-form-section .page-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 2rem;
}

/* Search Input Group */
.search-input-group {
    display: flex;
    gap: 1rem;
    max-width: 800px;
    margin: 0 auto;
    align-items: stretch;
}

.search-input-group .search-input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.search-input-group .search-input:focus {
    border-color: var(--primary-color);
    outline: none;
}

/* Search Type Select */
.search-type-select {
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--card-background);
    cursor: pointer;
    min-width: 150px;
}

.search-type-select:focus {
    border-color: var(--primary-color);
    outline: none;
}

/* Search Submit Button */
.search-submit {
    padding: 1rem 2rem;
    white-space: nowrap;
}

/* Search Actions */
.search-actions {
    text-align: center;
    margin-top: 1rem;
}

.btn-clear-search {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background: var(--surface-subtle);
    color: var(--surface-muted);
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.3s ease;
}

/* DELIBERATELY FIXED: hover shade of the neutral clear action */
.btn-clear-search:hover {
    background: #e5e5e5;
}

/* Search Summary */
.search-summary {
    text-align: center;
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--surface-subtle);
    border-radius: 8px;
}

.search-summary h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.search-summary em {
    color: var(--primary-color);
    font-style: normal;
    font-weight: 600;
}

/* Search Results Section */
.search-results {
    margin-top: 3rem;
}

/* Result Section */
.result-section {
    margin-bottom: 3rem;
}

.result-section-title {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    color: var(--surface-ink);
}

/* Companies Results */
.companies-results {
    display: grid;
    gap: 1.5rem;
}

.company-result-card {
    background: var(--card-background);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px var(--shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.company-result-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px var(--hover-shadow);
}

.company-result-link {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
}

.company-result-logo {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-subtle);
    border-radius: 8px;
    overflow: hidden;
}

.company-result-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

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

.company-result-name {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--surface-ink);
}

.company-result-excerpt {
    color: var(--surface-muted);
    line-height: 1.6;
}

/* Films Results Grid */
.films-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 2rem;
}

.film-result-card {
    background: var(--card-background);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px var(--shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.film-result-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px var(--hover-shadow);
}

.film-result-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.film-result-poster {
    width: 100%;
    height: 300px;
    background: var(--surface-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.film-result-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.film-result-info {
    padding: 1rem;
}

.film-result-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--surface-ink);
}

.film-result-company {
    font-size: 0.875rem;
    color: var(--surface-muted);
}

/* Series Results Grid */
.series-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 2rem;
}

.series-result-card {
    background: var(--card-background);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px var(--shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.series-result-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px var(--hover-shadow);
}

.series-result-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.series-result-poster {
    width: 100%;
    height: 300px;
    background: var(--surface-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.series-result-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.series-result-info {
    padding: 1rem;
}

.series-result-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--surface-ink);
}

.series-result-company {
    font-size: 0.875rem;
    color: var(--surface-muted);
    margin-bottom: 0.25rem;
}

.series-result-episodes {
    font-size: 0.875rem;
    color: var(--surface-muted);
}

/* Representatives Results */
.representatives-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.rep-result-card {
    background: var(--card-background);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px var(--shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.rep-result-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px var(--hover-shadow);
}

.rep-result-link {
    display: block;
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
}

.rep-result-info {
    text-align: left;
}

.rep-result-name {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--surface-ink);
}

.rep-result-title {
    font-size: 0.875rem;
    color: var(--surface-muted);
    margin-bottom: 0.25rem;
}

.rep-result-company {
    font-size: 0.875rem;
    color: var(--surface-muted);
}

/* Search Tips Section */
.search-tips {
    background: var(--surface-subtle);
    padding: 3rem;
    border-radius: 12px;
    margin-top: 3rem;
}

.search-tips h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: var(--surface-ink);
}

.search-tips h3 {
    font-size: 1.25rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--surface-ink);
}

.search-tips ul {
    list-style-position: inside;
    margin-bottom: 1.5rem;
}

.search-tips li {
    margin-bottom: 0.5rem;
    color: var(--surface-muted);
    line-height: 1.6;
}

/* Popular Searches */
.popular-searches {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.popular-search-tag {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--surface-muted);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.popular-search-tag:hover {
    background: var(--primary-color);
    color: var(--on-primary);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .content-layout {
        grid-template-columns: 1fr;
    }
    
    .filter-sidebar-container {
        position: static;
    }
    
    .films-grid,
    .companies-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .company-layout {
        grid-template-columns: 1fr;
    }
    
    .company-sidebar {
        position: static;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .main-nav ul {
        display: none;
    }
    
    /* Search Page Mobile Adjustments */
    .search-input-group {
        flex-direction: column;
    }
    
    .search-type-select {
        width: 100%;
    }
    
    .company-result-link {
        flex-direction: column;
        text-align: center;
    }
    
    .films-results-grid,
    .series-results-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .representatives-results {
        grid-template-columns: 1fr;
    }
}

/* Per-logo zoom (Admin > Media > Logos): --logo-zoom is set inline on the
   logo image; the logo's frame clips anything that grows past its edges. */
.company-logo-img,
.company-card-logo img,
.company-logo-image,
.company-result-logo img {
    scale: var(--logo-zoom, 1);
}

.company-logo-item,
.company-card-logo,
.company-result-logo {
    overflow: hidden;
}
