﻿/* --- 🌐 General Body Styles --- */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #fff;
    color: #000;
}

/* --- 🎨 Animated Gradient Header --- */
header {
    position: relative;
    background: linear-gradient(-45deg, #0b3d91, #4b0082, #1e90ff, #6a5acd);
    background-size: 400% 400%;
    animation: gradientAnimation 15s ease infinite;
    color: white;
    padding-top: 2rem;
    padding-bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1000;
    min-height: 200px;
}

@keyframes gradientAnimation {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.branding {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    max-width: 1200px;
    justify-content: space-between;
}

.site-title {
    font-size: 2.16rem;
    flex-grow: 1;
}

.logo {
    max-height: 160px;
    width: auto;
    height: auto;
    max-width: 100%;
    border-radius: 12px;
    background-color: white;
    padding: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
    object-fit: contain;
    display: block;
}

.logo:hover {
    transform: scale(1.05);
}

/* --- Responsive Nav & Hamburger --- */
#menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0.5rem;
    align-self: flex-end;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    margin: 1rem 0 0;
    padding: 0;
}

nav ul li button {
    background: none;
    border: none;
    color: white;
    font-size: 1rem;
    cursor: pointer;
}

nav ul li button.active {
    background-color: yellow;
    color: black;
    font-weight: bold;
    text-decoration: underline;
}

@media (max-width: 768px) {
    #menu-toggle {
        display: block;
    }

    nav ul {
        flex-direction: column;
        align-items: center;
        width: 100%;
        margin-top: 0.5rem;
        gap: 0.5rem;
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        transition: max-height 0.4s ease, opacity 0.3s ease;
    }

    nav ul.show {
        max-height: 500px;
        opacity: 1;
    }
}

/* --- Mobile Fixes --- */
@media (max-width: 600px) {
    .branding {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .logo {
        max-width: 80%;
        height: auto;
        margin-bottom: 1rem;
        display: block;
    }
}

/* --- Mode Overrides --- */
.dark-mode header,
.high-contrast header {
    background: linear-gradient(-45deg, #000000, #333333, #1e1e1e, #000000);
    background-size: 400% 400%;
    animation: gradientAnimation 15s ease infinite;
    color: white;
}

.high-contrast .site-title,
.high-contrast nav ul li button {
    color: cyan !important;
}


/* The rest of your CSS remains unchanged below this line */



/* General body styles */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #fff;
    color: #000;
}

/* Header styles */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #0b3d91;
    color: white;
    padding: 1rem;
}

.header-videos {
    display: flex;
    gap: 1rem;
    align-items: center;
    overflow: hidden;
}

.header-video {
    width: 200px;
    height: auto;
    border-radius: 8px;
    max-width: 100%;
}

/* Branding styles */
.logo {
    max-height: 160px;
    width: auto;
    height: auto;
    max-width: 100%;
    border-radius: 12px;
    background-color: white;
    padding: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
    object-fit: contain;
    display: block;
}

    .logo:hover {
        transform: scale(1.05);
    }

.branding {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.site-title {
    font-size: 2.16rem;
}

/* Navigation styles */
nav ul {
    list-style: none;
    display: flex;
    gap: 1rem;
}

    nav ul li {
        display: inline;
    }

        nav ul li button {
            color: white;
            background: none;
            border: none;
            font-size: 1rem;
            cursor: pointer;
        }

/* Main content styles */
main {
    padding: 0 2rem; /* Top/Bottom = 0, Left/Right = 2rem */
    text-align: center;
}


/* Search form styles */
#search-form {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

#search-input {
    width: 300px;
    padding: 0.5rem;
}

/* Results and favourites container */
#results,
#favourites {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem 5%;
    max-width: 1600px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Show card styles */
.show-card {
    border: 1px solid #ccc;
    padding: 1rem;
    width: 200px;
    text-align: left;
    background-color: #f9f9f9;
}

    .show-card img {
        width: 100%;
    }

/* High Contrast Mode Styles */
.high-contrast {
    background-color: #000 !important;
    color: #fff !important;
}

    .high-contrast .site-title {
        color: #0ff !important;
    }

    .high-contrast nav ul li button {
        color: #0ff !important;
    }

    .high-contrast .show-card {
        background-color: #111 !important;
        color: #fff !important;
        border-color: #0ff !important;
    }

    .high-contrast .show-description {
        color: #fff !important;
    }

/* Active navigation button */
nav ul li button.active {
    background-color: yellow;
    color: black;
    font-weight: bold;
    text-decoration: underline;
}

/* Notification for adding to favourites */
.favourites-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #28a745;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 1.2rem;
    z-index: 1000;
}

