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

body {
     font-family: 'Linux Libertine', 'Georgia', 'Times', serif;
     background: #fff;
     color: #202122;
     font-size: 14px;
     line-height: 1.6;
}

/* ── HEADER ── */
header {
     background: #fff;
     border-bottom: 1px solid #a2a9b1;
     position: sticky;
     top: 0;
     z-index: 100;
}

.header-inner {
     padding: 0.6rem 1.5rem;
     display: flex;
     align-items: center;
     gap: 1rem;
}

.logo-title {
     font-family: 'Linux Libertine', 'Georgia', serif;
     font-size: 1.5rem;
     color: #202122;
     font-weight: normal;
     display: flex;
     align-items: center;
}

.header-sub {
     font-size: 0.8rem;
     color: #54595d;
     border-left: 1px solid #a2a9b1;
     padding-left: 1rem;
}

/* ── HOME HUB ── */
.home-wrap {
     max-width: 860px;
     margin: 2rem auto;
     padding: 0 1.5rem 3rem;
     display: flex;
     flex-direction: column;
     gap: 2rem;
}

.home-nav-section {
     display: flex;
     flex-direction: column;
     gap: 0.5rem;
}

.home-section-label {
     font-size: 0.8rem;
     color: #54595d;
     text-transform: uppercase;
     letter-spacing: 0.08em;
     border-bottom: 1px solid #a2a9b1;
     padding-bottom: 0.35rem;
}

.home-nav-grid {
     display: flex;
     gap: 0.5rem;
     flex-wrap: wrap;
}

.home-nav-btn {
     padding: 0.45rem 1.1rem;
     background: #f8f9fa;
     border: 1px solid #a2a9b1;
     color: #3366cc;
     font-family: inherit;
     font-size: 0.88rem;
     cursor: pointer;
     transition: background 0.15s;
}

.home-nav-btn:hover {
     background: #eaf0fb;
     border-color: #3366cc;
     text-decoration: underline;
}

/* ── SEARCH AREA ── */
.search-area {
     max-width: 860px;
     margin: 2rem auto;
     padding: 0 1.5rem;
}

.search-area h2 {
     font-family: 'Linux Libertine', 'Georgia', serif;
     font-size: 1.1rem;
     font-weight: normal;
     color: #54595d;
     margin-bottom: 0.75rem;
}

.search-row {
     display: flex;
     gap: 0.5rem;
}

#search {
     flex: 1;
     padding: 0.45rem 0.6rem;
     border: 1px solid #a2a9b1;
     background: #fff;
     color: #202122;
     font-family: inherit;
     font-size: 1rem;
     outline: none;
}

#search:focus {
     border-color: #3366cc;
     box-shadow: 0 0 0 1px #3366cc;
}

#search::placeholder {
     color: #a2a9b1;
}

.btn-search {
     padding: 0.45rem 1rem;
     background: #f8f9fa;
     border: 1px solid #a2a9b1;
     color: #202122;
     font-family: inherit;
     font-size: 0.9rem;
     cursor: pointer;
}

.btn-search:hover {
     background: #e8e9ea;
}

/* ── STATUS ── */
#status-msg,
#cat-status {
     font-size: 0.85rem;
     color: #54595d;
     margin-top: 0.5rem;
     min-height: 1.2rem;
}

#status-msg.error,
#cat-status.error {
     color: #cc3300;
}

/* ── LAYOUT ── */
.content {
     max-width: 860px;
     margin: 0 auto;
     padding: 0 1.5rem 3rem;
     display: grid;
     grid-template-columns: 1fr 380px;
     gap: 2rem;
     align-items: start;
}

@media (max-width: 760px) {
     .content {
          grid-template-columns: 1fr;
     }
}

/* ── RESULTS ── */
.results-header {
     display: flex;
     align-items: baseline;
     justify-content: space-between;
     border-bottom: 1px solid #a2a9b1;
     padding-bottom: 0.3rem;
     margin-bottom: 0.75rem;
}

.results-header h3 {
     font-family: 'Linux Libertine', 'Georgia', serif;
     font-size: 1.1rem;
     font-weight: normal;
}

#result-count,
#latest-count,
#cat-count {
     font-size: 0.8rem;
     color: #54595d;
}

