@charset "UTF-8";

/* ===================== */
/* BASE STYLES & RESET   */
/* ===================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-weight: normal;
    font-family: Raleway;
}

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
}

body {
    min-height: 100vh;
    background-color: #0d0d0d;
    color: #d0d8e6;
    font-size: 1.1rem;
}

:root {
    --bg-dark: #1a202c;
    --text-light: #e2e8f0;
    --border-color: #4a5568;
    --accent-color: #4299e1;
    --hover-color: #2b6cb0;
    --panel-radius: 15px;
    --transition-speed: 0.3s;
}

/* ===================== */
/* LAYOUT & CONTAINERS   */
/* ===================== */
.a-container {
    display: flex;
    flex-direction: row;
    gap: 15px;
    height: 100vh;
    padding: 15px;
    box-sizing: border-box;
    width: 100%;
    transition: all var(--transition-speed) ease;
}

.panel {
    background-color: #1a1a1a;
    border-radius: var(--panel-radius);
    display: flex !important;
    flex-direction: column;
    min-height: 200px;
    overflow: hidden;
    padding: 10px;
    box-sizing: border-box;
    color: #d0d8e6;
    margin-bottom: 10px;
    border: 1px solid transparent;
    transition: border var(--transition-speed) ease;
    flex: 1;
    max-height: calc(100vh - 30px - 10px);
}

.panel:hover,
.panel:focus {
    border: 1px solid #007bff;
}

/* Panel specific styles */
#panel-a {
    --collapsed-width: 60px;
    --expanded-width: 30%;
    position: relative;
    flex: 3.6;
    width: var(--collapsed-width);
    min-width: var(--collapsed-width);
    max-width: var(--collapsed-width);
    transition: width var(--transition-speed) ease, min-width var(--transition-speed) ease;
    overflow-y: auto;
}

#panel-a.expanded {
    width: var(--expanded-width) !important;
    min-width: 250px !important;
    max-width: 350px !important;
    overflow-y: auto;
}

#panel-b {
    flex: 3.4;
    transition: all var(--transition-speed) ease;
    min-height: 0 !important;
    height: 100vh !important;
}

#panel-c {
    flex: 3;
    transition: all var(--transition-speed) ease;
    min-height: 0 !important;
    height: 100vh !important;
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    width: 100%;
    opacity: 1;
    transition: opacity 0.2s ease 0.1s;
}

#panel-a.collapsed .panel-content {
    opacity: 0;
    pointer-events: none;
}

/* ===================== */
/* SCROLLING SYSTEM - UPDATED */
/* ===================== */
/* Central and Right Panel Containers */
#central-panel.central-panel,
#right-panel.right-panel {
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    flex: 1 1 auto !important;
    /* Changed from 1 to 1 1 auto */
    overflow: hidden !important;
    height: 100% !important;
    /* ADD THIS - critical for both desktop & mobile */
}

/* Content areas that hold loaded templates */
#central-cover.panel-content,
#right-cover.panel-content {
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    flex: 1 1 auto !important;
    /* Changed from 1 to 1 1 auto */
    overflow: hidden !important;
    height: 100% !important;
    /* ADD THIS - critical for both desktop & mobile */
}

/* Marco div from templates - this should scroll */
.marco {
    flex: 1 !important;
    overflow-y: auto !important;
    min-height: 0 !important;
    height: auto !important;
    padding-top: 15px;
    padding-bottom: 15px;
}

/* ===================== */
/* LINK STYLES - CONSISTENT ACROSS COVERS */
/* ===================== */

a {
    color: #99c7f2;
    text-decoration: none;
    transition: color 0.2s ease, text-decoration 0.2s ease;
}

a:hover,
a:focus {
    color: orange;
    text-decoration: underline;
}

a:active {
    color: red;
}

a:visited {
    color: burlywood;
}


/* Base link styles for both containers */
#central-cover a,
#right-cover a {
    color: #99c7f2 !important;
    text-decoration: none !important;
}

#central-cover a:hover,
#central-cover a:focus,
#right-cover a:hover,
#right-cover a:focus {
    color: orange !important;
    text-decoration: underline !important;
}

#central-cover a:active,
#right-cover a:active {
    color: red !important;
}

#central-cover a:visited,
#right-cover a:visited {
    color: burlywood !important;
}

/* Writer link styles */
.writer-link {
    color: #99c7f2;
    text-decoration: none;
    cursor: pointer;
    display: block;
    padding: 2px 0 !important;
}

.writer-link:hover,
.writer-link:focus {
    color: orange;
    text-decoration: underline;
}