/* Dark Mode Styles */
.dark-mode {
    background-color: #121212;
    color: #ffffff;
}

    .dark-mode .site-title {
        color: #fff;
    }

    .dark-mode .show-card {
        background-color: #1e1e1e;
        color: #fff;
        border-color: #333;
    }

.loading-spinner {
    font-size: 1.4rem;
    color: #0b3d91;
    margin: 2rem auto;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100px;
    z-index: 999;
}

/* Optional: Add simple animation (if you want) */
@keyframes pulse {
    0% {
        opacity: 0.3;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.3;
    }
}

.loading-spinner {
    animation: pulse 1.5s infinite ease-in-out;
}

/* Style for clickable search history items */
.history-item {
    background-color: #0b3d91;
    color: white;
    padding: 0.5rem 1rem;
    margin: 0.3rem;
    border-radius: 20px;
    display: inline-block;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

    .history-item:hover {
        background-color: #072f6b;
    }

/* Responsive Layout */
@media (max-width: 600px) {
    header, .branding, nav ul {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    nav ul {
        padding-left: 0;
    }


    /* ✅ Removed .logo height override here */

    #search-input {
        width: 100%;
    }

    .header-video {
        width: 80px;
        height: auto;
    }

    /* ✨ Mobile notification tweak: bigger size on small screens */
    .search-notification {
        font-size: 1.3rem;
        padding: 1rem 2rem;
    }
}

/* 404 Page Styles */
.error-page {
    text-align: center;
    padding: 2rem;
}

    .error-page h1 {
        font-size: 2.5rem;
        color: #d9534f;
        margin-bottom: 1rem;
    }

    .error-page p {
        font-size: 1.2rem;
        margin-bottom: 1.5rem;
    }

#search-form-404 {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

    #search-form-404 input {
        padding: 0.5rem;
        font-size: 1rem;
        width: 300px;
        max-width: 90%;
    }

    #search-form-404 button {
        padding: 0.5rem 1rem;
        font-size: 1rem;
        background-color: #0b3d91;
        color: white;
        border: none;
        cursor: pointer;
        border-radius: 5px;
    }

        #search-form-404 button:hover {
            background-color: #072f6b;
        }

/* Responsive tweaks for 404 */
@media (max-width: 600px) {
    .error-page h1 {
        font-size: 2rem;
    }

    .error-page p {
        font-size: 1rem;
    }

    #search-form-404 {
        flex-direction: column;
        align-items: center;
    }

        #search-form-404 input {
            width: 100%;
        }

        #search-form-404 button {
            width: 100%;
        }
}

/* ✨ NEW: Notification container and search notification styles */
#notification-container {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
    align-items: center;
    pointer-events: none;
}

.search-notification {
    background-color: #007bff; /* default blue */
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    font-size: 1.1rem;
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
    transition: opacity 0.5s ease, transform 0.5s ease, filter 0.3s ease; /* ✨ Now includes smooth hover fade */
    pointer-events: auto;
    position: relative;
}

    .search-notification:hover {
        filter: brightness(1.1);
        cursor: pointer;
    }

    /* Specific colours based on type */
    .search-notification.history {
        background-color: #007bff; /* blue for history */
    }

    .search-notification.favourite {
        background-color: #28a745; /* green for favourites */
    }

/* Responsive show-card for extra show details */
@media (max-width: 600px) {
    .show-card {
        width: 100% !important;
        padding: 1rem;
        box-sizing: border-box;
    }

        .show-card img {
            width: 100%;
            height: auto;
        }
}

/* 🎭 Cast List Styles */
.cast-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
    justify-content: center;
}

.cast-member {
    text-align: center;
    max-width: 120px;
}

    .cast-member img {
        width: 100%;
        border-radius: 8px;
        height: auto;
        object-fit: cover;
        box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    }


/* Official link styling */
.official-link {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background-color: #0b3d91;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
}

.cast-member {
    animation: fadeInCast 0.5s ease-in-out both;
}