#results,
#latest-results,
#cat-results {
     list-style: none;
}

#results li,
#latest-results li,
#cat-results li {
     padding: 0.6rem 0;
     border-bottom: 1px solid #eaecf0;
     cursor: pointer;
}

#results li:hover .movie-title,
#latest-results li:hover .movie-title,
#cat-results li:hover .movie-title {
     color: #3366cc;
     text-decoration: underline;
}

#results li.active .movie-title,
#latest-results li.active .movie-title,
#cat-results li.active .movie-title {
     color: #3366cc;
     font-weight: bold;
}

.movie-title {
     font-size: 0.95rem;
     color: #202122;
}

.movie-meta {
     font-size: 0.8rem;
     color: #54595d;
     margin-top: 0.15rem;
}

.empty-state {
     font-size: 0.9rem;
     color: #54595d;
     padding: 1rem 0 !important;
     border: none !important;
     cursor: default !important;
}

/* ── DETAILS PANEL ── */
.details-panel {
     border: 1px solid #a2a9b1;
     padding: 1rem;
     background: #f8f9fa;
     font-size: 0.9rem;
}

.details-panel.hidden {
     display: none;
}

.details-placeholder {
     color: #54595d;
     font-style: italic;
     font-size: 0.85rem;
}

.detail-block {
     margin-bottom: 0.75rem;
}

.detail-label {
     display: block;
     font-weight: bold;
     font-size: 0.8rem;
     color: #202122;
     margin-bottom: 0.15rem;
}

.detail-value {
     color: #202122;
     line-height: 1.55;
}

.rating-chip {
     background: #fff;
     border: 1px solid #a2a9b1;
     padding: 0.3rem 0.6rem;
     font-size: 0.8rem;
}

.rating-source {
     color: #54595d;
     display: block;
     font-size: 0.72rem;
}

.rating-value {
     color: #202122;
     font-weight: bold;
}

#close-details {
     float: right;
     background: none;
     border: none;
     color: #54595d;
     font-size: 1rem;
     cursor: pointer;
     padding: 0 0 0.5rem 0.5rem;
}

#close-details:hover {
     color: #cc3300;
}

/* ── FOOTER ── */
footer {
     border-top: 1px solid #a2a9b1;
     text-align: center;
     padding: 1rem;
     font-size: 0.8rem;
     color: #54595d;
}

footer a {
     color: #3366cc;
     text-decoration: none;
}

footer a:hover {
     text-decoration: underline;
}

/* ── MODAL ── */
.movie-modal-overlay {
     position: fixed;
     inset: 0;
     background: rgba(0, 0, 0, 0.55);
     z-index: 500;
     display: flex;
     align-items: center;
     justify-content: center;
     padding: 1.5rem;
     opacity: 0;
     pointer-events: none;
     transition: opacity 180ms ease;
}

.movie-modal-overlay.open {
     opacity: 1;
     pointer-events: all;
}

.movie-modal {
     background: #f8f9fa;
     border: 1px solid #a2a9b1;
     width: 100%;
     max-width: 820px;
     max-height: 90vh;
     overflow-y: auto;
     transform: translateY(20px);
     transition: transform 200ms ease;
     font-family: 'Linux Libertine', 'Georgia', 'Times', serif;
     font-size: 14px;
     color: #202122;
}

.movie-modal-overlay.open .movie-modal {
     transform: translateY(0);
}

.movie-modal-header {
     padding: 0.85rem 1rem 0.6rem;
     border-bottom: 1px solid #a2a9b1;
     display: flex;
     align-items: flex-start;
     justify-content: space-between;
     gap: 1rem;
     background: #fff;
}

.movie-modal-title {
     font-family: 'Linux Libertine', 'Georgia', serif;
     font-size: 1.35rem;
     font-weight: normal;
     color: #202122;
     line-height: 1.3;
}

.movie-modal-close {
     background: none;
     border: none;
     color: #54595d;
     font-size: 1rem;
     cursor: pointer;
     flex-shrink: 0;
     padding: 0;
     line-height: 1;
}

.movie-modal-close:hover {
     color: #cc3300;
}