.writer-link:active {
    color: red;
}

.writer-link:visited {
    color: burlywood;
}

/* ===================== */
/* HEADER STYLES         */
/* ===================== */
.left-header,
.central-header,
.right-header {
    color: #d0d8e6;
    background-color: #1a1a1a;
    padding: 10px;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.left-header .navbar {
    display: flex;
    flex: 0 0 auto;
    justify-content: center;
}

.left-header .nav-links {
    display: flex;
    gap: 20px;
    margin-left: 0;
}

.central-header {
    justify-content: center;
    width: 100%;
    padding: 10px 15px;
    box-sizing: border-box;
}

/* ===================== */
/* NAVBAR COMPONENTS     */
/* ===================== */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    background-color: inherit;
    border: none;
    font-size: 1.2rem;
    height: 100%;
    box-sizing: border-box;
    position: relative;
}

.navbar-nav.right {
    margin-left: auto;
}

.navbar-toggler {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
}

.navbar-collapse {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.navbar-nav {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.navbar-title {
    color: burlywood;
    font-size: 1.2rem;
    white-space: nowrap;
    padding-right: 15px;
    margin: 0;
    line-height: 1;
}

.navbar-brand,
.navbar-title,
.nav-links {
    display: flex;
    align-items: center;
    height: 100%;
}

.navbar-brand img {
    height: 40px;
    width: auto;
    display: block;
}

.nav-links {
    display: flex;
    align-items: center;
    height: 100%;
    margin-left: 20px;
    gap: 15px;
}

.nav-links.right {
    margin-left: auto;
    padding-right: 15px;
}

.nav-item {
    margin: 0 10px;
}

.nav-link {
    text-decoration: none;
    font-size: 16px;
    white-space: nowrap;
}

.nav-link:hover {
    color: orange;
}

/* Dropdown */
.dropdown {
    position: relative;
    z-index: 100;
}

.dropdown-btn {
    background: none;
    border: none;
    color: #99c7f2;
    font-size: 16px;
    cursor: pointer;
    white-space: nowrap;
    padding: 0 16px;
    height: 100%;
    display: flex;
    align-items: center;
    transition: color 0.3s ease;
}

.dropdown-btn i.fa-caret-down {
    transition: transform 0.2s ease;
    margin-left: 5px;
}

.dropdown-btn i.fa-caret-down.rotated {
    transform: rotate(180deg);
}

.dropdown-menu {
    display: none;
    position: fixed;
    top: calc(100% + 5px);
    right: 15px;
    background-color: #2c3e50;
    border: 1px solid #3a4f63;
    border-radius: 4px;
    padding: 10px;
    min-width: 180px;
    z-index: 1051;
    list-style: none;
    margin: 2px 0 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.dropdown-menu.active {
    display: block;
}

.dropdown-menu a,
.dropdown-menu button {
    color: #99c7f2;
    background: none;
    border: none;
    text-align: left;
    width: 100%;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    display: block;
    padding: 8px 12px;
}

.dropdown-menu a:hover,
.dropdown-menu button:hover {
    color: orange !important;
    text-decoration: underline;
}

/* ===================== */
/* BUTTON STYLES         */
/* ===================== */
.tiny-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #333333;
    padding: 5px 10px;
    margin: 0 4px;
    border-radius: 12px;
    font-size: 12px;
    transition: background-color 0.3s ease, color 0.3s ease;
    border: none;
    height: 28px;
    min-width: 60px;
    cursor: pointer;
}

.tiny-button:hover,
.tiny-button:focus {
    background-color: #262626;
    outline: none;
}

.tiny-button:active {
    background-color: #454545;
}

.search-button {
    height: 30px;
    width: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #444;
    border-left: none;
    border-radius: 0 15px 15px 0;
    background-color: #333;
    color: #d0d8e6;
    padding: 0;
    margin-left: -1px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-button:hover {
    background-color: #007bff;
    color: #fff;
}

.search-button:focus {
    outline: 2px solid rgba(0, 123, 255, 0.5);
    outline-offset: 1px;
}

/* ===================== */
/* FORM ELEMENTS         */
/* ===================== */
.search-container {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background-color: #121212;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.search-container:hover,
.search-container:focus-within {
    background-color: #1a1a1a;
    border-color: #007bff;
}

.search-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
    border: 1px solid transparent;
    border-radius: 10px;
}

.search-group:hover,
.search-group:focus {
    border-color: #007bff;
}

.label-container {
    text-align: left;
    margin-bottom: 5px;
}

.search-label {
    white-space: nowrap;
    color: #d0d8e6;
    font-size: 0.8rem;
    display: block;
}

.input-with-icon {
    display: flex;
    align-items: center;
    position: relative;
}

.search-input::placeholder {
    text-align: center;
    color: #99c7f2;
}

.search-input {
    flex-grow: 1;
}

/* ===================== */
/* SELECTOR STYLES       */
/* ===================== */
.selector-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 10px 0;
    margin-bottom: 5px;
    position: relative;
    /* For search results positioning */
}

.selector-container label,
.selector-container .search-label {
    margin-bottom: 5px;
    font-size: 1rem;
    color: #d0d8e6;
    text-align: center;
    width: 100%;
    display: block;
    font-weight: 500;
    line-height: 1.4;
}

/* Improved select styling with controlled width */
.selector-container select,
.selector-container .search-select {
    width: 220px;
    padding: 10px 45px 10px 20px;
    border: 1px solid #555;
    border-radius: 25px;
    background-color: #2a2a2a;
    color: #99c7f2;
    font-size: 1rem;
    text-align: center;
    text-align-last: center;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2399c7f2'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
    font-family: inherit;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.selector-container select:hover,
.selector-container .search-select:hover {
    border-color: #007bff;
    background-color: #333;
}

.selector-container select:focus,
.selector-container .search-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.selector-container select option,
.selector-container .search-select option {
    background-color: #2a2a2a;
    color: #d0d8e6;
    padding: 12px 15px;
    font-size: 0.95rem;
    text-align: left;
}

/* ===================== */
/* SEARCH INPUT STYLES   */
/* ===================== */
.search-input-selector {
    width: 280px !important;
    padding: 10px 45px 10px 20px !important;
    border: 1px solid #555 !important;
    border-radius: 25px !important;
    background-color: #2a2a2a !important;
    color: #99c7f2 !important;
    font-size: 1rem !important;
    text-align: center !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    font-family: inherit !important;
    box-sizing: border-box !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    margin: 0 auto !important;
    display: block !important;
}

.search-input-selector::placeholder {
    color: #99c7f2 !important;
    opacity: 0.7 !important;
    text-align: center !important;
}

.search-input-selector:hover {
    border-color: #007bff !important;
    background-color: #333 !important;
}

.search-input-selector:focus {
    outline: none !important;
    border-color: #007bff !important;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25) !important;
    background-color: #2a2a2a !important;
}

.search-input-selector:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    background-color: #333 !important;
}

.search-input-container {
    position: relative;
    display: flex;
    align-items: center;
    width: fit-content;
    margin: 0 auto;
}

.search-input-container .search-button {
    position: absolute;
    right: 15px;
    background: none;
    border: none;
    color: #99c7f2;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.search-input-container .search-button i {
    font-size: 16px;
}

.search-input-container .search-button:hover {
    color: #007bff;
}

.search-input-selector:disabled+.search-button {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===================== */
/* SEARCH FORM STYLES    */
/* ===================== */
.search-form {
    display: inline-flex;
    align-items: center;
    border: 1px solid transparent;
    border-radius: 20px;
    background-color: #333;
    transition: border-color 0.2s;
    overflow: hidden;
    height: 38px;
    max-width: 100%;
}

.search-form:hover,
.search-form:focus {
    border: 1px solid #007bff;
}

.search-form .search-btn {
    padding: 0 12px;
    border: none;
    background-color: transparent;
    color: #d0d8e6;
    cursor: pointer;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    border-radius: 0 20px 20px 0;
    outline: none;
}

.search-form input {
    background-color: #333;
    border: none;
    color: #d0d8e6;
    padding: 8px 12px;
    height: 100%;
    outline: none;
    flex-grow: 1;
}

/* Navbar Search Components */
.navbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

#cinemaSearchForm,
#literatureSearchForm {
    flex: 1;
    min-width: 0;
    max-width: 600px;
}

.search-box {
    display: flex;
    width: 100%;
}

#cinemaSearchInput,
#literatureSearchInput,
#composerSearchInput {
    flex-grow: 1;
    padding: 8px 20px;
    border: 1px solid #444;
    border-right: none;
    border-radius: 20px 0 0 20px;
    background-color: #333;
    color: #d0d8e6;
    font-size: 1rem;
}

.navbar-right {
    display: flex;
    align-items: center;
    margin-left: auto;
    padding-left: 20px;
}

/* ===================== */
/* TABLES & LISTS        */
/* ===================== */
.mytable {
    width: 100%;
    border-collapse: collapse;
    background-color: transparent;
    color: #d0d8e6;
}

.mytable th,
.mytable td {
    text-align: left;
    vertical-align: middle;
    font-size: 1.1rem;
}

.mytable tr:hover {
    background-color: #121212;
}

.writer-item-container {
    padding: 0 !important;
}

.info-icon {
    text-align: right;
    width: 20px;
}

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

ul {
    list-style-type: none;
}

li {
    margin-bottom: 3px;
    cursor: pointer;
}

li:hover,
li:focus {
    color: lightgreen;
}

.film-item {
    text-decoration: none;
    cursor: pointer;
}

/* ===================== */
/* MOVIE DISCOVERY       */
/* ===================== */
.movie-discovery {
    width: 100%;
    padding: 0;
}

.burly,
h4.burly {
    color: burlywood;
    margin-bottom: 10px;
    font-size: 20px;
}

.selector-label {
    font-size: 1rem;
    margin-right: 10px;
}

.movie-carousel {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 5px;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
    overflow-y: auto;
    max-height: 100vh;
    scrollbar-width: thin;
    scrollbar-color: #444 #121212;
}

.movie-carousel::-webkit-scrollbar {
    width: 8px;
}

.movie-carousel::-webkit-scrollbar-thumb {
    background-color: #444;
    border-radius: 4px;
}

.movie-carousel::-webkit-scrollbar-track {
    background-color: #121212;
}

.movie-card {
    display: flex;
    align-items: center;
    background: #333;
    border-radius: 5px;
    padding: 0;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5);
    max-height: 75px;
    margin-bottom: 5px;
}