@keyframes fadeInCast {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


    .official-link:hover {
        background-color: #072f6b;
    }

/* Layout for history cards (flex like favourites) */
#search-history {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem 5%;
    max-width: 1600px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Responsive show cards (for details view and small screens) */
@media (max-width: 600px) {
    .show-card {
        width: 100% !important;
        padding: 1rem;
        box-sizing: border-box;
    }

        .show-card img {
            width: 100%;
            height: auto;
        }

        .show-card p {
            font-size: 1rem;
            word-wrap: break-word;
        }

        .show-card button,
        .show-card a {
            width: 100%;
            box-sizing: border-box;
        }
}

/* Max width for show cards on larger screens (better readability) */
/* Base styles (mobile first) */
.show-card {
    width: 100%;
    max-width: 500px;
    margin: 1rem auto;
    padding: 1rem;
    box-sizing: border-box;
}

/* Full-width on larger screens */
@media (min-width: 900px) {
    .show-card {
        max-width: 100%;
        width: 90%;
        margin: 2rem auto;
        display: flex;
        flex-direction: row;
        gap: 2rem;
        align-items: flex-start;
    }

    .show-card img {
        flex: 0 0 auto;
        width: 210px;
        height: auto;
        border-radius: 8px;
    }

    .show-card > div,
    .show-card p,
    .show-card h2,
    .show-card h3 {
        flex: 1 1 auto;
        max-width: 100%;
    }

    .cast-list {
        justify-content: flex-start;
    }
}

/* Existing styles remain unchanged above this line */

/* 🎠 Carousel Styles */
.slider-container {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    gap: 1rem;
    padding: 1rem 0;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

    .slider-container::-webkit-scrollbar {
        display: none; /* Hide scrollbars */
    }

.popular-show {
    flex: 0 0 auto;
    width: 200px;
    scroll-snap-align: start;
    background-color: #f1f1f1;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    /* ✨ Add fade-in */
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

    .popular-show:hover,
    .popular-show:focus {
        transform: scale(1.05);
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    }

    .popular-show h3 {
        font-size: 1rem;
        margin-top: 0.5rem;
        color: #000;
        transition: text-decoration 0.2s ease;
    }

    .popular-show:hover h3,
    .popular-show:focus h3 {
        text-decoration: underline;
    }

    .popular-show img {
        width: 100%;
        border-radius: 8px;
        height: auto;
        transition: transform 0.3s ease;
    }

    .popular-show:hover img,
    .popular-show:focus img {
        transform: scale(1.02);
    }


/* 🎛️ Carousel Toggle Button */
#carousel-toggle {
    background-color: #0b3d91;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    font-size: 1.2rem;
    border-radius: 5px;
    cursor: pointer;
    margin: 1rem 0;
}

    #carousel-toggle:hover,
    #carousel-toggle:focus {
        background-color: #072f6b;
        outline: 2px dashed #fc0;
        outline-offset: 3px;
    }

/* 🧭 Focus Indicator for All Carousel Controls */
button:focus {
    outline: 2px dashed #fc0;
    outline-offset: 2px;
}

/* 📱 Responsive Slide Layout */
@media (max-width: 600px) {
    .popular-show {
        width: 80%;
        margin: 0 auto;
    }
}

/* 🧘 Reduce Motion Preference */
@media (prefers-reduced-motion: reduce) {
    .slider-container {
        scroll-behavior: auto;
    }

    #carousel-toggle {
        display: none;
    }
}

/* 🍔 Hamburger menu button (top-right on mobile) */
#menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0.5rem;
    align-self: flex-end;
}

/* Hide nav by default on mobile, animate its reveal */
@media (max-width: 768px) {
    nav ul {
        flex-direction: column;
        align-items: center;
        width: 100%;
        margin-top: 0.5rem;
        gap: 0.5rem;
        /* 🔄 Animated toggle */
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        transition: max-height 0.4s ease, opacity 0.3s ease;
    }

        nav ul.show {
            max-height: 500px; /* Enough to show all items */
            opacity: 1;
        }

    #menu-toggle {
        display: block;
    }
}

@media (max-width: 600px) {
    .logo {
        max-width: 80%;
        height: auto;
        margin-bottom: 1rem;
    }

    .branding {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

/* 🌐 Responsive Results Grid */
#results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem 5%;
    max-width: 1600px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* 🧾 Show Card */
.show-card {
    background-color: var(--card-bg, #f9f9f9);
    border: 1px solid #ccc;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: left;
    max-width: 100%;
    transition: transform 0.2s ease;
}

    .show-card:hover {
        transform: scale(1.02);
    }

    .show-card img {
        width: 100%;
        height: auto;
        aspect-ratio: 2 / 3;
        object-fit: cover;
        border-radius: 8px;
        margin-bottom: 1rem;
    }

details {
    background: #f4f4f4;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    margin: 1rem 0;
}

    details summary {
        cursor: pointer;
        font-weight: bold;
        margin-bottom: 0.5rem;
    }

    details ul {
        padding-left: 1.2rem;
        list-style: disc;
    }

#clear-history-btn,
#clear-favourites-btn {
    background-color: #d9534f;
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
    margin: 1rem auto 2rem;
    display: block;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease, transform 0.2s ease;
}

    #clear-history-btn:hover,
    #clear-favourites-btn:hover {
        background-color: #c9302c;
        transform: scale(1.03);
    }

.high-contrast #clear-history-btn,
.high-contrast #clear-favourites-btn {
    background-color: #ff0000;
    color: #fff;
}

.dark-mode #clear-history-btn,
.dark-mode #clear-favourites-btn {
    background-color: #aa2e2e;
    color: #fff;
}

