/* STYLE OF THE LANDING PAGE */

/* 
CSS selectors
- nothing     for html tags directly; body, div
- .           for classes
- #           for specific id's
*/

/* Reset default spacing and set box-sizing */
/* * is a universal selector, so this applies to everything on the page */
* { 
    margin: 0;               /* Remove default margin for all elements */
    padding: 0;              /* Remove default padding */
    box-sizing: border-box;  /* Include padding and border in element’s total width/height */
}

/* ============================== LANDING PAGE SPECIFIC ============================= */

/* Body contains all visible content */
body.landing-page {
    /* background: url("../images/Gradient background.jpg") no-repeat center center fixed; */
    background-color: #111;
    background-size: cover;  /* make sure it fills the screen */
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Roboto', sans-serif;
    font-weight: 100;
    padding: 0;
}

body.landing-page #logo-placeholder {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1000;
}

/* Styling for container class */
.landing-container {
    text-align: center;
    color: #fff;
    width: 100%;       /* take full horizontal space */
    max-width: 1200px; /* optional, limits very wide screens */
    margin: 0 auto;
    padding: 0 1rem;   /* small padding for mobile */
}

.landing-container h1 {
    font-size: 2rem;         /* Large heading size */
    margin-bottom: 1.5rem;   /* Space below heading */
}

.landing-page-content.hidden {
  display: none;
}

.landing-page-content h1 {
  font-size: 2rem;         /* Large heading size */
  margin-bottom: 1.5rem;   /* Space below heading */
}

/* Search title (heading above search bar) */
#search-title {
    color: white;
    font-size: 3rem;
    margin: 0;
    text-align: center;
    font-family: "Montserrat", sans-serif; /* Apply Montserrat */
    font-weight: 600; /* SemiBold */
}

/* Logo image */
#search-title {
  height: 3.2rem;          /* bigger size */
  width: auto;           /* keep aspect ratio */
}

#search-subtitle {
    color: rgb(214, 214, 214);
    font-size: 1.2rem;       /* increased from 24px */
    margin: 10px 0 40px;     /* more spacing above and below */
    text-align: center;
}

.search-wrapper-landing {
  display: flex;
  justify-content: center; /* centers the whole block */
  align-items: center;     /* vertically aligns input + button */
  gap: 0.5rem;               /* space between search bar and filter button */
}

/* ====== SETTINGS ======= */

/* Action buttons container */
.settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.625rem; /* 10px */
  margin-top: 1.25rem; /* 20px */
  padding-top: 0.75rem; /* 12px */
  border-top: 1px solid #333;
}

/* Buttons */
.apply-btn,
.cancel-btn {
  padding: 0.5em 1em;
  border-radius: 0.5rem;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

/* Apply button – solid grey */
.apply-btn {
  background-color: #444;
  color: #f5f5f5;
}

.apply-btn:hover {
  background-color: #555;
  transform: scale(1.05)
}

/* Cancel button – outlined and transparent */
.cancel-btn {
  background-color: transparent;
  color: #ccc;
  border: 0.0625rem solid #555;
}

.cancel-btn:hover {
  background-color: #2a2a2a;
  transform: scale(1.05);
}

/* Dropdown consistency */
.settings-dropdown {
  padding: 0.4em 0.8em;
  border-radius: 0.375rem;
  border: 0.0625rem solid #444;
  background-color: #1e1e1e;
  color: #eee;
  font-size: 0.9rem;
  cursor: pointer;
}

.settings-dropdown:focus {
  outline: 0.0625rem solid #666;
}

.settings-dropdown:hover {
  border-color: #555;
  background-color: #222;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  gap: 3rem;
}

.settings-label {
  font-weight: 300;
  font-size: 1.1rem;
  color: #ccc;
}


/* =================================== RESULTS PAGE SPECIFIC ================================== */
body.results-page {
    background-color: #000;
    font-family: 'Roboto', sans-serif;
    font-weight: 100;
    margin: 0;
    padding: 0;
    /* no flex centering here */
}

body.results-page #logo-placeholder {
    position: relative; /* participates in flex row of top bar */
}

/* Container for all videos */
#results {
    display: flex;           /* Use Flexbox to arrange video cards */
    flex-wrap: wrap;         /* Wrap cards to next line if necessary */
    justify-content: center; /* Center all video cards horizontally, NOTE: Might want to show videos vertically, same as YT */
    row-gap: 40px;    /* vertical spacing */
    column-gap: 20px; /* horizontal spacing */
    margin-top: 20px;        /* Space above the container */
}
  