.movie-image {
    flex: 0 0 30px;
    height: 30px;
    margin-right: 10px;
    overflow: hidden;
}

.movie-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.movie-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.movie-link {
    font-size: 0.9rem;
    color: #99c7f2;
    text-decoration: none;
}

.movie-link:hover {
    text-decoration: underline;
    color: #ffa500;
}

/* ===================== */
/* ACCORDION             */
/* ===================== */
.sites-accordion,
.literary-container {
    margin-top: 20px;
}

.accordion-header,
.literary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff !important;
    cursor: pointer;
    text-align: left;
    position: relative;
    transition: all 0.3s ease;
}

.accordion-header:hover,
.literary-header:hover {
    background: rgba(255, 255, 255, 0.2);
}

.accordion-icon {
    transform: rotate(-90deg);
    transition: transform 0.3s ease;
}

.accordion-header[aria-expanded="true"] .accordion-icon {
    transform: rotate(0deg);
}

.literary-header::after {
    content: '+';
    font-size: 18px;
    transition: transform 0.3s ease;
}

.literary-header.active::after {
    content: '-';
}

.accordion-content,
.literary-content {
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
    transition: max-height 0.3s ease-out;
}

.accordion-content[aria-hidden="true"],
.literary-content:not(.active) {
    max-height: 0 !important;
}