/* 🧭 Breadcrumb Styles */
.breadcrumb {
    background-color: #f5f5f5;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    margin: 1rem auto;
    max-width: 1000px;
    text-align: left;
    border-left: 4px solid #0b3d91;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

    .breadcrumb a {
        color: #0b3d91;
        text-decoration: none;
        font-weight: bold;
    }

    .breadcrumb span {
        font-weight: normal;
        color: #555;
    }

.dark-mode .breadcrumb {
    background-color: #1e1e1e;
    color: white;
    border-left-color: #ffffff;
}

.high-contrast .breadcrumb {
    background-color: black;
    color: cyan;
    border-left-color: cyan;
}

/* 🎥 Header Video Banner */
.header-videos {
    display: flex;
    justify-content: center;
    overflow: hidden;
    max-height: 180px;
    margin-top: -1rem;
}

.header-video {
    width: 100%;
    height: auto;
    object-fit: cover;
    border: none;
    max-height: 200px;
}

@media (max-width: 600px) {
    .header-video {
        max-height: 120px;
    }
}

/* 🖨️ Print Styles */
@media print {
    body {
        background: white !important;
        color: black !important;
    }

    header,
    nav,
    .breadcrumb,
    .header-videos,
    .site-title,
    .logo,
    button,
    .official-link {
        display: none !important;
    }

    .show-card {
        border: none;
        box-shadow: none;
        max-width: 100%;
        margin: 0;
    }

    details[open] summary::after {
        content: " ▼";
    }
}

/* 🖼️ Limit image size in show details */
.show-card img {
    max-width: 100%;
    width: 280px;
    height: auto;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

@media print {
    .show-card img {
        width: 180px !important;
        height: auto !important;
        margin-bottom: 1rem;
        display: block;
        margin-left: auto;
        margin-right: auto;
    }
}

/* 📺 TV Guide Styles */
.guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 2rem;
    text-align: left;
}

.guide-block {
    background: #f4f4f4;
    padding: 1rem;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

    .guide-block h3 {
        margin-top: 0;
        font-size: 1.3rem;
    }

    .guide-block ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .guide-block li {
        margin-bottom: 0.8rem;
        font-size: 1rem;
    }

.tv-grid-container {
    position: relative;
    overflow-x: scroll;
    border-top: 1px solid #ccc;
    padding-top: 1rem;
    margin-top: 1rem;
}

.tv-time-row {
    display: flex;
    position: sticky;
    top: 0;
    background: #f9f9f9;
    z-index: 5;
    border-bottom: 1px solid #ccc;
}

.tv-time-cell {
    width: 100px;
    padding: 0.2rem;
    text-align: center;
    font-weight: bold;
    border-right: 1px solid #ddd;
    flex: 0 0 auto;
}

.tv-channels {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tv-channel-row {
    display: flex;
    align-items: flex-start;
}

.channel-name {
    width: 120px;
    font-weight: bold;
    padding-right: 1rem;
    text-align: right;
    flex-shrink: 0;
}

.channel-programmes {
    position: relative;
    flex: 1;
    height: 80px;
    min-width: 2400px;
    background: #f0f8ff;
    border-left: 1px solid #ccc;
}

.programme-block {
    position: absolute;
    top: 5px;
    height: 70px;
    background-color: #cce5ff;
    border: 1px solid #99c2ff;
    border-radius: 6px;
    padding: 0.4rem;
    font-size: 0.85rem;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: background 0.3s ease;
}

    .programme-block:hover,
    .programme-block:focus {
        background-color: #b3daff;
        outline: 2px dashed #007bff;
        outline-offset: 2px;
    }

/* 🔴 Red current time line */
.now-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: red;
    z-index: 10;
}


/* Dark Mode & High Contrast */
.dark-mode .guide-block {
    background-color: #1e1e1e;
    color: white;
}

.high-contrast .guide-block {
    background-color: black;
    color: cyan;
    border: 1px solid cyan;
}

/* Reduce space below the search section */
#search-section {
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Remove extra margin above the carousel button */
.popular-section {
    margin-top: 0;
    padding-top: 0;
}

/* Optional: reduce margin on hero section */
.hero-section {
    margin-bottom: 1rem;
}

/* Optional: remove default top margin on button */
#carousel-toggle {
    margin-top: 0;
}
/* Remove space from headings */
#search-section h2 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.popular-section h2 {
    margin-top: 0.2rem; /* Tighter spacing from the play/pause button */
    margin-bottom: 0.5rem;
}

}

/* Reduce space below the search form */
#search-form {
    margin-bottom: 0.5rem;
}

/* Tighten carousel button spacing */
#carousel-toggle {
    margin-top: 0;
    margin-bottom: 0.5rem;
}










