/* General Body Styles */
body {
    margin: 0;
    padding: 0 0 50px 0;
    font-family: 'Arial', sans-serif;
    background: #ffffff;
    color: #000000;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Title Styling */
h1 {
    font-size: 2.5em;
    margin-top: 50px;
    color: #000000;
    text-align: center;
}

.title-highlight {
    color: #000000;
}

/* Search Bar Container */
.search-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    margin: 40px 0;
    width: 750px;
    max-width: 95%;
    gap: 12px;
}

/* Input Box Styling — flex shrinks to ~70% naturally beside the dropdown+button */
.search-container input[type="text"],
.search-input {
    flex: 0 1 70%;          /* ← 70% of the row, does not grow beyond that */
    min-width: 0;
    padding: 15px 20px;     /* slightly tighter padding to match the smaller feel */
    border: 2px solid #000000;
    font-size: 1em;
    background: transparent;
    color: #000000;
    outline: none;
    border-radius: 50px;
    box-sizing: border-box;
    transition: border-color 0.2s ease, background 0.2s ease;
}

/* ── Progress-bar states injected by JS during data load ── */
.search-container input[type="text"]:disabled {
    cursor: wait;
}

/* *** NEW: Filter Dropdown Styling *** */
.search-filter {
    padding: 14px 18px;
    border: 2px solid #000000;
    border-radius: 50px;            /* matches the oval style of input + button */
    font-size: 0.95em;
    background: #ffffff;
    color: #000000;
    cursor: pointer;
    outline: none;
    appearance: none;               /* remove native OS arrow */
    -webkit-appearance: none;
    /* custom arrow using a dark chevron SVG */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23000' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;            /* space for the custom arrow */
    white-space: nowrap;
    flex-shrink: 0;
    transition: background-color 0.2s ease, transform 0.2s ease;
    box-sizing: border-box;
}

.search-filter:hover {
    background-color: #e8ffe8;
    transform: scale(0.97);
}

.search-filter:focus {
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.18);
}

.search-filter:disabled {
    cursor: wait;
    opacity: 0.55;
    background-color: #f0f0f0;
}

/* Search Button Styling */
.search-container button,
.search-button {
    background: #4CAF50;
    border: 2px solid #000000;
    color: #000000;
    font-size: 1em;
    padding: 15px 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 50px;     /* Fully oval button */
    white-space: nowrap;
    transition: transform 0.2s ease, background-color 0.2s ease;
    flex-shrink: 0;
}

.search-container button:hover,
.search-button:hover {
    background-color: #299601;   /* dark green on hover */
    transform: scale(0.90);
}

.search-container button:disabled {
    cursor: wait;
    opacity: 0.55;
    background-color: #a5d6a7;
}

/* Placeholder Styling */
.search-container input::placeholder {
    color: rgba(0, 0, 0, 0.6);
}

/* Links */
a,
a:visited {
    color: #49a9f7;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    text-decoration: underline;
    color: #0369bd;
}

/* Results Container */
.container,
#results {
    width: 100%;
    max-width: 900px;
    padding: 0 20px;
    margin-top: 30px;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Video Entry */
.video-entry {
    display: flex;
    align-items: center;
    gap: 20px;
    background-color: rgba(37, 211, 24, 0.08);
    border: 1px solid rgba(0, 0, 0, 1.15);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.video-entry img {
    width: 180px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Video Info Content */
.video-info-content {
    flex: 1;
    word-break: break-word;
    overflow-wrap: break-word;
}

.video-info-content h3 {
    margin: 0 0 8px 0;
    font-size: 1.2em;
    color: #000000;
}

.video-info-content p {
    margin: 4px 0;
    font-size: 0.95em;
    line-height: 1.4;
    color: #000000;
}

.video-info-content p strong {
    color: #000000;
}

.initial-message {
    text-align: center;
    font-size: 1.1em;
    color: rgba(0, 0, 0, 0.8);
}

/* Suggestion Box Styles */
.suggestion-container {
    border: 2px solid #4CAF50;
    border-radius: 8px;
    padding: 10px;
    max-width: 800px;
    background-color: #f9f9f9;
    margin-top: 20px;
}

.suggestion-item {
    padding: 8px 12px;
    border-bottom: 1px solid #ddd;
    font-size: 14px;
}

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

.suggestion-item:hover {
    background-color: #e6ffe6;
    cursor: pointer;
}

/* Pagination Controls */

/* Pagination wrapper */
#pagination {
    margin-top: 20px;
    text-align: center;
    font-family: Arial, sans-serif;
}

/* Container for buttons */
.pagination-buttons {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

/* Button styles */
.pagination-btn {
    background-color: #f0f0f0;
    border: 1px solid black;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.pagination-btn:hover:not(:disabled):not(.pagination-btn.active) {
    background-color: #d6f5d6;
    transform: scale(0.90);
}

.pagination-btn:disabled {
    cursor: not-allowed;
    border: 2px solid #000000;
    background-color: lightgrey;
    opacity: 0.5;
}

/* Active (current) page style */
.pagination-btn.active {
    cursor: default;
    background-color: #a5e6a5;
    font-weight: bold;
    border: 2px solid #000000;
    color: #000;
}

/* Page info text */
.page-info {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #333;
}

/* Highlighted Matching Text */
mark {
    background-color: yellow;
    color: black;
    padding: 0 2px;
    border-radius: 3px;
}

/* Responsive Design */
@media (max-width: 768px) {
    h1 {
        font-size: 2em;
        margin-top: 30px;
    }

    .search-container {
        flex-direction: column;
        max-width: 95%;
        margin-bottom: 10px;
        gap: 12px;
    }

    .search-container input[type="text"] {
        flex: none;         /* override the 70% flex rule on mobile */
        width: 100%;
        border-radius: 50px;
        padding: 12px 15px;
        text-align: center;
        box-sizing: border-box;
    }

    /* On mobile the dropdown goes full width too */
    .search-filter {
        width: 100%;
        border-radius: 50px;
        padding: 12px 40px 12px 18px;
        text-align: center;
    }

    .search-container button {
        border-radius: 50px;
        padding: 12px 15px;
        justify-content: center;
        width: 100%;
    }

    .container {
        padding: 0 10px;
    }

    .video-entry {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px;
        gap: 15px;
    }

    .video-entry img {
        width: 100%;
        height: auto;
        max-height: 180px;
    }

    .video-info-content h3 {
        font-size: 1.1em;
    }

    .video-info-content p {
        font-size: 0.9em;
    }
}

/* Duration displayed at the bottom of thumbnail */
.thumbnail-container {
    text-align: center;
}

.video-duration {
    font-size: 0.9em;
    color: #333;
    margin-top: 5px;
}