.accordion-content[aria-hidden="false"],
.literary-content.active {
    max-height: 1000px;
    display: block;
}

.literary-content {
    padding-left: 20px;
    border-left: 2px solid rgba(255, 255, 255, 0.1);
}

.literary-list {
    list-style: none;
    padding: 5px 0 5px 15px;
    margin: 0;
}

.literary-list li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.load-writers-link {
    color: #99c7f2;
    text-decoration: none;
    transition: all 0.3s ease;
    display: block;
    padding: 5px 0;
}

.load-writers-link:hover {
    color: orange;
    text-decoration: underline;
    padding-left: 5px;
}

.literary-info {
    color: rgba(255, 255, 255, 0.6);
    margin-left: 10px;
    transition: color 0.3s ease;
}

.literary-info:hover {
    color: orange;
}

/* ===================== */
/* UTILITY CLASSES       */
/* ===================== */
.loading,
.error-message {
    padding: 20px;
    text-align: center;
    color: #666;
}

.loading-indicator {
    padding: 20px;
    text-align: center;
    color: #666;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: #09f;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.panel-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.panel-error {
    padding: 20px;
    text-align: center;
    color: #d9534f;
}

.panel-error button {
    background: #d9534f;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
}

/* ===================== */
/* FONT AWESOME ICONS    */
/* ===================== */
.fas,
.far,
.fal,
.fab,
.fa {
    display: inline-block;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    line-height: 1;
}

.fa-home:before {
    content: "\f015";
}

