/* styles/main.css */

/* ==========================================================================
   Base Styling and Variables
   ========================================================================== */

/* CSS Variables */
:root {
	/* Main Color Palette */
    --color-black: #111;
    --color-navy: #1a1a44;
    --color-purple: #5a4fcf;
    --color-gold: #c8a34c;
    --color-gray: #d9d9d9;
    --color-dark-gray: #8a8a8a;
    --color-white: #fff;
	--color-error-red: #dc3545;

    /* Transparent Variants */
    --color-navy-bg: rgb(26 26 68 / 10%);
    --color-midnavy-bg: rgb(26 26 68 / 40%);
    --color-purple-bg: rgb(90 79 207 / 10%);
    --color-gold-bg: rgb(200 163 76 / 10%);
    --color-gray-bg: rgb(217 217 217 / 50%);
    --color-white-bg: rgb(255 255 255 / 20%);
}

/* Base Styles */
body {
    background: var(--color-black);
    font-family: Inter, sans-serif;
    margin: 0;
}

.sr-only {
    border: 0;
    clip: rect(0, 0, 0, 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

/* ==========================================================================
   Layout & Theme
   ========================================================================== */

/* Galaxy Background */
html::before {
	background:
		radial-gradient(
			ellipse at center,
			rgb(31 31 77 / 30%) 0%,
			rgb(17 17 17 / 10%) 40%,
			rgb(17 17 17 / 0%) 70%
		),
		radial-gradient(
			ellipse at center,
			rgb(90 79 207 / 25%) 0%,
			rgb(17 17 17 / 0%) 60%
		);
	content: "";
	filter: blur(75px);
	height: 100%;
	left: 0;
	position: fixed;
	top: 0;
	width: 100%;
	z-index: -2;
}

/* Star Underlay */
body::before {
	animation: twinkle 8s ease-in-out infinite alternate;
	background-image:
		radial-gradient(
			1.5px 1.5px at 30% 50%,
			rgb(255 255 255 / 80%) 50%,
			rgb(0 0 0 / 0%) 100%
		),
		radial-gradient(
			1.5px 1.5px at 80% 10%,
			rgb(255 255 255 / 80%) 50%,
			rgb(0 0 0 / 0%) 100%
		),
		radial-gradient(
			2px 2px at 90% 30%,
			rgb(255 255 255 / 70%) 50%,
			rgb(0 0 0 / 0%) 100%
		);
	background-repeat: repeat;
	background-size: 500px 500px;
	content: "";
	height: 100%;
	left: 0;
	opacity: 0.6;
	pointer-events: none;
	position: fixed;
	top: 0;
	width: 100%;
	z-index: -1;
}

/* Main Container */
.container {
	border-radius: 16px;
	margin: 25vh auto 0;
	max-width: 800px;
	padding: 0 5vw;
	transition: all 0.3s ease;
	width: 75vw;
}

/* Results-Active Adjustments */
body.results-active .container {
    justify-content: flex-start;
    margin-top: 20px;
    min-height: auto;
    padding-top: 20px;
}

body.results-active #results-wrapper {
    margin: 20px auto 0;
    max-width: 1200px;
    padding: 0 2vw;
    width: 90vw;
}

/* JavaScript Fallback Warning  */
.no-js-warning {
	background: var(--color-gold);
	color: var(--color-black);
	font-size: 0.9rem;
	left: 0;
	padding: 0.5rem 0;
	position: fixed;
	text-align: center;
	top: 0;
	width: 100%;
	z-index: 1000;
}

/* ==========================================================================
   Core Design Components
   ========================================================================== */

/* --------------------------------------------------------------------------
   Navigation Bar/Header
   -------------------------------------------------------------------------- */

.top-bar {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin: 0 auto;
    padding: 1.5vh 1.5vw;
    position: relative;
}

.top-bar span {
    color: var(--color-white);
    font-size: 0.875rem;
}

/* Link to Homepage */
.top-left {
    justify-self: start;
    transition: filter 0.2s ease;
}

.top-left .link-icon {
    color: var(--color-gray);
    font-size: 0.75rem;
    margin-right: 5px;
    transition: color 0.2s ease;
}

.top-left .site-link {
    color: var(--color-gray);
    text-decoration: none;
    transition: color 0.2s ease;
}

.top-left:hover .site-link,
.top-left:hover .link-icon {
    color: var(--color-white);
}

.top-left:hover {
    filter: drop-shadow(0 0 8px var(--color-purple))
            drop-shadow(0 0 16px var(--color-purple));
}

/* Slogan */
.top-center {
    left: 50%;
    position: absolute;
    transform: translateX(-50%);
    white-space: nowrap;
}

.placeholder-wrapper {
    color: var(--color-black) !important;
    display: inline-block;
    position: relative;
}

.placeholder {
    display: inline-block;
    visibility: hidden;
    width: 5ch;
}

.translation-rotator {
    color: var(--color-gold) !important;
    font-weight: 600;
    left: 0;
    max-height: 100%;
    opacity: 0;
    position: absolute;
    text-align: left;
    text-shadow:
        0 0 16px var(--color-purple),
        0 0 20px var(--color-purple);
    top: 0;
    transition: opacity 0.3s ease-in-out;
}

/* Information Page */
.top-right {
    color: var(--color-gray) !important;
    cursor: pointer;
    justify-self: end;
    transition: color 0.2s ease, filter 0.2s ease;
}

.top-right:hover {
    color: var(--color-white) !important;
    filter: drop-shadow(0 0 8px var(--color-purple))
            drop-shadow(0 0 16px var(--color-purple));
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */

h1 {
    color: var(--color-purple);
    font-size: 28px;
    font-weight: 1000;
    margin-bottom: 24px;
    text-align: center;
}

.hero-title {
    color: var(--color-white);
    font-size: 3rem;
    font-weight: 700;
    text-align: center;
}

/* --------------------------------------------------------------------------
   Search Bar/Options
   -------------------------------------------------------------------------- */

/* Search Bar */
.search-row {
    align-items: center;
    display: flex;
    gap: 12px;
    margin: 12px 0;
}

.search-input-wrapper {
    flex: 1;
    position: relative;
}

.search-input-wrapper input[type="text"] {
    background: var(--color-white-bg);
    border: 1px solid var(--color-navy);
    border-radius: 9999px;
    box-sizing: border-box;
    color: var(--color-white);
    font-size: 0.875rem;
    font-weight: 500;
    height: 48px;
    padding: 14px 38px 14px 42px;
    transition:
        border-color 0.2s,
        box-shadow 0.2s,
        background-color 0.2s;
    width: 100%;
}

.search-input-wrapper input[type="text"]::placeholder {
    color: var(--color-gray);
    opacity: 1;
}

.search-input-wrapper input[type="text"]:focus {
	border: 1.5px solid var(--color-purple);
	box-shadow: 0 0 15px rgb(90 79 207 / 50%);
	outline: none;
}

.search-input-wrapper .search-icon {
    color: var(--color-gray);
    font-size: 1rem;
    left: 16px;
    pointer-events: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.search-input-wrapper button.clear-icon {
    background: none;
    border: none;
    color: var(--color-gray);
    cursor: pointer;
    font-size: 1rem;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
}

.search-btn {
    background: var(--color-purple);
    border: 1px solid var(--color-purple);
    border-radius: 9999px;
    box-shadow: 0 2px 6px rgb(0 0 0 / 10%);
    color: var(--color-white);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    height: 48px;
    padding: 12px 24px;
    transition:
        transform 0.2s,
        box-shadow 0.2s;
}

.search-btn:hover {
    box-shadow: 0 4px 10px rgb(0 0 0 / 15%);
    transform: scale(1.05);
}

.search-error {
	align-items: center;
	backdrop-filter: blur(1px);
	background: rgb(0 0 0 / 20%);
	display: none;
	inset: 0;
	justify-content: center;
	position: absolute;
	z-index: 100;
}

.search-error::before {
	backdrop-filter: blur(1px);
	background: rgb(220 53 69 / 15%);
	border: 1px solid var(--color-error-red);
	border-radius: 8px;
	box-shadow: 0 4px 12px rgb(0 0 0 / 30%);
	color: var(--color-error-red);
	content: attr(data-text);
	font-size: 0.8rem;
	font-weight: 500;
	padding: 12px 20px;
	white-space: nowrap;
}

/* Search Type Buttons */
.search-type {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 16px;
    margin-top: 16px;
}

.search-type button {
    background: var(--color-purple-bg);
    border: 1px solid var(--color-purple);
    border-radius: 9999px;
    box-shadow: 0 2px 6px rgb(0 0 0 / 10%);
    color: var(--color-gold);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 10px 20px;
    transition:
        transform 0.2s,
        background 0.3s;
}

.search-type button:hover {
    transform: scale(1.05);
}

.search-type button.selected {
    background: var(--color-purple);
    color: var(--color-white);
    font-weight: 600;
}

/* Language Filters */
.filter-section {
    background: var(--color-navy-bg);
    border: 1px solid var(--color-purple);
    border-radius: 12px;
    margin: 20px 0;
    overflow: visible;
    padding: 16px;
    position: relative;
}

.filter-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 18px;
    overflow: visible;
}

.filter-label {
    color: var(--color-gray);
    flex-shrink: 0;
    font-size: 16px;
    font-weight: bold;
}

.result-count {
	color: var(--color-purple);
	font-size: 14px;
	font-weight: 500;
	white-space: nowrap;
}

.language-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    overflow: visible;
	padding: 4px;
}

.language-filter {
    background: var(--color-purple-bg);
    border: 1px solid var(--color-purple);
    border-radius: 6px;
    color: var(--color-gold);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    overflow: visible;
    padding: 6px 12px;
    transition:
        transform 0.2s,
        background 0.3s;
    white-space: nowrap;
}

.language-filter:hover {
    overflow: visible;
    transform: scale(1.05);
}

.language-filter.active {
    background: var(--color-purple);
    color: var(--color-white);
    font-weight: 600;
}

.language-filter i {
    margin-right: 4px;
}

.no-results {
	color: var(--color-dark-gray);
	font-style: italic;
	padding: 40px 20px;
	text-align: center;
}

.language-error {
	align-items: center;
	backdrop-filter: blur(1px);
	background: rgb(0 0 0 / 20%);
	display: none;
	inset: 0;
	justify-content: center;
	position: absolute;
	z-index: 100;
}

.language-error::before {
	backdrop-filter: blur(1px);
	background: rgb(220 53 69 / 15%);
	border: 1px solid var(--color-error-red);
	border-radius: 8px;
	box-shadow: 0 4px 12px rgb(0 0 0 / 30%);
	color: var(--color-error-red);
	content: attr(data-text);
	font-size: 0.8rem;
	font-weight: 500;
	padding: 12px 20px;
	white-space: nowrap;
}

/* Mobile Filter Toggle */
.filter-left {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.mobile-filter-toggle {
	align-items: center;
	background: var(--color-purple);
	border: 1px solid var(--color-purple);
	border-radius: 6px;
	color: var(--color-white);
	cursor: pointer;
	display: none;
	font-size: 0.8rem;
	font-weight: 500;
	gap: 6px;
	padding: 6px 12px;
	transition: all 0.3s ease;
}

.mobile-filter-toggle:hover {
	background: var(--color-gold);
	border-color: var(--color-gold);
	transform: scale(1.05);
}

.mobile-filter-toggle i {
	transition: transform 0.3s ease;
}

.language-filters-wrapper {
	overflow: hidden;
	transition: all 0.3s ease;
}

/* --------------------------------------------------------------------------
   Search Results (Web + Video)
   -------------------------------------------------------------------------- */

/* Web Results */
.result-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.result-card {
    align-items: flex-start;
    background: var(--color-navy);
    border: 1px solid rgb(31 31 77 / 60%);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgb(0 0 0 / 10%);
    display: flex;
    gap: 12px;
    overflow: hidden;
    padding: 16px 20px;
}

.result-thumbnail {
    background: var(--color-navy-bg);
    border-radius: 8px;
    flex-shrink: 0;
    height: 120px;
    overflow: hidden;
    width: 120px;
}

.result-thumbnail img {
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.result-content {
    flex: 1;
    position: relative;
}

.result-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
    padding-right: 80px;
}

.result-title {
    color: var(--color-purple);
    font-size: 16px;
    font-weight: bold;
    max-width: 100%;
    overflow: hidden;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-title:hover {
    text-decoration: underline;
}

.result-snippet {
    -webkit-box-orient: vertical;
    color: var(--color-gray);
    display: -webkit-box;
    font-size: 14px;
    -webkit-line-clamp: 3;
    line-height: 1.5;
    margin-top: 8px;
    overflow: hidden;
    overflow-wrap: break-word;
    white-space: normal;
}

.result-url {
    color: var(--color-dark-gray);
    display: block;
    font-size: 12px;
    margin-top: 4px;
    max-width: 100%;
    overflow-wrap: anywhere;
    white-space: normal;
    word-break: break-all;
}

.result-language-tag {
	backdrop-filter: blur(8px);
	background-color: var(--color-gold-bg);
	border: 1px solid var(--color-gold);
	border-radius: 12px;
	box-shadow: 0 2px 4px rgb(0 0 0 / 20%);
	color: var(--color-gold);
	font-size: 11px;
	font-weight: 600;
	padding: 4px 8px;
	position: absolute;
	right: -8px;
	text-transform: uppercase;
	top: -4px;
	z-index: 10;
}

/* Video Results */
.video-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.video-card {
    background: var(--color-navy);
    border: 1px solid rgb(31 31 77 / 60%);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgb(0 0 0 / 10%);
    cursor: pointer;
    display: flex;
    gap: 16px;
    padding: 16px;
    position: relative;
}

.video-thumbnail {
    border-radius: 8px;
    flex-shrink: 0;
    height: 112px;
    overflow: hidden;
    position: relative;
    width: 200px;
}

.video-thumbnail img {
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.duration-badge {
    background: rgb(0 0 0 / 75%);
    border-radius: 2px;
    bottom: 8px;
    color: #fff;
    font-size: 12px;
    padding: 2px 4px;
    position: absolute;
    right: 8px;
}

.video-info {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding-right: 80px;
}

.video-language-tag {
	backdrop-filter: blur(8px);
	background-color: var(--color-gold-bg);
	border: 1px solid var(--color-gold);
	border-radius: 12px;
	box-shadow: 0 2px 4px rgb(0 0 0 / 20%);
	color: var(--color-gold);
	font-size: 11px;
	font-weight: 600;
	padding: 4px 8px;
	position: absolute;
	right: 12px;
	text-transform: uppercase;
	top: 12px;
	z-index: 10;
}

.video-title {
    color: var(--color-purple);
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: 4px;
    max-width: 100%;
    overflow: hidden;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.video-meta {
    color: var(--color-dark-gray);
    font-size: 0.75rem;
}

.video-description {
    -webkit-box-orient: vertical;
    color: var(--color-gray);
    display: -webkit-box;
    font-size: 0.875rem;
    -webkit-line-clamp: 2;
    line-height: 1.4;
    margin-top: 8px;
    overflow: hidden;
}

/* --------------------------------------------------------------------------
   Image Results (Image Grid)
   -------------------------------------------------------------------------- */

.image-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.image-row {
    align-items: flex-start;
    display: flex;
    gap: 10px;
    width: 100%;
}

.image-tile {
    background: var(--color-navy);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgb(0 0 0 / 20%);
    cursor: pointer;
    overflow: hidden;
    position: relative;
}

.image-thumb-wrapper {
    background: var(--color-navy-bg);
    display: grid;
    grid-template-areas: "image-overlay";
    overflow: hidden;
    position: relative;
}

.image-thumb-wrapper img,
.image-language-tag {
    grid-area: image-overlay;
}

.image-thumb-wrapper img {
    display: block;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: opacity 0.3s ease;
    width: 100%;
}

.image-thumb-wrapper img.loading,
.image-thumb-wrapper img.error {
    background: var(--color-navy-bg);
    opacity: 0;
}

.image-thumb-wrapper img:not(.loaded, .error) {
    animation: loading 1.5s linear infinite;
    background: linear-gradient(
        90deg,
        rgb(26 26 68 / 10%) 25%,
        rgb(31 31 77 / 40%) 50%,
        rgb(26 26 68 / 10%) 75%
    );
    background-size: 200% 100%;
    opacity: 0;
}

.image-thumb-wrapper img.loaded {
    opacity: 1;
    transition: opacity 0.4s ease-in;
}

.image-language-tag {
    backdrop-filter: blur(8px);
    background-color: var(--color-gold-bg);
    border: 1px solid var(--color-gold);
    border-radius: 12px;
    box-shadow: 0 2px 4px rgb(0 0 0 / 20%);
    color: var(--color-gold);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    place-self: start end;
    position: relative;
    right: 12px;
    text-transform: uppercase;
    top: 12px;
    z-index: 10;
}

.image-info {
	backdrop-filter: blur(4px);
	background: rgb(0 0 0 / 70%);
	bottom: 0;
	left: 0;
	padding: 8px;
	position: absolute;
	right: 0;
}

.image-website {
	color: var(--color-purple);
	font-size: 0.75rem;
	font-weight: 600;
	margin-bottom: 2px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.image-description {
	-webkit-box-orient: vertical;
	color: var(--color-gray);
	display: -webkit-box;
	font-size: 0.7rem;
	-webkit-line-clamp: 1;
	line-height: 1.2;
	overflow: hidden;
}

/* ==========================================================================
   Animations and Visual Feedback
   ========================================================================== */

/* Main Animation Keyframes */
@keyframes linear-gradient-slow {
    0% {
        background: var(--color-purple);
        box-shadow: 0 0 8px var(--color-purple);
    }

    25% {
        background: var(--color-gold);
        box-shadow: 0 0 8px var(--color-gold);
    }

    50% {
        background: var(--color-purple);
        box-shadow: 0 0 8px var(--color-purple);
    }

    75% {
        background: var(--color-gold);
        box-shadow: 0 0 8px var(--color-gold);
    }

    100% {
        background: var(--color-purple);
        box-shadow: 0 0 8px var(--color-purple);
    }
}

@keyframes twinkle {
    0%,  100% {
        opacity: 0.3;
    }

    50% {
        opacity: 1;
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {
    0%,  100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

@keyframes slide-down {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading Indicators */
.loading-container {
    align-items: center;
    display: flex;
    flex-direction: column;
    opacity: 1;
    padding: 60px 20px;
    text-align: center;
    transition: opacity 0.3s ease-out;
}

.loading-container.fade-out {
    opacity: 0;
}

body.is-loading {
    cursor: wait;
}

body.is-loading .search-input-wrapper input,
body.is-loading .search-btn,
body.is-loading .search-type button {
    opacity: 0.7;
    pointer-events: none;
}

#results {
    min-height: 100px;
    transition: min-height 0.3s ease;
}

/* Transition to Results */
body.has-error #results {
    animation: shake 0.3s ease;
}

body.results-active #results {
    min-height: 200px;
}

#results > * {
    animation: fade-in 0.3s ease-out;
}

.linear-dots-system {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.linear-dot {
    animation: linear-gradient-slow 3s ease-in-out infinite;
    background: var(--color-purple);
    border-radius: 50%;
    height: 10px;
    width: 10px;
}

.linear-dot:nth-child(1) {
    animation-delay: 0s;
}

.linear-dot:nth-child(2) {
    animation-delay: 0.5s;
}

.linear-dot:nth-child(3) {
    animation-delay: 1s;
}

.loading-text {
    color: var(--color-gray);
    font-size: 0.9rem;
    margin: 0;
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

/* Error Handling */
.error-container {
    align-items: center;
    background: rgb(220 53 69 / 10%);
    border: 1px solid rgb(220 53 69 / 30%);
    border-radius: 12px;
    display: flex;
    gap: 16px;
    margin-top: 24px;
    padding: 24px;
    text-align: left;
}

.error-icon {
    color: var(--color-error-red);
    flex-shrink: 0;
    font-size: 2rem;
}

.error-content {
    flex: 1;
}

.error-title {
    color: var(--color-error-red);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 8px;
}

.error-message {
    color: var(--color-gray);
    font-size: 0.9rem;
    line-height: 1.4;
    margin: 0 0 16px;
}

.retry-button {
    background: var(--color-error-red);
    border: none;
    border-radius: 6px;
    color: var(--color-white);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 8px 16px;
    transition: background 0.2s;
}

.retry-button:hover {
    background: #c82333;
}

.retry-button i {
    margin-right: 6px;
}

.partial-error-banner {
    animation: slide-down 0.3s ease-out;
    background-color: rgb(255 193 7 / 10%);
    border: 1px solid var(--color-gold);
    border-radius: 8px;
    margin: 0 0 20px;
    padding: 12px 16px;
}

.partial-error-content {
    align-items: center;
    color: var(--color-gold);
    display: flex;
    font-size: 14px;
    gap: 12px;
}

.partial-error-content i {
	flex-shrink: 0;
}

.dismiss-banner {
    background: none;
    border: none;
    border-radius: 4px;
    color: var(--color-gold);
    cursor: pointer;
    margin-left: auto;
    padding: 4px 8px;
    transition: background-color 0.2s;
}

.dismiss-banner:hover {
    background-color: rgb(255 193 7 / 20%);
}

/* ==========================================================================
   Overlays
   ========================================================================== */

/* Information Page */
.info-overlay {
	align-items: center;
	backdrop-filter: blur(0);
	display: flex;
	height: 100%;
	justify-content: center;
	left: 0;
	opacity: 0;
	position: fixed;
	top: 0;
	transition:
		opacity 0.3s ease,
		backdrop-filter 0.3s ease;
	visibility: hidden;
	width: 100%;
	z-index: 1000;
}

.info-overlay.active {
	backdrop-filter: blur(2px);
	opacity: 1;
	visibility: visible;
}

.info-modal {
	background: var(--color-midnavy-bg);
	border: 1px solid var(--color-purple);
	border-radius: 16px;
	box-shadow:
		0 20px 60px rgb(0 0 0 / 50%),
		0 0 40px rgb(90 79 207 / 30%);
	display: flex;
	flex-direction: column;
	height: 87.5vh;
	overflow: hidden;
	position: relative;
	width: 90vw;
}

.info-modal::before {
	background: var(--color-black);
	content: "";
	height: 100%;
	left: 0;
	position: absolute;
	top: 0;
	width: 100%;
	z-index: -1;
}

/* Information Header */
.info-header {
	align-items: center;
	display: flex;
	flex-shrink: 0;
	justify-content: space-between;
	padding: 24px 30px;
	position: relative;
}

.info-header::after {
	background: rgb(90 79 207 / 30%);
	bottom: 0;
	content: "";
	height: 1px;
	left: 30px;
	position: absolute;
	right: 30px;
}

.info-header-left {
    justify-self: start;
    transition: filter 0.2s ease;
}

.search-counter {
    background: var(--color-gold-bg);
    border: 1px solid var(--color-gold);
    border-radius: 6px;
    color: var(--color-gold);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 10px 16px;
    transition: filter 0.2s ease;
    white-space: nowrap;
}

.info-header-center {
    left: 50%;
    position: absolute;
    transform: translateX(-50%);
    white-space: nowrap;
}

.info-title {
    color: var(--color-gray);
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    text-align: center;
}

.info-header-right {
    justify-self: end;
    overflow: visible;
    transition: filter 0.2s ease;
}

.close-info-btn {
    align-items: center;
    background: none;
    border: none;
    border-radius: 6px;
    color: var(--color-gray);
    cursor: pointer;
    display: flex;
    font-size: 1.2rem;
    font-weight: 700;
    gap: 6px;
    justify-content: center;
    overflow: visible;
    padding: 12px 18px;
    transition:
        color 0.2s ease,
        filter 0.2s ease;
}

.close-info-btn:hover {
    color: var(--color-white);
    filter: drop-shadow(0 0 6px var(--color-gold))
        drop-shadow(0 0 12px var(--color-gold));
}

/* Information Content */
.info-content {
	box-sizing: border-box;
	color: var(--color-gray);
	flex: 1;
	line-height: 1.6;
	margin: 0 auto;
	overflow-y: auto;
	padding: 24px 30px;
}

.info-content h3 {
	color: var(--color-purple);
	font-size: 1.1rem;
	font-weight: 600;
	margin: 0 0 20px;
}

.info-content p {
	font-size: 0.9rem;
	margin: 0 0 20px;
}

.info-emphasis {
	font-weight: 700;
}

.info-link {
	color: var(--color-gold);
	font-weight: 600;
	text-decoration: none;
	transition: color 0.2s ease;
}

.info-link:hover {
	text-decoration: underline;
}

sup {
    font-size: 0.7em;
    font-weight: 500;
}

/* Footnotes Section */
.footnotes-section {
	border-top: 1px solid rgb(90 79 207 / 30%);
	margin-top: 24px;
	padding-top: 24px;
}

.footnotes-section h4 {
	color: var(--color-purple);
	font-size: 1rem;
	font-weight: 600;
	margin: 0 0 20px;
}

.footnote-item {
	display: flex;
	font-size: 0.85rem;
	gap: 8px;
	line-height: 1.6;
}

.footnote-number {
	color: var(--color-purple);
	flex-shrink: 0;
	font-size: 0.85rem;
	font-weight: 600;
	min-width: 20px;
}

.footnote-text {
	color: var(--color-gray);
	flex: 1;
}

.footnote-url {
	color: var(--color-gold);
	text-decoration: none;
	transition: color 0.2s ease;
	word-break: break-all;
}

.footnote-url:hover {
	color: var(--color-white);
	text-decoration: underline;
}

/* ==========================================================================
   Responsive Overrides
   ========================================================================== */

/* Desktop (769px or More) */
@media (width >= 769px) {
    .language-filters {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
}

/* Tablets (Between 481px and 768px) */
@media (width <= 768px) and (width >= 481px) {
    .filter-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .filter-left {
        justify-content: space-between;
        width: 100%;
    }

    .result-count {
        align-self: flex-end;
    }

    .language-filters {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        justify-content: center;
    }
}

/* Mobile (480px or Less) */
@media (width <= 480px) {
    .filter-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .filter-left {
        justify-content: space-between;
        width: 100%;
    }

    .result-count {
        align-self: flex-end;
        font-size: 12px;
    }

    .language-filter[data-lang="all"] {
        grid-column: 1 / -1;
        justify-self: center;
        min-width: 120px;
    }

	.top-left,
    .top-right {
        display: none;
    }
}

/* Narrow Layouts (768px or Less) */
@media (width <= 768px) {
    .search-row {
        flex-direction: column;
        gap: 8px;
    }

    .search-input-wrapper {
        width: 100%;
    }

    .search-btn {
        width: 100%;
    }

    body.results-active .container {
        max-width: none;
        width: 85vw;
    }

    body.results-active #results-wrapper {
        padding: 0 1vw;
        width: 95vw;
    }

    .video-thumbnail {
        height: 200px;
        width: 100%;
    }

    .video-info {
        padding-right: 80px;
    }

    .result-header {
        padding-right: 70px;
    }
}

/* Mobile Branding Adjustments (480px or Less) */
@media (width <= 480px) {
    .search-row {
        flex-direction: column;
        gap: 8px;
    }

    .search-input-wrapper {
        width: 100%;
    }

    .search-btn {
        width: 100%;
    }

    body.results-active .container {
        margin-top: 15px;
        width: 90vw;
    }

    body.results-active #results-wrapper {
        margin-top: 15px;
        padding: 0 1vw;
        width: 98vw;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .top-bar {
        padding: 1vh 3vw;
    }

    .top-center {
        font-size: 0.75rem;
    }
}
