html {
    color: var(--main-fg);
    background-color: var(--main-bg);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
}

body {
    margin: 0;
}

input,
button {
    outline: none;
}

button {
    cursor: pointer;
}

p {
    font-size: 18px;
    color: var(--result-fg);
}

a,
.text-result-wrapper a:hover {
    text-decoration: none;
}

a,
.text-result-wrapper a:visited h2,
.special-result-container a,
.did-you-mean a,
.sub-search-button-wrapper a,
.sub-search-button-wrapper a:visited {
    color: #e74c3c;
}

.sub-search-button-wrapper .active {
    border-bottom: 2px #e74c3c solid;
    padding-bottom: 10px;
}

a:hover,
.text-result-wrapper h2:hover {
    text-decoration: underline;
}

.search-container {
    text-align: center;
    margin-top: 10%;
}

.search-container h1 {
    font-size: 70px;
}

.search-container input,
.sub-search-container input {
    width: 500px;
    color: var(--search-container-text-color);
    background-color: var(--search-container-background-color);
    padding: 10px;
    font-size: inherit;
    font-family: sans-serif;
    border: 1px solid var(--search-container-background-border);
    border-radius: 25px;
}

.search-button-wrapper button,
.misc-container button,
.misc-container select {
    color: inherit;
    background-color: var(--button-bg);
    font-size: 14px;
    border: 1px solid var(--main-bg);
    border-radius: 4px;
    padding: 13px 10px 13px 10px;
    cursor: pointer;
}

.search-button-wrapper button {
    margin: 30px 60px 0px 60px;
}

.sub-search-container {
    background-color: var(--search-form-background-color);
    width: 100%;
}

.sub-search-container hr {
    opacity: 0;
}

.sub-search-container input {
    width: 580px;
    position: relative;
    left: 140px;
    margin: 18px;
}

.logomobile {
    position: absolute;
    margin-top: 0px;
    top: 25px;
    left: 20px;
}

.no-decoration {
    text-decoration: none;
    color: var(--main-fg);
}

.no-decoration:hover {
    text-decoration: none;
}

.sub-search-button-wrapper {
    margin-left: 165px;
    margin-bottom: 10px;
}

.search-button-wrapper button:hover,
.misc-container button:hover {
    border: 1px solid #5f6368;
    cursor: pointer;
}

.sub-search-button-wrapper i {
    vertical-align: middle;
    margin-right: 5px;
}

.sub-search-button-wrapper a {
    border: none;
    background-color: inherit;
    font-size: 15px;
    margin-right: 20px;
    cursor: pointer;
    text-decoration: none;
}

.sub-search-button-wrapper img {
    vertical-align: middle;
    margin-right: 5px;
    width: 20px;
}

.misc-container {
    text-align: center;
    word-wrap: break-word;
    width: 460px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 100px;
}

.misc-container div {
    margin-bottom: 30px;
}

.misc-container button {
    margin-right: 10px;
    margin-left: 10px;
}

.misc-container a {
    color: inherit;
    text-decoration: underline;
}

.settings-textbox-container div {
    text-align: left;
    margin-bottom: 25px;
}

.settings-textbox-container input {
    color: inherit;
    background-color: inherit;
    padding: 5px;
    font-size: inherit;
    font-family: inherit;
    border: 1px solid #5f6368;
    border-radius: 5px;
    float: right;
}

.text-result-container,
#time,
.next-page-button-wrapper,
.did-you-mean {
    margin-left: 0;
}

.special-result-container {
    padding: 10px;
    border: 1px solid var(--special-result-border);
    width: 500px;
    border-radius: 8px;
    background: var(--special-text-background);
    color: var(--special-text-color);
    margin-left: 840px;
    margin-top: 0px;
    position: absolute;
}

.text-result-wrapper {
    max-width: 550px;
    word-wrap: break-word;
    margin-bottom: 35px;
}

.text-result-wrapper a {
    font-size: 14px;
    color: var(--result-fg);
}

.video-img {
    height: 115px;
    border-radius: 12px;
}

.text-result-wrapper h2 {
    font-size: 20px;
    color: var(--result-link-fg);
    padding-top: 5px;
    margin-top: 1px;
}

.special-result-container a {
    display: flex;
    margin-top: 10px;
    font-size: 14px;
}