/* ===================== */
/* SCROLLBAR STYLING     */
/* ===================== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background-color: transparent;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb {
    background-color: #8a98a8;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #79a6d2;
}

/* ===================== */
/* SEARCH RESULTS */
/* ===================== */
.selector-container {
    position: relative;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: #2a2a2a;
    border: 1px solid #555;
    border-radius: 8px;
    max-height: 300px;
    overflow-y: scroll;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: none;
}

.search-results.show {
    display: block;
}

.search-result-item {
    padding: 8px 20px;
    color: #d0d8e6;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid #3a3a3a;
    font-size: 0.9rem;
    line-height: 1.3;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background-color: #007bff;
    color: white;
}

.search-results::-webkit-scrollbar {
    width: 8px;
}

.search-results::-webkit-scrollbar-track {
    background: #2a2a2a;
    border-radius: 0 8px 8px 0;
}

.search-results::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

.search-results::-webkit-scrollbar-thumb:hover {
    background: #007bff;
}

/* ===================== */
/* RESPONSIVE DESIGN     */
/* ===================== */

/* TABLET BREAKPOINT (768px - 1024px) */
@media (max-width: 1024px) {
    .a-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        gap: 10px;
        padding: 10px;
    }

    #panel-a {
        order: 1;
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 auto;
        height: auto;
        max-height: 40vh;
        overflow-y: auto;
    }

    #panel-a.expanded {
        max-height: 50vh;
    }

    #panel-b {
        order: 2;
        flex: 1;
        width: 100%;
        height: auto;
        max-height: 50vh;
        overflow-y: auto;
    }

    #panel-c {
        order: 3;
        flex: 1;
        width: 100%;
        height: auto;
        min-height: 40vh;
        max-height: none;
        overflow-y: auto;
    }

    .panel-content,
    .central-panel,
    .right-panel {
        overflow-y: auto;
        height: 100%;
    }

    /* Selector responsive */
    .selector-container select,
    .selector-container .search-select {
        width: 250px;
        padding: 9px 40px 9px 18px;
        font-size: 0.95rem;
    }

    .search-input-selector {
        width: 250px !important;
        padding: 9px 40px 9px 18px !important;
        font-size: 0.95rem !important;
    }
}

/* MOBILE BREAKPOINT (480px - 767px) */
@media (max-width: 767px) {
    .a-container {
        padding: 8px;
        gap: 8px;
        height: 100vh;
        overflow: hidden;
    }

    #panel-a {
        max-height: 35vh;
        flex: 0 0 auto;
    }

    #panel-a.expanded {
        max-height: 45vh;
    }

    #panel-b {
        max-height: 35vh;
        flex: 0 0 auto;
    }

    #panel-c {
        flex: 1;
        min-height: 25vh;
        max-height: none;
    }

    .panel-toggle,
    .search-button,
    .search-result-item,
    .tiny-button {
        min-height: 44px;
        min-width: 44px;
    }

    .search-result-item {
        padding: 12px 15px;
    }

    .search-input-selector,
    .selector-container select {
        font-size: 16px !important;
        padding: 12px 40px 12px 15px !important;
    }

    /* Selector responsive */
    .selector-container select,
    .selector-container .search-select {
        width: 220px;
        padding: 8px 35px 8px 16px;
        font-size: 0.9rem;
        background-size: 18px;
        background-position: right 12px center;
    }

    .search-input-selector {
        width: 220px !important;
        padding: 8px 35px 8px 16px !important;
        font-size: 0.9rem !important;
    }

    .search-input-container .search-button {
        right: 12px;
    }

    .search-input-container .search-button i {
        font-size: 14px;
    }

    /* Cinema-specific mobile adjustments */
    .movie-carousel {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .movie-card {
        max-height: 60px;
    }

    .movie-link {
        font-size: 0.8rem;
        padding: 8px;
    }

    .search-group .selector-container {
        margin-bottom: 0.8rem !important;
    }

    .search-group #actor-search,
    .search-group #director-search,
    .search-group .films-by-genre select {
        width: 100% !important;
        max-width: 280px;
    }
}