.movie-modal-meta {
     font-size: 0.8rem;
     color: #54595d;
     padding: 0.4rem 1rem 0.6rem;
     background: #fff;
     border-bottom: 1px solid #a2a9b1;
}

.movie-modal-body {
     padding: 1rem;
     display: grid;
     grid-template-columns: 180px 1fr;
     gap: 1.25rem;
     align-items: start;
}

.movie-modal-poster img {
     width: 100%;
     display: block;
     border: 1px solid #a2a9b1;
}

.movie-modal-poster-placeholder {
     width: 100%;
     height: 260px;
     background: #eaecf0;
     border: 1px solid #a2a9b1;
     display: flex;
     align-items: center;
     justify-content: center;
     color: #a2a9b1;
     font-size: 0.8rem;
}

.movie-modal-ratings {
     display: flex;
     flex-wrap: wrap;
     gap: 0.4rem;
     margin-top: 0.25rem;
}

@media (max-width: 560px) {
     .movie-modal-body {
          grid-template-columns: 1fr;
     }
}

/* ── DECADE DROPDOWN ── */
#decade-filter {
     padding: 0.45rem 0.6rem;
     border: 1px solid #a2a9b1;
     background: #fff;
     color: #202122;
     font-family: inherit;
     font-size: 0.9rem;
     cursor: pointer;
     outline: none;
}

#decade-filter:focus {
     border-color: #3366cc;
     box-shadow: 0 0 0 1px #3366cc;
}

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
     .home-nav-grid {
          flex-direction: column;
     }

     .home-nav-btn {
          width: 100%;
     }
}

/* ── SEARCH BLOCKS ── */
.search-block {
     display: flex;
     flex-direction: column;
     gap: 0.35rem;
     margin-bottom: 1rem;
}

.search-block--divided {
     border-top: 1px solid #eaecf0;
     padding-top: 1rem;
}

.search-label {
     font-size: 0.78rem;
     color: #54595d;
     text-transform: uppercase;
     letter-spacing: 0.07em;
}

.search-block input[type="text"] {
     width: 100%;
     padding: 0.55rem 0.75rem;
     border: 1px solid #a2a9b1;
     background: #fff;
     color: #202122;
     font-family: inherit;
     font-size: 0.95rem;
     outline: none;
}

.search-block input[type="text"]:focus {
     border-color: #3366cc;
     box-shadow: 0 0 0 1px #3366cc;
}

.search-block input[type="text"]::placeholder {
     color: #a2a9b1;
}

.search-hint {
     font-size: 0.78rem;
     color: #72777d;
     line-height: 1.5;
     margin-top: 0.25rem;
}

/* ── FILTERS GRID ── */
.search-filters-grid {
     display: grid;
     grid-template-columns: 1fr 1fr 1fr 1fr;
     gap: 0.5rem;
}

.search-filters-grid select {
     padding: 0.45rem 0.5rem;
     border: 1px solid #a2a9b1;
     background: #fff;
     color: #202122;
     font-family: inherit;
     font-size: 0.88rem;
     cursor: pointer;
     outline: none;
     width: 100%;
}

.search-filters-grid select:focus {
     border-color: #3366cc;
     box-shadow: 0 0 0 1px #3366cc;
}

/* ── SEARCH BUTTON FULL WIDTH ── */
.btn-search--full {
     width: 100%;
     padding: 0.6rem 1rem;
     font-size: 0.95rem;
     margin-bottom: 0.25rem;
}

/* ── MEDIA QUERIES ── */
@media (max-width: 760px) {
     .content {
          grid-template-columns: 1fr;
     }

     .search-filters-grid {
          grid-template-columns: 1fr 1fr;
     }
}

@media (max-width: 560px) {
     .movie-modal-body {
          grid-template-columns: 1fr;
     }

     .search-filters-grid {
          grid-template-columns: 1fr 1fr;
     }

     .search-block input[type="text"] {
          font-size: 1rem;
     }

     .btn-search--full {
          padding: 0.75rem 1rem;
          font-size: 1rem;
     }
}

@media (max-width: 480px) {
     .search-filters-grid {
          grid-template-columns: 1fr;
     }

     .home-nav-btn {
          width: 100%;
     }

     .header-inner {
          padding: 0.5rem 1rem;
     }
}