.special-result-container img {
    display: flex;
    max-width: 60%;
    max-height: 200px;
    padding-bottom: 10px;
    margin-left: auto;
    margin-right: auto;
}

.next-page-button-wrapper {
    margin-top: 30px;
    margin-bottom: 60px;
    text-align: center;
    padding: 20px 0;
    display: block;
    visibility: visible;
    position: relative;
    z-index: 100;
    width: 100%;
    clear: both;
}

.next-page-button-wrapper button {
    border: 1px solid var(--border);
    background: var(--button-bg);
    color: var(--main-fg);
    padding: 8px 16px;
    margin: 0 4px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    display: inline-block;
    visibility: visible;
    opacity: 1;
}

.next-page-button-wrapper button:hover {
    background: var(--bg-glass);
    border-color: #e74c3c;
}

.next-page-button-wrapper button.current-page {
    background: #e74c3c;
    color: white;
    border-color: #e74c3c;
}

.next-page-button-wrapper .page {
    display: inline-block;
    margin: 0 2px;
}

.image-result-container {
    display: flex;
    flex-wrap: wrap;
    grid-gap: 1.5rem;
    justify-items: center;
    margin-left: 9%;
    margin-right: 9%;
    padding: 0;
    margin-bottom: 50px;
}

a[title] {
    flex-grow: 1;
    height: 1rem;
}

.image-result-container img {
    margin: 0px;
    height: 100%;
    width: 100%;
    object-fit: cover;
    vertical-align: bottom;
}

.git-container {
    right: 0;
}

.git-container,
.footer-container {
    position: relative;
    bottom: auto;
}

.footer-container {
    background: var(--footer-bg);
    border-top: 1px solid var(--border);
    padding: 8px 20px;
    margin: 2rem 0 0 0;
    position: relative;
    bottom: auto;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-family: Arial, sans-serif;
    max-height: 40px;
    overflow: hidden;
    z-index: 100;
}

.git-container a {
    font-size: 10px;
}

.git-container a,
.footer-container a {
    color: var(--footer-fg);
}

.footer-container a {
    margin-right: 30px;
}

.hide {
    display: none;
}

.Y {
    color: #e74c3c;
}

.seeders {
    color: #50fa7b;
}

.leechers {
    color: #ff79c6;
}

/* donate css start */
.donate-container {
  width: 700px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 100px;
}