/* Individual video card */
.video-item {
    background-color: #000;  /* Dark card background */
    color: #fff;             /* White text inside card */
    width: 300px;            /* Fixed width for consistency, NOTE: again might need relative for different types of screens */
    border-radius: 8px;      /* Rounded corners for card */
    overflow: hidden;        /* Prevent content from spilling out */
    box-shadow: 0 2px 6px rgba(0,0,0,0.5); /* Slight shadow for depth */
    transition: transform 0.2s; /* Smooth scale effect on hover */
}
  
.video-item:hover { /* : indicates pseudo-class or special state */
    transform: scale(1.03);  /* Slight zoom effect on hovering over the video with mouse */
}
  
.video-item img {
    width: 100%;             /* Make thumbnail fill card width */
    display: block;          /* Remove default inline spacing */
}
  
.video-item h3 {
    font-size: 0.9rem;
    margin: 10px;
    font-weight: 600;                /* optional: bold title */
    font-family: 'Montserrat', sans-serif;

    display: -webkit-box;            /* Required for title length limit */
    -webkit-box-orient: vertical;    /* Vertical orientation */
    -webkit-line-clamp: 2;           /* Limit to 2 lines */
    overflow: hidden;                /* Hide overflow text */
    text-overflow: ellipsis;         /* Add ... at the end */
    line-height: 0.85rem;              /* Adjust line height as needed */
}
  
.video-item p { /* NOTE: rename? <p> means paragraph */
    font-size: 0.85rem;
    margin: 0 10px 4px 10px;
    color: #ccc;
    font-family: 'Roboto', sans-serif; /* lighter font for channel name or description */
}
  
.video-item a { /* NOTE: rename? <a> means anchor/link, and does the link even show? */
    text-decoration: none;   /* Remove underline from links */
    color: inherit;          /* Keep same color as parent */
}

 /* Container for the all of results page */
.results-container {
    display: flex;
    flex-direction: column;  /* Stack title, loading, and videos vertically */
    align-items: center;     /* Center horizontally */
    width: 100%;             /* Full width of page */
    padding: 20px;           /* Space inside container */
}

.search-wrapper-results {
  flex: 1;                  /* take remaining space */
  margin-left: 6rem;        /* space from logo */
  display: flex;            /* keep input + button in row */
  gap: 0.5rem;              /* spacing between input & filter button */
}

.top-bar-results {
  display: flex;
  align-items: center;      /* vertical centering */
  justify-content: space-between; /* logo left, search bar takes rest */
  padding: 0.5rem 1rem;
}

#loadMoreButton {
  background: transparent;
  color: white;
  font-family: 'Roboto', sans-serif;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 0.4rem;
  cursor: pointer;
  margin-top: 1.5rem;
  transition: all 0.2s ease;
}

#loadMoreButton:hover {
  transform: scale(1.1);
}

#loadMoreButton.disabled {
  cursor: not-allowed;    /* shows the ‘forbidden’ cursor */
  pointer-events: none;   /* prevents clicks */
}

/* ================================ COMBINED STYLING ================================== */
/* Container holding input + magnifying icon */
.search-container {
  position: relative;   /* allows absolute positioning of icon */
  width: 60%;
  max-width: 800px;
  display: flex;
}

/* Search bar */
.search {
    width: 100%;              
    max-width: 800px;        /* limits on large screens */
    padding: 1rem 3rem 1rem 1.2rem; /* extra right padding for icon */
    border: 1.5px solid rgba(255, 255, 255, 0.3); /* white light border */;
    border-radius: 3rem;
    font-size: 1.1rem;
    outline: none;
    background-color: #111;
    color: #fff;
    transition: box-shadow 0.3s ease, background-color 0.3s ease; /* smooth hover effect */
}

/* Hover + focus subtle white glow */
.search:hover,
.search:focus {
    background-color: #111;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.4),   /* soft inner glow */
                0 0 12px rgba(255, 255, 255, 0.25), /* mid glow */
                0 0 20px rgba(255, 255, 255, 0.15); /* outer glow */
}


/* Position icon container */
.search-icon {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
}