/* SMALL MOBILE BREAKPOINT (under 480px) */
@media (max-width: 480px) {
    .a-container {
        padding: 5px;
        gap: 5px;
    }

    #panel-a {
        max-height: 30vh;
    }

    #panel-a.expanded {
        max-height: 40vh;
    }

    #panel-b {
        max-height: 30vh;
    }

    #panel-c {
        min-height: 35vh;
    }

    .left-header,
    .central-header,
    .right-header {
        height: 60px;
        padding: 5px 10px;
    }

    .navbar-title {
        font-size: 1rem;
    }

    .nav-links {
        margin-left: 10px;
        gap: 8px;
    }

    .tiny-button {
        font-size: 11px;
        padding: 4px 8px;
        min-width: 50px;
    }

    /* Selector responsive */
    .selector-container select,
    .selector-container .search-select {
        width: 200px;
        padding: 7px 30px 7px 14px;
        font-size: 0.85rem;
        background-size: 16px;
        background-position: right 10px center;
    }

    .selector-container label,
    .selector-container .search-label {
        font-size: 0.9rem;
    }

    .search-input-selector {
        width: 200px !important;
        padding: 7px 30px 7px 14px !important;
        font-size: 0.85rem !important;
    }

    .search-input-container .search-button {
        right: 10px;
    }

    .search-input-container .search-button i {
        font-size: 13px;
    }

    .search-form {
        width: 100%;
    }

    #literatureSearchInput {
        padding: 0 10px;
        min-width: 80px;
    }

    .search-btn {
        padding: 0 10px;
    }
}

/* LANDSCAPE ORIENTATION */
@media (max-height: 600px) and (orientation: landscape) {
    .a-container {
        flex-direction: row;
        height: 100vh;
    }

    #panel-a {
        flex: 2;
        max-height: 100vh;
    }

    #panel-b {
        flex: 3;
        max-height: 100vh;
    }

    #panel-c {
        flex: 2;
        max-height: 100vh;
    }
}

/* IMPROVE SCROLLING ON MOBILE */
@media (max-width: 1024px) {

    html,
    body {
        height: 100%;
        overflow: hidden;
    }

    .a-container {
        height: 100vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .panel {
        -webkit-overflow-scrolling: touch;
    }

    /* Reset any desktop-specific panel layouts */
    #panel-a.collapsed+#panel-b,
    #panel-a.expanded+#panel-b,
    #panel-a.collapsed~#panel-c,
    #panel-a.expanded~#panel-c {
        width: 100% !important;
        margin-left: 0 !important;
        margin-top: 0 !important;
    }

    /* Make sure right panel content is visible */
    #panel-c .right-panel {
        height: auto !important;
        min-height: 100%;
        overflow-y: auto;
    }
}

/* BASE RULE: Hide the mobile nav by default (i.e., on desktop) */
.mobile-nav-aids {
    display: none;
}

/* ========================================================= */
/* --- MOBILE LAYOUT OVERRIDES (767px and below) --- */
/* ========================================================= */