.flexbox-column {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.inner-wrap {
  width: 500px;
  padding: 20px;
}

.qr-box {
  background-color: var(--search-container-background-color);
  border: 1px solid var(--search-container-background-border);
  border-radius: 10px 0px 0px 10px;
  width: 100%;
  display: flex;
  word-wrap: break-word;
  align-items: center;
  justify-content: space-between;
}

.flex-row {
  width: 700px;
  height: auto;
  display: flex;
  flex-direction: row;
  justify-content: space-evenly;
}

hr.small-line {
  border: 2px solid var(--main-fg);
  height: 0px;
  width: 100px;
  margin: 30px;
  border-radius: 2px;
}
/* donate css end */

/* Index page styling */
.home-container {
    text-align: center;
    margin-top: 0;
    width: 100%;
    max-width: 600px;
    padding: 20px;
    box-sizing: border-box;
}

.logo {
    font-size: 70px;
    margin: 0 0 30px 0;
    color: var(--main-fg);
}

.accent {
    color: #e74c3c;
}

.search-input-group {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.search-input-group input {
    width: 500px;
    color: var(--search-container-text-color);
    background-color: var(--search-container-background-color);
    padding: 10px;
    font-size: inherit;
    font-family: sans-serif;
    border: 1px solid var(--search-container-background-border);
    border-radius: 25px;
}

.search-input-group button {
    color: white;
    background-color: #e74c3c;
    font-size: 14px;
    border: 1px solid #e74c3c;
    border-radius: 4px;
    padding: 13px 10px 13px 10px;
    cursor: pointer;
}

.search-input-group button:hover {
    background-color: #c0392b;
    border: 1px solid #c0392b;
}

.glass {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
}

.tagline-top-left {
    position: absolute;
    top: 20px;
    left: 20px;
}

.tagline-main {
    margin: 0;
    font-size: 14px;
    color: var(--result-fg);
    opacity: 0.8;
}

.tagline-details-center {
    text-align: center;
    margin: 30px 0;
    font-size: 14px;
    color: var(--result-fg);
    opacity: 0.7;
}

.theme-toggle-container {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    align-items: center;
    height: 40px;
    min-height: 40px;
}

.theme-btn, .reset-btn {
    background: var(--button-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
    height: 40px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
}

.theme-btn:hover, .reset-btn:hover {
    background: #e74c3c;
    border-color: #e74c3c;
    color: white;
}

.language-selector {
    position: relative;
    height: 40px;
    display: flex;
    align-items: center;
}

.current-language {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--button-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    height: 40px;
    box-sizing: border-box;
    min-width: 120px;
}

.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--search-container-background-color);
    border: 1px solid var(--border);
    border-radius: 6px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    min-width: 200px;
    display: none;
}

.language-selector:hover .language-dropdown {
    display: block;
}

.language-option-form {
    margin: 0;
}

.language-option {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: var(--main-fg);
    transition: background 0.2s ease;
}

.language-option:hover {
    background: var(--bg-glass);
}

.image-card {
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    aspect-ratio: 16/9;
}

.image-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

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

.video-card {
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
    text-decoration: none;
    display: flex;
    flex-direction: column;
}

.video-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

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

.video-thumbnail-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.video-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(231, 76, 60, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-triangle {
    width: 0;
    height: 0;
    border-left: 15px solid white;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    margin-left: 3px;
}

.unified-media-container {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.unified-videos-grid,
.unified-images-grid {
    flex: 1;
    display: flex;
    gap: 15px;
}

.unified-video-card {
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    aspect-ratio: 16/9;
    position: relative;
}

.unified-video-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.unified-video-thumbnail-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.unified-video-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.unified-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(231, 76, 60, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.unified-video-actions,
.unified-image-actions {
    position: absolute;
    bottom: 8px;
    right: 8px;
    display: flex;
    gap: 6px;
    z-index: 10;
}

.unified-video-link,
.unified-image-link {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.2s ease;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.unified-video-link.privacy-link,
.unified-image-link.privacy-link {
    background: rgba(231, 76, 60, 0.9);
    color: white;
    text-decoration: none;
}

.unified-video-link.direct-link,
.unified-image-link.direct-link {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    text-decoration: none;
}

.unified-video-link:hover,
.unified-image-link:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    text-decoration: none;
}

.image-results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.video-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.video-info {
    padding: 15px;
    background: var(--bg-glass);
}

.video-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: var(--main-fg);
}

.video-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.video-watch-link {
    flex: 1;
    padding: 8px 12px;
    background: var(--button-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--main-fg);
    text-decoration: none;
    text-align: center;
    font-size: 14px;
    transition: all 0.2s ease;
}

.video-watch-link:hover {
    background: #e74c3c;
    border-color: #e74c3c;
    color: white;
}

.image-actions {
    display: flex;
    gap: 8px;
    padding: 10px;
    background: var(--bg-glass);
}

.image-action-btn {
    flex: 1;
    padding: 8px 12px;
    background: var(--button-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--main-fg);
    text-decoration: none;
    text-align: center;
    font-size: 14px;
    transition: all 0.2s ease;
}

.image-action-btn:hover {
    background: #e74c3c;
    border-color: #e74c3c;
    color: white;
}

.more-links-container {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.more-videos-wrapper,
.more-images-wrapper {
    flex: 1;
}

.more-videos-wrapper {
    text-align: left;
}

.more-images-wrapper {
    text-align: right;
}

.more-link {
    color: #e74c3c;
    text-decoration: none;
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(231, 76, 60, 0.1);
    transition: all 0.2s ease;
}

.more-link:hover {
    background: rgba(231, 76, 60, 0.2);
    text-decoration: none;
}

.text-results-with-wiki {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
}

.text-results-section {
    flex: 2;
}

.wiki-sidebar {
    flex: 1;
    max-width: 350px;
}

.text-result {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

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

.text-result-title {
    margin: 0 0 8px 0;
    font-size:22px;
    font-weight: 500;
}

.text-result-link {
    color: #e74c3c;
    text-decoration: none;
}

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

.text-result-url {
    margin: 4px 0 8px 0;
    font-size: 14px;
        color: #b30000;
}

.text-result-description {
    margin: 0;
    font-size: 14px;
    color: var(--result-fg);
}

.results-info-div {
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--result-fg);
    opacity: 0.8;
}

.videos-unavailable,
.images-unavailable,
.no-text-results {
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    color: var(--result-fg);
}

.videos-unavailable-text,
.images-unavailable-text,
.no-results-title,
.no-results-text {
    margin: 0;
    opacity: 0.7;
}

.search-main-line {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
    height: 40px;
    min-height: 40px;
    width: 100%;
}

/* Preferences section styling */
.preferences {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.details-select {
    position: relative;
    z-index: 1000;
}

.select {
    position: relative;
    display: inline-block;
    min-width: 120px;
}

.select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: var(--main-fg);
    transition: all 0.2s ease;
    list-style: none;
    outline: none;
}

.select-trigger:hover {
    background: rgba(255, 255, 255, 0.2);
}

.select[open] .select-trigger {
    background: rgba(255, 255, 255, 0.25);
    border-color: var(--accent);
}

.select-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: auto;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    max-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    margin-top: 2px;
    min-width: 120px;
    width: auto;
    display: none;
}

.select[open] .select-menu {
    display: block;
}

.select-option {
    display: block;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    color: var(--main-fg);
    transition: background 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.select-option:hover {
    background: var(--bg-glass);
}

.visually-hidden-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.selected-labels span {
    display: none;
}
/* Show correct label based on checked radio */
#engine-any:checked ~ .select-trigger .label-for-engine-any,
#engine-google:checked ~ .select-trigger .label-for-engine-google,
#engine-bing:checked ~ .select-trigger .label-for-engine-bing,
#engine-duckduckgo:checked ~ .select-trigger .label-for-engine-duckduckgo,
#engine-brave:checked ~ .select-trigger .label-for-engine-brave,
#engine-yandex:checked ~ .select-trigger .label-for-engine-yandex {
    display: inline;
}

#lang-any:checked ~ .select-trigger .label-for-lang-any,
#lang-en:checked ~ .select-trigger .label-for-lang-en,
#lang-es:checked ~ .select-trigger .label-for-lang-es,
#lang-fr:checked ~ .select-trigger .label-for-lang-fr,
#lang-de:checked ~ .select-trigger .label-for-lang-de,
#lang-zh:checked ~ .select-trigger .label-for-lang-zh,
#lang-ja:checked ~ .select-trigger .label-for-lang-ja,
#lang-ko:checked ~ .select-trigger .label-for-lang-ko,
#lang-ru:checked ~ .select-trigger .label-for-lang-ru,
#lang-ar:checked ~ .select-trigger .label-for-lang-ar,
#lang-hi:checked ~ .select-trigger .label-for-lang-hi,
#lang-pt:checked ~ .select-trigger .label-for-lang-pt,
#lang-it:checked ~ .select-trigger .label-for-lang-it,
#lang-tr:checked ~ .select-trigger .label-for-lang-tr,
#lang-th:checked ~ .select-trigger .label-for-lang-th,
#lang-pl:checked ~ .select-trigger .label-for-lang-pl,
#lang-nl:checked ~ .select-trigger .label-for-lang-nl,
#lang-id:checked ~ .select-trigger .label-for-lang-id,
#lang-uk:checked ~ .select-trigger .label-for-lang-uk,
#lang-vi:checked ~ .select-trigger .label-for-lang-vi,
#lang-cs:checked ~ .select-trigger .label-for-lang-cs,
#lang-sv:checked ~ .select-trigger .label-for-lang-sv,
#lang-el:checked ~ .select-trigger .label-for-lang-el,
#lang-ro:checked ~ .select-trigger .label-for-lang-ro,
#lang-hu:checked ~ .select-trigger .label-for-lang-hu,
#lang-no:checked ~ .select-trigger .label-for-lang-no,
#lang-he:checked ~ .select-trigger .label-for-lang-he,
#lang-fi:checked ~ .select-trigger .label-for-lang-fi,
#lang-da:checked ~ .select-trigger .label-for-lang-da,
#lang-sk:checked ~ .select-trigger .label-for-lang-sk,
#lang-bg:checked ~ .select-trigger .label-for-lang-bg,
#lang-hr:checked ~ .select-trigger .label-for-lang-hr,
#lang-sl:checked ~ .select-trigger .label-for-lang-sl,
#lang-lt:checked ~ .select-trigger .label-for-lang-lt,
#lang-lv:checked ~ .select-trigger .label-for-lang-lv,
#lang-et:checked ~ .select-trigger .label-for-lang-et,
#lang-mt:checked ~ .select-trigger .label-for-lang-mt,
#lang-is:checked ~ .select-trigger .label-for-lang-is,
#lang-ga:checked ~ .select-trigger .label-for-lang-ga,
#lang-cy:checked ~ .select-trigger .label-for-lang-cy,
#lang-lb:checked ~ .select-trigger .label-for-lang-lb,
#lang-sr:checked ~ .select-trigger .label-for-lang-sr,
#lang-bn:checked ~ .select-trigger .label-for-lang-bn {
    display: inline;
}

/* Index page specific styles */
.index-page .search-container {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 30px;
    max-width: 600px;
    margin: 0 auto;
}

.dysto-main.home-page {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    margin-top: 0;
}
.index-page {
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.index-page .dysto-main.home-page {
    flex: 1;
    height: auto;
    overflow: hidden;
}

.index-page .dysto-footer {
    flex-shrink: 0;
}

/* Footer styling */
.dysto-footer {
    background: var(--footer-bg);
    border-top: 1px solid var(--border);
    padding: 8px 20px;
    margin: 2rem 0 0 0;
    position: relative;
    bottom: auto;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-family: Arial, sans-serif;
    max-height: 40px;
    overflow: hidden;
    z-index: 100;
}

.footer-left {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    min-width: 0;
}

.footer-logos {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.footer-logo-link {
    color: var(--footer-fg);
    text-decoration: none;
    padding: 3px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.footer-logo-link:hover {
    background: var(--bg-glass);
    color: #e74c3c;
}

.footer-text {
    font-size: 12px;
    color: var(--footer-fg);
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.footer-center {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    justify-content: center;
}

.footer-link {
    color: var(--footer-fg);
    text-decoration: none;
    font-size: 12px;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.footer-link:hover {
    color: #e74c3c;
    text-decoration: underline;
}

.footer-separator {
    color: var(--footer-fg);
    opacity: 0.5;
    font-size: 12px;
}

.footer-right {
    text-align: right;
    flex: 0 0 auto;
    min-width: 0;
}

.footer-right .footer-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12px;
}

/* Search Results Page Layout */
.dysto-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bg-glass);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    padding: 15px 0;
}

.header-content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
    gap: 20px;
}

.header-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Search page logo and tagline (absolute positioned) */
.search-page-logo-tagline-absolute {
    position: fixed;
    top: 15px;
    left: 20px;
    z-index: 1001;
}

.search-page-logo {
    font-size: 24px;
    font-weight: bold;
    text-decoration: none;
    color: var(--main-fg);
    display: block;
    margin-bottom: 2px;
}

.search-page-tagline {
    font-size: 11px;
    color: var(--main-fg);
    opacity: 0.7;
    margin: 0;
    white-space: nowrap;
}

/* Main content with top margin for fixed header */
.dysto-main {
    margin-top: 80px;
    padding: 20px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* Search Form in Header */
.search-form {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.search-form .search-input-group {
    flex: 0 1 200px;
    min-width: 150px;
    max-width: 250px;
    margin: 0;
    display: flex;
    align-items: center;
    height: 40px;
}

.search-form .search-input-group input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--search-container-background-color);
    color: var(--search-container-text-color);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
    text-indent: 0;
    height: 24px;
    box-sizing: border-box;
}

.search-form .preferences {
    display: flex;
    gap: 8px;
    align-items: center;
    height: 40px;
    min-height: 40px;
    flex-shrink: 0;
    min-width: 0;
}

.search-form .preferences .details-select {
    height: 40px;
    display: flex;
    align-items: center;
    position: relative;
    z-index: auto;
    flex-shrink: 0;
    min-width: 60px;
}

.search-form .preferences .select-trigger {
    height: 40px;
    padding: 0 12px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    line-height: normal;
}

.search-button-group {
    height: 40px;
    display: flex;
    align-items: center;
}

.search-button-group button {
    color: white;
    background-color: #e74c3c;
    font-size: 14px;
    border: 1px solid #e74c3c;
    border-radius: 4px;
    padding: 0 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    height: 40px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-types {
    display: flex;
    gap: 5px;
    align-items: center;
    height: 40px;
    min-height: 40px;
}

.type-btn {
    padding: 0 8px;
    border: 1px solid var(--border);
    background: var(--button-bg);
    color: var(--main-fg);
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    height: 40px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 45px;
}

/* Fix dropdown selected option display for search results page */
.search-form .selected-labels span {
    display: none;
}

/* Show selected engine labels */
#engine-any:checked ~ summary .label-for-engine-any-results {
    display: inline;
}

#engine-select-results input[id="engine-google-results"]:checked ~ summary .label-for-engine-google-results {
    display: inline;
}

#engine-select-results input[id="engine-bing-results"]:checked ~ summary .label-for-engine-bing-results {
    display: inline;
}

#engine-select-results input[id="engine-brave-results"]:checked ~ summary .label-for-engine-brave-results {
    display: inline;
}