/* Style button itself */
.search-icon button {
  border: none;
  background: transparent; /* fully transparent */
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Control icon image size */
.search-icon img {
  width: 2.5em;   
  height: 2.5em;
}

.search-icon:hover {
  transform: translateY(-50%) scale(1.1);
}

/* Logo image */
.logo {
  height: 6rem;          /* bigger size */
  width: auto;           /* keep aspect ratio */
  cursor: pointer;       /* indicate clickable */
}

/* Filter button */
.filter-button {
  display: flex;         /* instead of inline-flex */
  align-items: center;
  gap: 8px;
  color: white;
  font-size: 1.2rem;
  font-family: 'Roboto', sans-serif;
  font-weight: 100;   /* Thin */
  cursor: pointer;
  width: fit-content;    /* shrink to fit content */
}

.filter-button img.filter-icon {
  width: 2rem;     /* scales with root font size */
  height: auto;    /* keep proportions */
}

.filter-button:hover {
  transform: scale(1.1);                 /* subtle hover effect */
}

/* Filter popup container */
.filter-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: max-content; 
  padding: 2rem;
  max-width: 95vw;        /* never overflow viewport */
  height: auto;     
  max-height: 80vw;
  background-color: #111;
  color: #fff;
  border-radius: 1rem;
  padding: 2rem;
  display: none;    /* hidden by default */
  z-index: 1100;    /* above other elements */
  overflow-y: auto; /* scroll if content exceeds height */
}

.filter-popup.show {
  display: block;   /* shown when toggle is active */
}

/* Close X for popup */
.popup-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
}

/* Overlay for dimmed background during filter popup */
.overlay {
  position: fixed;
  inset: 0; /* shorthand for top/right/bottom/left:0 */
  background-color: rgba(0,0,0,0.5); /* semi-transparent black */
  opacity: 0;
  visibility: hidden;
  z-index: 1050; /* for layering, lower than .filter-popup (1100) */
  transition: opacity .2s ease, visibility .2s;
}

.overlay.show {
  opacity: 1;
  visibility: visible;
}

/* Popup title */
.popup-title-container {
  display: flex;
  align-items: center;   /* vertically center icon and text */
  gap: 0.5rem;           /* space between icon and title */
  justify-content: flex-start; /* align left */
  margin-bottom: 1rem;   /* space below title for filters content */
}
/* Heading style */
.popup-title-container h2 {
  font-size: 1.5rem;     /* relative size */
  font-weight: 400;
  color: #fff;
}
/* Icon style */
.popup-title-container img.popup-icon {
  width: 2rem;         /* relative to root font size */
  height: auto;          /* maintain aspect ratio */
}

/* Filter row */
.filter-row {
  display: flex;
  justify-content: flex-start; /* name left, options right */
  align-items: center;            /* vertically center name and options */
  margin-bottom: 1rem;            /* space between filter rows */
  gap: 2rem;
}
/* Filter name / word style */
.filter-name {
  font-size: 1.2rem;              /* relative size */
  color: #fff;
  font-weight: 300;
  min-width: 14rem;
}
/* Styling between filter options */
.filter-options {
  display: flex;
  gap: 0.5rem;          /* space between options */
  flex-wrap: wrap;       /* wrap if too many options */
}
/* Styling of a single filter option box */
.filter-option {
  background-color: #222;  /* dark background for contrast */
  color: #fff;
  border: none;
  padding: 0.4rem 0.8rem;
  border-radius: 0.4rem;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.2s;
}
/* Styling of a single filter button when disabled */
.filter-option.disabled { /* indicates disabled */
  opacity: 0.5;
  pointer-events: none;
  transition: opacity 0.2s;
  cursor: not-allowed;
}
/* Hover effect */
.filter-option:hover {
  background-color: #444;
}
/* Styling for a single filter button when selected */
.filter-option.selected {
  background-color: #666;  /* indicates active selection */
}

/* Filter tip */
.filter-tip {
  font-size: 1.2rem;        /* relative, matches other popup text */
  color: #fff;            /* white to match popup */
  line-height: 1.2;       /* improves readability if multiple lines */
  white-space: pre-wrap;  /* preserves line breaks if using \n in JS or HTML */
  margin-top: 1.5rem;
  text-align: center;
}

/* Settings button in top-right */
.settings-button {
  position: absolute;
  top: 2rem;    /* adjust vertical spacing */
  right: 2rem;  /* adjust horizontal spacing */
  cursor: pointer;
}

.settings-button img {
  width: 2rem;  /* normal icon size */
  height: 2rem;
}

.settings-button:hover {
  transform: scale(1.1);
}