/* ===== MOBILE PANEL STYLES (767px and below) ===== */
@media (max-width: 767px) {

    /* Mobile Navigation Bar - MOVED TO BOTTOM */
    .mobile-nav-aids {
        display: flex;
        justify-content: space-around;
        align-items: center;
        width: 100%;
        height: 50px;
        background-color: #212529;
        position: fixed;
        bottom: 0;
        /* Changed from top: 0 */
        left: 0;
        z-index: 1000;
        box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.2);
        /* Shadow on top now */
    }

    .mobile-nav-aids .nav-item-mobile {
        color: #adb5bd;
        text-decoration: none;
        padding: 8px 12px;
        font-size: 0.9rem;
        border-radius: 4px;
        transition: all 0.3s ease;
        flex: 1;
        text-align: center;
    }

    .mobile-nav-aids .nav-item-mobile.active {
        color: white;
        background-color: #007bff;
    }

    .mobile-nav-aids .nav-item-mobile:hover {
        color: white;
        background-color: #495057;
    }

    /* Main container adjustments - Remove top margin, add bottom padding */
    .a-container.panel-container {
        margin-top: 0;
        /* Remove top margin */
        padding-bottom: 50px;
        /* Add bottom padding instead */
        height: 100vh;
        /* Full height */
        position: relative;
    }

    /* Panel base styles */
    .panel {
        display: none;
        width: 100%;
        height: 100%;
        flex-direction: column;
        position: absolute;
        top: 0;
        left: 0;
    }

    .panel.mobile-active {
        display: flex !important;
    }

    /* Hide desktop-specific elements */
    .panel-toggle {
        display: none !important;
    }

    /* Panel A (Controls) specific styles */
    #panel-a.mobile-active {
        background-color: #1b1b1b;
    }

    #left-header .navbar {
        padding: 10px;
        background-color: #2d3748;
    }

    #left-header .nav-links {
        display: flex;
        gap: 10px;
        justify-content: center;
    }

    .tiny-button {
        padding: 8px 16px;
        background: #4a5568;
        color: white;
        border-radius: 4px;
        text-decoration: none;
        font-size: 0.9rem;
    }

    .tiny-button:hover {
        background: #2d3748;
    }

    /* Discovery section scrolling */
    .discovery {
        flex: 1;
        overflow-y: auto;
        padding: 15px;
    }

    /* Form controls */
    .selector-container {
        margin-bottom: 15px;
    }

    .selector-container label {
        display: block;
        margin-bottom: 5px;
        color: #e2e8f0;
        font-weight: 500;
    }

    .selector-container select,
    .search-input-selector {
        width: 100% !important;
        max-width: 100% !important;
        padding: 10px;
        border: 1px solid #4a5568;
        border-radius: 4px;
        background: #2d3748;
        color: white;
    }

    /* Search results */
    .search-results {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Movie carousel adjustments */
    .movie-carousel {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 10px;
        margin: 15px 0;
    }

    .movie-card {
        background: #2d3748;
        border-radius: 8px;
        padding: 10px;
        text-align: center;
    }

    .movie-link {
        color: #63b3ed;
        text-decoration: none;
        font-size: 0.9rem;
    }

    .movie-link:hover {
        color: #90cdf4;
        text-decoration: underline;
    }

    /* Panel B (Central) specific styles */
    #panel-b.mobile-active {
        background-color: #1a202c;
    }

    #central-header .navbar {
        padding: 10px;
        background-color: #2d3748;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .navbar-title {
        color: white;
        font-weight: bold;
        font-size: 1.1rem;
    }

    .search-form {
        flex: 1;
        margin: 0 10px;
    }

    .search-box {
        display: flex;
        background: #4a5568;
        border-radius: 20px;
        padding: 5px 10px;
    }

    .search-box input {
        flex: 1;
        background: transparent;
        border: none;
        color: white;
        padding: 5px;
    }

    .search-box input::placeholder {
        color: #a0aec0;
    }

    .search-btn {
        background: transparent;
        border: none;
        color: #a0aec0;
        cursor: pointer;
    }

    /* Panel C (Info) specific styles */
    #panel-c.mobile-active {
        background-color: #1a202c;
    }

    #right-header .navbar {
        padding: 10px;
        background-color: #2d3748;
    }

    .navbar-nav {
        display: flex;
        gap: 10px;
        justify-content: center;
    }

    /* Ensure content areas are scrollable */
    .panel-content {
        flex: 1;
        overflow-y: auto;
    }

    #central-cover,
    #right-cover {
        padding: 15px;
        height: 100%;
        overflow-y: auto;
    }
}

/* ===== TABLET STYLES (768px - 1023px) ===== */
@media (min-width: 768px) and (max-width: 1023px) {
    .mobile-nav-aids {
        display: none;
        /* Hide mobile nav on tablet */
    }

    .a-container.panel-container {
        display: grid;
        grid-template-columns: 300px 1fr;
        grid-template-rows: 1fr;
        gap: 10px;
        height: 100vh;
        margin-top: 0;
    }

    /* Show all panels in tablet view */
    .panel {
        display: flex !important;
        position: static !important;
        height: 100% !important;
    }

    #panel-a {
        grid-column: 1;
    }

    #panel-b {
        grid-column: 2;
    }

    #panel-c {
        display: none !important;
        /* Hide right panel on tablet */
    }

    /* Adjust panel A for tablet */
    #panel-a {
        background-color: #1b1b1b;
    }

    .discovery {
        padding: 15px;
        overflow-y: auto;
    }

    /* Adjust central panel for tablet */
    #central-panel {
        height: 100%;
    }
}

/* ===== DESKTOP STYLES (1024px and above) ===== */
@media (min-width: 1024px) {
    .mobile-nav-aids {
        display: none;
        /* Hide mobile nav on desktop */
    }

    .a-container.panel-container {
        display: flex;
        height: 100vh;
        margin-top: 0;
    }

    /* Show all panels in desktop view */
    .panel {
        display: flex !important;
        position: static !important;
        height: 100% !important;
    }
}