#engine-select-results input[id="engine-duckduckgo-results"]:checked ~ summary .label-for-engine-duckduckgo-results {
    display: inline;
}

/* Show selected language labels */
#lang-select-results input[id="lang-any-results"]:checked ~ summary .label-for-lang-any-results {
    display: inline;
}

#lang-select-results input[id="lang-en-results"]:checked ~ summary .label-for-lang-en-results {
    display: inline;
}

#lang-select-results input[id="lang-fr-results"]:checked ~ summary .label-for-lang-fr-results {
    display: inline;
}

#lang-select-results input[id="lang-es-results"]:checked ~ summary .label-for-lang-es-results {
    display: inline;
}

#lang-select-results input[id="lang-de-results"]:checked ~ summary .label-for-lang-de-results {
    display: inline;
}

.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.image-item {
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
    position: relative;
}

.image-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.image-thumbnail-container {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
}

.image-thumbnail-container .image-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.image-item:hover .image-thumbnail {
    transform: scale(1.05);
}

.image-dimensions {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.image-actions {
    padding: 12px;
    display: flex;
    gap: 8px;
}

.image-open-link {
    flex: 1;
    padding: 8px 12px;
    text-align: center;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.image-open-link.privacy-link {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.3);
    text-decoration: none;
}

.image-open-link.privacy-link:hover {
    background: rgba(231, 76, 60, 0.2);
    border-color: #e74c3c;
    text-decoration: none;
}

.image-open-link.direct-link {
    background: var(--button-bg);
    color: var(--main-fg);
    border: 1px solid var(--border);
    text-decoration: none;
}

.image-open-link.direct-link:hover {
    background: var(--bg-glass);
    border-color: var(--main-fg);
    text-decoration: none;
}

.no-image-results {
    text-align: center;
    padding: 40px 20px;
    margin: 20px 0;
    border-radius: 12px;
}

.no-results-title {
    color: var(--main-fg);
    font-size: 24px;
    margin-bottom: 16px;
}

.no-results-text {
    color: var(--main-fg);
    font-size: 16px;
    margin-bottom: 24px;
    opacity: 0.8;
}

.no-results-suggestions {
    margin: 24px 0;
}

.suggestions-title {
    color: var(--main-fg);
    font-size: 18px;
    margin-bottom: 12px;
}

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

.suggestion-item {
    color: var(--main-fg);
    opacity: 0.7;
    margin: 8px 0;
}

.suggestions-container {
    margin-top: 24px;
}

.back-to-search-link {
    display: inline-block;
    padding: 12px 24px;
    background: var(--button-bg);
    color: var(--main-fg);
    text-decoration: none;
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.back-to-search-link:hover {
    background: var(--bg-glass);
    border-color: var(--main-fg);
    text-decoration: none;
}

/* Video Results Page Styling */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.video-card-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.video-thumbnail-container .video-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.video-card:hover .video-thumbnail {
    transform: scale(1.05);
}

.video-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: rgba(231, 76, 60, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    transition: all 0.2s ease;
}

.video-card:hover .video-play-overlay {
    background: rgba(231, 76, 60, 1);
    transform: translate(-50%, -50%) scale(1.1);
}

.video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

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

.video-title {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
}

.video-title-link {
    color: var(--main-fg);
    text-decoration: none;
    display: block;
}

.video-title-link:hover {
    color: #e74c3c;
    text-decoration: none;
}

.video-metadata {
    margin-bottom: 12px;
    flex: 1;
}

.video-author {
    color: var(--main-fg);
    opacity: 0.7;
    font-size: 14px;
}

.video-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.video-watch-link {
    flex: 1;
    padding: 8px 12px;
    text-align: center;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.video-watch-link.invidious-link {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.3);
    text-decoration: none;
}

.video-watch-link.invidious-link:hover {
    background: rgba(231, 76, 60, 0.2);
    border-color: #e74c3c;
    text-decoration: none;
}

.video-watch-link.youtube-link {
    background: var(--button-bg);
    color: var(--main-fg);
    border: 1px solid var(--border);
    text-decoration: none;
}

.video-watch-link.youtube-link:hover {
    background: var(--bg-glass);
    border-color: var(--main-fg);
    text-decoration: none;
}

.no-video-results {
    text-align: center;
    padding: 40px 20px;
    margin: 20px 0;
    border-radius: 12px;
}

/* Pagination Styling */
.dysto-pagination {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    margin-top: 1.5rem;
    font-size: 0.8rem;
    width: 100%;
    clear: both;
    visibility: visible;
    opacity: 1;
}

.dysto-pagination a {
    padding: 0.4rem 0.6rem;
    text-decoration: none;
    color: var(--result-fg);
    background: var(--button-bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    transition: all 0.2s ease;
    display: inline-block;
    min-width: 2rem;
    text-align: center;
    visibility: visible;
    opacity: 1;
}

.dysto-pagination a:hover {
    color: var(--main-fg);
    background: var(--bg-glass);
    border-color: var(--accent);
}

.dysto-pagination a.current-page {
    color: white;
    background: var(--accent);
    border-color: var(--accent);
    font-weight: 600;
}

.dysto-pagination a.current-page:hover {
    color: white;
    background: var(--accent);
    border-color: var(--accent);
}

/* MOBILE STYLES - DESKTOP LAYOUT SCALED TO FIT MOBILE */
@media only screen and (max-width: 750px) {
    
    /* Prevent horizontal overflow */
    html, body {
        overflow-x: hidden;
        max-width: 100vw;
    }
    
    /* Fix header for mobile - ensure everything fits in screen */
    .dysto-header {
        position: relative;
        padding: 15px;
        background: var(--bg-glass);
        backdrop-filter: blur(15px);
        border-bottom: 1px solid var(--border);
        margin-bottom: 20px;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Header content organized vertically */
    .header-content-wrapper {
        max-width: 100%;
        padding: 0;
        gap: 15px;
        flex-direction: column;
        align-items: stretch;
        display: flex;
    }
    
    /* Top bar with logo and theme controls - FIRST */
    .mobile-header-top {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        width: 100%;
        margin-bottom: 15px;
        order: 1;
    }
    
    /* Logo in normal document flow */
    .search-page-logo-tagline-absolute {
        position: static;
        text-align: left;
        margin: 0;
        flex: 1;
        min-width: 0;
    }
    
    .search-page-logo {
        font-size: 18px;
    }
    
    .search-page-tagline {
        font-size: 9px;
    }
    
    /* Theme toggle in normal flow - on same line as logo */
    .theme-toggle-container {
        position: static;
        top: auto;
        right: auto;
        gap: 4px;
        flex-shrink: 0;
    }
    
    .theme-btn, .reset-btn {
        width: 28px;
        height: 28px;
        min-width: 28px;
        padding: 4px;
        font-size: 12px;
    }
    
    .current-language {
        height: 28px;
        min-width: 70px;
        padding: 4px 8px;
        font-size: 11px;
    }
    
    .header-container {
        width: 100%;
        flex-direction: column;
        gap: 12px;
        display: flex;
        order: 2;
    }
    
    /* Ensure search form is visible and functional - SECOND */
    .search-form {
        width: 100%;
        flex-direction: column;
        gap: 12px;
        display: flex;
    }
    
    /* Search input and button row - constrained width */
    .search-form .search-input-group {
        display: flex;
        gap: 8px;
        width: 100%;
        align-items: center;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .search-form .search-input-group input {
        flex: 1;
        padding: 8px 12px;
        font-size: 14px;
        border-radius: 20px;
        min-width: 120px;
        max-width: calc(100% - 80px);
        box-sizing: border-box;
    }
    
    .search-button-group {
        flex-shrink: 0;
        display: flex;
        align-items: center;
    }
    
    .search-button-group button {
        padding: 8px 12px;
        font-size: 12px;
        white-space: nowrap;
        min-width: 60px;
        max-width: 70px;
    }
    
    /* Engine and language dropdowns - THIRD */
    .search-form .preferences {
        display: flex;
        gap: 8px;
        justify-content: center;
        flex-wrap: wrap;
        width: 100%;
        max-width: 100%;
    }
    
    .search-form .preferences .details-select {
        min-width: 80px;
        max-width: 110px;
        flex: 1;
    }
    
    .search-form .preferences .select-trigger {
        padding: 8px 10px;
        font-size: 12px;
        box-sizing: border-box;
        width: 100%;
    }
    
    /* Search type tabs - FOURTH, ensure they wrap */
    .search-types {
        display: flex;
        gap: 4px;
        justify-content: center;
        flex-wrap: wrap;
        width: 100%;
        max-width: 100%;
    }
    
    .type-btn {
        min-width: 45px;
        max-width: 70px;
        padding: 6px 8px;
        font-size: 11px;
        white-space: nowrap;
        flex: 0 0 auto;
        box-sizing: border-box;
    }
    
    .theme-btn, .reset-btn {
        width: 32px;
        height: 32px;
        min-width: 32px;
        padding: 6px;
        font-size: 12px;
    }
    
    .current-language {
        height: 32px;
        min-width: 80px;
        padding: 6px 8px;
        font-size: 11px;
    }
    
    /* Search form fits within screen width */
    .search-form {
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
        justify-content: center;
    }
    
    .search-form .search-input-group {
        min-width: 200px;
        max-width: 250px;
        flex-shrink: 1;
    }
    
    .search-form .search-input-group input {
        font-size: 14px;
        padding: 8px 12px;
    }
    
    .search-button-group button {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    /* Preferences fit within screen */
    .search-form .preferences {
        gap: 6px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .search-form .preferences .details-select {
        min-width: 90px;
        max-width: 110px;
    }
    
    .search-form .preferences .select-trigger {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    /* Search types wrap but keep same style */
    .search-types {
        gap: 4px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .type-btn {
        min-width: 50px;
        padding: 8px 10px;
        font-size: 11px;
    }
    
    /* Main content fits screen */
    .dysto-main {
        margin-top: 120px;
        padding: 15px;
        max-width: 100%;
    }
    
    /* Home page scales nicely */
    .logo {
        font-size: 48px;
    }
    
    .home-container {
        max-width: 100%;
        padding: 20px 15px;
    }
    
    .search-input-group {
        gap: 8px;
        flex-wrap: wrap;
    }
    
    .search-input-group input {
        min-width: 250px;
        flex: 1;
        max-width: 100%;
    }
    
    .search-input-group button {
        min-width: 100px;
    }
    
    /* Results containers fit screen */
    .special-result-container {
        position: relative;
        margin-left: 0;
        width: 100%;
        max-width: 100%;
    }
    
    .text-result-wrapper {
        max-width: 100%;
    }
    
    /* Grids become single column on very small screens */
    .unified-media-container {
        gap: 15px;
    }
    
    .unified-videos-grid,
    .unified-images-grid {
        gap: 10px;
    }
    
    .video-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .images-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    /* Pagination scales */
    .dysto-pagination {
        gap: 4px;
        font-size: 13px;
        flex-wrap: wrap;
    }
    
    .dysto-pagination a {
        padding: 8px 10px;
        min-width: 30px;
    }
    
    /* Footer stays same style but fits */
    .dysto-footer {
        padding: 15px;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .footer-left,
    .footer-center,
    .footer-right {
        min-width: 0;
        flex: 1 1 100%;
        text-align: center;
    }
    
    /* Ensure all containers fit */
    .misc-container,
    .donate-container {
        width: 95%;
        max-width: 100%;
        padding: 15px;
    }
    
    .flex-row {
        width: 100%;
    }
    
    /* Fix any overflow issues */
    * {
        max-width: 100%;
        box-sizing: border-box;
    }
    
    img {
        max-width: 100%;
        height: auto;
    }
}