/* ===== CONSOLIDATED MOBILE FIX ===== */
@media (max-width: 767px) {

    /* === MOBILE NAVIGATION === */
    .mobile-nav-aids {
        display: flex !important;
    }

    /* === CONTAINER SETUP === */
    .a-container.panel-container {
        margin-top: 0 !important;
        padding-bottom: 50px !important;
        height: calc(100vh - 50px) !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
    }

    /* === PANEL MANAGEMENT === */
    .panel {
        display: none !important;
    }

    #panel-a.mobile-active {
        display: flex !important;
        flex-direction: column !important;
        background-color: #1b1b1b !important;

        /* FULL DIMENSIONS */
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        min-height: calc(100vh - 50px) !important;
        left: 0 !important;
        right: 0 !important;

        /* FLEXBOX SCROLLING */
        flex: 1 !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    /* === CONTENT HIERARCHY === */
    #panel-a .panel-content {
        display: flex !important;
        flex-direction: column !important;
        flex: 1 !important;
        min-height: 0 !important;
        overflow: hidden !important;
        width: 100% !important;
    }

    #panel-a .panel-collapsible-content {
        display: flex !important;
        flex-direction: column !important;
        flex: 1 !important;
        min-height: 0 !important;
        overflow: hidden !important;
        width: 100% !important;
    }

    #panel-a .left-panel {
        display: flex !important;
        flex-direction: column !important;
        flex: 1 !important;
        min-height: 0 !important;
        overflow: hidden !important;
        width: 100% !important;
    }

    /* === SCROLLABLE CONTENT AREA === */
    #panel-a .discovery {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        flex: 1 !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        width: 100% !important;
        height: auto !important;
    }

    /* === HEADERS === */
    #left-header,
    #panel-a .panel-header {
        display: block !important;
        flex-shrink: 0 !important;
        width: 100% !important;
    }

    /* === FORM ELEMENTS === */
    #panel-a .selector-container,
    #panel-a .search-group {
        width: 100% !important;
    }

    #panel-a select,
    #panel-a input {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
}

/* ===== SIMPLE HEIGHT FIX - ADD AT VERY END ===== */
@media (max-width: 767px) {
    .a-container.panel-container {
        height: 100vh !important;
    }

    #panel-a.mobile-active {
        min-height: 100vh !important;
    }
}

/* ===== PANEL-B MOBILE FIX ===== */
@media (max-width: 767px) {

    /* Panel-b should take full height like panel-a */
    #panel-b.mobile-active {
        display: flex !important;
        flex-direction: column !important;
        background-color: #1a202c !important;

        /* FULL DIMENSIONS */
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        min-height: calc(100vh - 50px) !important;
        left: 0 !important;
        right: 0 !important;

        /* FLEXBOX SCROLLING */
        flex: 1 !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    /* Central header fixes */
    #central-header .navbar {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 10px !important;
        background-color: #2d3748 !important;
        flex-shrink: 0 !important;
        /* Don't let header shrink */
        width: 100% !important;
    }

    /* Fix navbar layout */
    .navbar-left {
        display: flex !important;
        align-items: center !important;
        flex-shrink: 0 !important;
    }

    .navbar-title {
        color: white !important;
        font-weight: bold !important;
        font-size: 1.1rem !important;
        margin-left: 10px !important;
    }

    /* Fix search form */
    .search-form {
        flex: 1 !important;
        margin: 0 10px !important;
        min-width: 0 !important;
        /* Allow shrinking */
    }

    .search-box {
        display: flex !important;
        background: #4a5568 !important;
        border-radius: 20px !important;
        padding: 5px 10px !important;
        width: 100% !important;
    }

    .search-box input {
        flex: 1 !important;
        background: transparent !important;
        border: none !important;
        color: white !important;
        padding: 5px !important;
        min-width: 0 !important;
        /* Allow input to shrink */
    }

    .search-btn {
        background: transparent !important;
        border: none !important;
        color: #a0aec0 !important;
        cursor: pointer !important;
        flex-shrink: 0 !important;
        padding: 0 5px !important;
    }

    /* Fix navbar right section */
    .navbar-right {
        display: flex !important;
        align-items: center !important;
        flex-shrink: 0 !important;
    }

    /* Central panel content area */
    #central-panel {
        display: flex !important;
        flex-direction: column !important;
        flex: 1 !important;
        min-height: 0 !important;
        overflow: hidden !important;
        width: 100% !important;
    }

    /* Central cover (where content loads) */
    #central-cover {
        flex: 1 !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        padding: 15px !important;
        height: auto !important;
    }
}

/* ===== SIMPLE HEIGHT FIX FOR PANEL-B ===== */
@media (max-width: 767px) {
    #panel-b.mobile-active {
        min-height: 100vh !important;
        height: 100% !important;
    }

    /* Ensure central content area takes full height */
    #central-panel {
        height: 100% !important;
        min-height: 0 !important;
    }

    #central-cover {
        height: 100% !important;
        min-height: 0 !important;
    }
}

/* logo in navbar */
.nav-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    /* Preserves aspect ratio */
    display: block;
    /* Removes bottom space under images */
}