/* ============================================
   MODERN WETMUMMY CSS - 2025
   Mobile-first, Grid-based, Performance-optimized
   ============================================ */

/* ============================================
   1. RESET & BASE STYLES
   ============================================ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    background: #fdcdb2;
    font-size: 16px;
}

body {
    color: #a32c32;
    font-family: 'Trebuchet MS', Arial, sans-serif;
    font-size: clamp(0.875rem, 2vw, 1rem);
    line-height: 1.5;
    position: relative;
    min-height: 100%;
    background: url(../images/bottom-gradient.png) repeat-x 0 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

img {
    max-width: 100%;
    height: auto;
    border: none;
    display: block;
}

a {
    color: #474747;
    text-decoration: underline;
    outline: none;
    cursor: pointer;
    transition: color 0.2s ease;
}

a:hover {
    text-decoration: none;
}

ul,
ol {
    list-style: none;
}

/* ============================================
   2. CONTAINER & LAYOUT
   ============================================ */
.container {
    width: 100%;
    max-width: 1660px;
    margin: 0 auto;
    padding: 0 clamp(0.5rem, 2vw, 1rem);
}

/* ============================================
   3. TOP SITES BAR
   ============================================ */
.top-sites-bar {
    max-height: 32px;
    overflow: hidden;
    background-color: #ffdecb;
    padding: 2px 0;
}

.top-sites-bar .container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 10px;
    text-transform: uppercase;
    color: #323232;
}

.top-sites-bar span {
    font-weight: 400;
    line-height: 14px;
}

.top-sites-bar a {
    color: #68355f;
    padding: 9px 8px 9px 0;
    display: inline-block;
    font-size: 10px;
    line-height: 14px;
}

.top-sites-bar a:hover {
    color: #fff;
}

/* ============================================
   4. HEADER
   ============================================ */
#header {
    position: relative;
    margin-bottom: 10px;
    z-index: 10002; /* Ensure header and autocomplete stay above content */
}

#header .container {
    display: flex;
    align-items: flex-start;
    /* gap: 1.5rem; */
    position: relative;
}

#header::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    background: url(../images/logo-top-bg.png) no-repeat;
    width: 484px;
    height: 166px;
    pointer-events: none;
}

.logo {
    display: block;
    background: url(../images/logo.png) no-repeat center;
    background-size: 258px 96px;
    width: 258px;
    height: 96px;
    text-indent: -9999px;
    margin: 4px 22px 0 0;
    flex-shrink: 0;
}

.header-content {
    flex: 1;
    /* overflow: hidden; */ /* Removed to allow autocomplete dropdown */
}

.site-description {
    overflow: hidden;
    margin: 10px 0;
    color: #a32c32;
    font-size: 11px;
    line-height: 1.2;
}

/* ============================================
   5. NAVIGATION (Desktop first, then Mobile)
   ============================================ */

/* Hamburger Button - Hidden by default */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    width: 44px;
    height: 44px;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    position: absolute;
    right: 1rem;
    top: 1rem;
    z-index: 1000;
}

.hamburger span {
    display: block;
    width: 28px;
    height: 3px;
    background: #a32c32;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Main Navigation */
.main-nav {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.nav-menu {
    display: flex;
    gap: 0;
    margin: 0;
}

.nav-menu li {
    font-size: 14px;
    line-height: 34px;
    text-transform: uppercase;
    font-weight: bold;
    text-align: center;
}

.nav-menu li a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 110px;
    height: 34px;
    color: #fff;
    text-decoration: none;
    text-shadow: 1px 1px #40100d;
    transition: all 0.3s ease;
    background: linear-gradient(to bottom, #b15833 0%, #b55530 50%, #ac2b21 100%);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.nav-menu li a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.nav-menu li a:hover::before {
    left: 100%;
}

.nav-menu li a i {
    font-size: 14px;
}

.nav-menu li a:hover {
    background: linear-gradient(to bottom, #d4673e 0%, #c8522f 50%, #b83528 100%);
    color: #fff;
    text-shadow: 1px 1px #40100d;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.nav-menu li.active a {
    background: linear-gradient(to bottom, #fef0e8 0%, #ffdecb 50%, #ffcdb3 100%);
    color: #812b20;
    text-shadow: 1px 1px rgba(254, 240, 232, 0.8);
    border: 1px solid #dba38f;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-menu li.active a:hover {
    background: linear-gradient(to bottom, #fff5ed 0%, #ffe4d1 50%, #ffd4bc 100%);
    transform: translateY(-2px);
}

/* Search Wrapper */
.search-wrapper {
    position: relative; /* Required for autocomplete dropdown positioning */
    flex: 0 1 auto; /* Don't grow to fill space */
    width: 320px; /* Fixed width */
    min-width: 200px;
    max-width: 400px;
    /* z-index set at bottom of file with !important */
}

.search-wrapper form {
    display: flex;
    background: #fff;
    height: 34px;
    border: 1px solid #dba38f;
    border-radius: 4px;
    /* overflow: hidden; */ /* Removed to allow autocomplete dropdown */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.search-input,
.search-input.ac-input {
    flex: 1;
    border: none !important;
    padding: 0 12px !important;
    font: 14px/34px 'Trebuchet MS';
    outline: none;
    color: #333;
    height: 34px;
    box-sizing: border-box;
}

.search-input::placeholder {
    color: #999;
    opacity: 1;
}

.search-input:focus {
    background: #fffbf8;
}

.search-submit {
    width: 80px;
    height: 34px;
    border: none;
    color: #fff;
    cursor: pointer;
    font: bold 12px/34px 'Trebuchet MS';
    text-transform: uppercase;
    text-shadow: 1px 1px #40100d;
    transition: all 0.2s ease;
    background: linear-gradient(to bottom, #b15833 0%, #ac2b21 100%);
    border-radius: 0 4px 4px 0;
    padding: 0;
}

.search-submit:hover {
    background: linear-gradient(to bottom, #fef0e8 0%, #ffebe0 100%);
    color: #812b20;
    text-shadow: 1px 1px #fef1e9;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ============================================
   6. CONTENT SECTIONS
   ============================================ */
#content {
    /* overflow: hidden; */
    padding-bottom: 10px;
    clear: both;
    position: relative;
}

.content-section {
    margin-bottom: clamp(1.25rem, 3vw, 2rem);
}

/* Section Titles */
.section-title {
    text-align: left;
    margin: 1rem 0 0.5rem;
    overflow: hidden;
}

.section-title img {
    float: left;
    margin: 10px 8px 0 0;
}

.section-title h1,
.section-title h2 {
    font-family: 'Trebuchet MS', sans-serif;
    font-weight: bold;
    font-size: 28px;
    line-height: 34px;
    color: #a32b31;
    margin: 0;
    float: left;
}

/* ============================================
   7. THUMBNAIL GRID - STRICT 320x240 (4:3)
   ============================================ */

/* Lazy Loading States */
.thumb-item img.lazy {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.thumb-item img.loading {
    opacity: 0.5;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.thumb-item img.loaded {
    opacity: 1;
}

.thumb-item img.error {
    opacity: 0.3;
    filter: grayscale(100%);
}

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

.thumbs-grid {
    display: grid;
    gap: clamp(0.5rem, 1vw, 1rem);
    margin: 0;
}

/* Desktop: 4 columns (â‰¥1200px) */
@media (min-width: 1200px) {
    .thumbs-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Laptop: 4 columns (1000px-1199px) */
@media (min-width: 1000px) and (max-width: 1199px) {
    .thumbs-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Tablet: 3 columns (768px-999px) */
@media (min-width: 768px) and (max-width: 999px) {
    .thumbs-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Mobile: 2 columns (480px-767px) */
@media (min-width: 480px) and (max-width: 767px) {
    .thumbs-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Small Mobile: 2 columns (<480px) - NEVER 1 */
@media (max-width: 479px) {
    .thumbs-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.25rem;
    }
}

/* Thumbnail Item */
.thumb-item {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #dfb59d;
    background: #ffdecb;
    padding: 1px;
    border-radius: 0 0 10px 10px;
    transition: all 0.15s ease;
}

.thumb-item:hover {
    background: #ffebe0;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.thumb-item a {
    display: block;
    overflow: hidden;
    text-decoration: none;
    position: relative;
}

.thumb-item img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}

.thumb-title {
    display: block;
    color: #a32c32;
    font-size: clamp(0.75rem, 2vw, 1.125rem);
    font-weight: bold;
    line-height: 1.3;
    padding: 0.25rem 0.5rem;
    margin: 0.25rem 0 0;
    text-align: center;
    min-height: 2.5em;
    transition: color 0.2s ease;
}

.thumb-item:hover .thumb-title {
    color: #000;
}

/* Category thumbnails - slightly smaller */
.thumbs-category .thumb-item img {
    aspect-ratio: 4 / 3;
}

/* Small thumbnails (Top Rated Sites) */
.thumbs-small .thumb-item {
    max-width: 240px;
}

.thumbs-small .thumb-item img {
    aspect-ratio: 4 / 3;
}

/* Video Thumbnail Info (for videos.php) */
.thumb-item {
    position: relative;
}

.thumb-item a {
    position: relative;
    display: block;
}

/* Duration overlay (bal alsÃ³ sarok a thumbnail-Ã¶n) */
.thumb-duration {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgb(0 0 0 / 60%);
    color: #fff;
    padding: 4px 8px;
    font-size: 13px;
    font-weight: bold;
    border-radius: 3px;
    z-index: 10;
    pointer-events: none;
    line-height: 1;
}

/* Title container */
.thumb-info {
    margin-top: 0.5rem;
    padding: 0;
}

/* Title (bal oldali, nem kÃ¶zÃ©pen) */
.thumb-title {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #000;
    line-height: 1.3;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin: 0;
}

.thumb-item:hover .thumb-title {
    color: #a32c32;
}

/* Mobile adjustments */
@media (max-width: 767px) {
    .thumb-duration {
        font-size: 11px;
        padding: 3px 6px;
        bottom: 6px;
        left: 6px;
    }

    .thumb-title {
        font-size: 13px;
    }
}

/* Pagination */
.pagination {
    margin: 2rem 0;
    text-align: center;
}

.pagination ul {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
    justify-content: center;
}

.pagination li {
    display: inline-block;
}

.pagination a {
    display: block;
    padding: 0.5rem 0.75rem;
    min-width: 40px;
    text-align: center;
    background: linear-gradient(to bottom, #b15833 0%, #b55530 50%, #ac2b21 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    font-weight: bold;
    font-size: 14px;
}

.pagination a:hover {
    background: linear-gradient(to bottom, #d4673e 0%, #c8522f 50%, #b83528 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.pagination li.active a {
    background: linear-gradient(to bottom, #fef0e8 0%, #ffdecb 50%, #ffcdb3 100%);
    color: #812b20;
    text-shadow: 1px 1px rgba(254, 240, 232, 0.8);
    border: 1px solid #dba38f;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: default;
}

.pagination li.p-next a {
    padding: 0.5rem 1rem;
}

/* Mobile pagination */
@media (max-width: 767px) {
    .pagination a {
        padding: 0.4rem 0.6rem;
        min-width: 35px;
        font-size: 13px;
    }

    .pagination li.p-next a {
        padding: 0.4rem 0.8rem;
    }
}

/* ============================================
   8. TAGS / RECENT SEARCHES
   ============================================ */
.tags-cloud {
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
    background: transparent;
    border-radius: 8px;
    text-align: center;
}

.tags-cloud .tag {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    margin: 0.25rem;
    background: linear-gradient(135deg, #a32b31, #d43f47);
    color: #fff;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.875rem;
    text-transform: capitalize;
    border: 1px solid transparent;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.tags-cloud .tag:hover {
    background: linear-gradient(135deg, #d43f47, #a32b31);
    border-color: #d43f47;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* ============================================
   9. CATEGORY LIST (Full List)
   ============================================ */
.category-list {
    display: table;
    width: 100%;
    table-layout: fixed;
    background: #ffdecb;
    text-transform: capitalize;
    border: 1px solid #ffece1;
    padding: 10px 0 5px 0;
    margin-bottom: 20px;
    border-radius: 5px;
}

.category-list ul {
    display: table-cell;
    vertical-align: top;
    padding-left: 40px;
}

.category-list li {
    overflow: hidden;
    margin-bottom: 1px;
    font: bold 16px/20px "Trebuchet MS", Helvetica, sans-serif;
    transition: all 100ms linear;
}

.category-list a {
    display: block;
    color: #a32c32;
    text-decoration: none;
    float: left;
    padding: 2px 10px;
    border: 1px solid transparent;
}

.category-list a:hover {
    border-radius: 4px;
    color: #fff;
    border: 1px solid #983e2d;
    background: rgb(177,88,51);
    background: linear-gradient(to bottom, rgba(177,88,51,1) 0%, rgba(177,85,48,1) 4%, rgba(182,90,50,1) 9%, rgba(192,100,56,1) 13%, rgba(207,117,67,1) 17%, rgba(226,138,81,1) 22%, rgba(241,156,93,1) 26%, rgba(243,161,97,1) 30%, rgba(236,155,94,1) 35%, rgba(222,140,86,1) 39%, rgba(139,53,37,1) 61%, rgba(126,39,30,1) 65%, rgba(116,29,24,1) 70%, rgba(114,27,23,1) 78%, rgba(126,30,25,1) 87%, rgba(138,33,28,1) 91%, rgba(172,43,33,1) 100%);
}

/* ============================================
   10. MOBILE BANNER
   ============================================ */
.mobile-banner {
    display: none;
    /* margin: 1rem auto; */
    text-align: center;
    /* padding: 0.5rem; */
}

.mobile-banner img {
    max-width: 100%;
    width: 300px;
    height: auto;
    display: inline-block;
}

/* ============================================
   11. CONTENT AD
   ============================================ */
.content-ad {
    margin: 2rem auto;
    text-align: center;
}

/* ============================================
   12. FOOTER
   ============================================ */
#footer {
    overflow: hidden;
    background: url(../images/bottom-gradient.png) repeat-x 0 100%;
    color: #5c5c5c;
}

#footer .container {
    padding-top: 30px;
    padding-bottom: 10px;
    background: url(../images/logo-bottom-bg.png) no-repeat;
    display: flex;
    align-items: flex-start;
    gap: 3rem;
}

.footer-logo {
    display: block;
    margin: 5px 50px 2px 0;
    width: 258px;
    height: 96px;
    flex-shrink: 0;
}

.footer-logo img {
    display: block;
    width: 258px;
    height: 96px;
}

.footer-content {
    flex: 1;
    overflow: hidden;
    text-align: right;
    font-size: 0.75rem;
    line-height: 1.25;
    color: #535353;
}

.footer-menu {
    float: right;
    overflow: hidden;
    margin: 10px 0;
}

.footer-menu li {
    float: left;
    text-transform: uppercase;
    font-size: 12px;
    line-height: 14px;
    font-weight: bold;
    border-left: 1px solid #a32c32;
    padding: 0 10px;
}

.footer-menu li:first-child {
    border: none;
}

.footer-menu li:last-child {
    padding-right: 0;
}

.footer-menu a {
    color: #a32c32;
    text-decoration: none;
}

.footer-menu a:hover {
    color: #000;
}

.footer-content p {
    font-size: 12px;
    line-height: 15px;
    clear: both;
    margin: 0.5rem 0;
}

.footer-badge {
    display: block;
    margin-bottom: 5px;
}

.footer-badge a {
    display: inline-block;
}

/* ============================================
   13. RESPONSIVE BREAKPOINTS
   ============================================ */

/* Hamburger Menu Activation at 1100px */
@media (max-width: 1100px) {
    .hamburger {
        display: flex;
    }

    .main-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: min(80vw, 320px);
        height: 100vh;
        background: #ffdecb;
        flex-direction: column;
        align-items: stretch;
        padding: 4rem 1rem 1rem;
        box-shadow: -4px 0 12px rgba(0, 0, 0, 0.2);
        transition: right 0.3s ease;
        z-index: 999;
        overflow-y: auto;
    }

    .main-nav.active {
        right: 0;
    }

    .nav-menu {
        flex-direction: column;
        gap: 0.5rem;
    }

    .nav-menu li a {
        width: 100%;
        justify-content: flex-start;
        padding-left: 1rem;
        border-radius: 6px;
        margin-bottom: 0.5rem;
    }

    .nav-menu li.active a {
        background: linear-gradient(to right, #fef0e8 0%, #ffdecb 100%);
    }

    .nav-menu li a:hover {
        background: linear-gradient(to right, #d4673e 0%, #b83528 100%);
    }

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

/* Tablet (768px-999px) */
@media (min-width: 768px) and (max-width: 999px) {
    .container {
        max-width: 100%;
    }

    .site-description {
        display: none;
    }

    .section-title h1,
    .section-title h2 {
        font-size: 20px;
        line-height: 22px;
    }

    .section-title img {
        margin: 4px 8px 0 0;
    }

    .category-list ul {
        padding-left: 20px;
    }

    .category-list li {
        font: 14px/18px "Trebuchet MS", Helvetica, sans-serif;
    }
}

/* Mobile (480px-767px) */
@media (min-width: 480px) and (max-width: 767px) {
    #header {
        overflow: hidden;
    }

    #header .container {
        flex-direction: column;
        align-items: center;
    }

    #header::before {
        width: 100%;
        background-position: 50% 0;
    }

    .logo {
        float: none;
        display: block;
        margin: 5px auto 0;
    }

    .site-description {
        display: none;
    }

    .mobile-banner {
        display: block;
    }

    .category-list ul {
        padding-left: 20px;
    }

    .category-list li {
        font: 14px/18px "Trebuchet MS", Helvetica, sans-serif;
    }

    #footer .container {
        flex-direction: column;
        align-items: center;
        background-position: 50% 0;
    }

    .footer-logo {
        float: none;
        display: block;
        margin: 0 auto;
    }

    .footer-content {
        text-align: center;
    }

    .footer-menu {
        float: none;
    }

    .footer-menu li {
        float: none;
        display: inline-block;
        padding: 0 2px 0 5px;
    }
}

/* Small Mobile (<480px) */
@media (max-width: 479px) {
    #header {
        overflow: hidden;
    }

    #header .container {
        flex-direction: column;
        align-items: center;
    }

    #header::before {
        width: 100%;
        background-position: 50% 0;
    }

    .logo {
        float: none;
        display: block;
        margin: 5px auto 0;
    }

    .site-description {
        display: none;
    }

    .mobile-banner {
        display: block;
    }

    .mobile-banner img {
        width: 100%;
    }

    .category-list {
        display: table;
        width: 100%;
    }

    .category-list ul {
        padding-left: 15px;
    }

    .category-list li {
        font: 12px/16px "Trebuchet MS", Helvetica, sans-serif;
    }

    .section-title h1,
    .section-title h2 {
        font-size: 20px;
        line-height: 22px;
    }

    .section-title img {
        margin: 4px 8px 0 0;
    }

    .tags-cloud .tag {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }

    #footer {
        text-align: center;
    }

    #footer .container {
        background-position: 50% 0;
        flex-direction: column;
        align-items: center;
    }

    .footer-logo {
        float: none;
        display: block;
        margin: 0 auto;
    }

    .footer-content {
        text-align: center;
    }

    .footer-menu {
        float: none;
        text-align: center;
    }

    .footer-menu li {
        float: none;
        display: inline-block;
        border: none;
        padding: 0 2px 0 5px;
    }
}

/* ============================================
   13. SCROLL TO TOP BUTTON
   ============================================ */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #b15833 0%, #ac2b21 100%);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    z-index: 999;
    text-decoration: none;
}

.scroll-to-top i {
    font-size: 20px;
    transition: transform 0.3s ease;
}

.scroll-to-top.show {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    background: linear-gradient(135deg, #d4673e 0%, #b83528 100%);
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.scroll-to-top:hover i {
    transform: translateY(-3px);
}

.scroll-to-top:active {
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

/* Pulse animÃ¡ciÃ³ */
@keyframes pulse {
    0% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(177, 88, 51, 0.7);
    }
    70% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 0 10px rgba(177, 88, 51, 0);
    }
    100% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(177, 88, 51, 0);
    }
}

.scroll-to-top.show {
    animation: pulse 2s infinite;
}

/* Mobile adjustments */
@media (max-width: 767px) {
    .scroll-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }

    .scroll-to-top i {
        font-size: 18px;
    }
}

/* ============================================
   14. PERFORMANCE OPTIMIZATIONS
   ============================================ */

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Lazy loading optimization */
img[loading="lazy"] {
    content-visibility: auto;
}

/* Will-change for smooth animations */
.thumb-item:hover {
    will-change: transform;
}

.hamburger span {
    will-change: transform, opacity;
}

/* GPU acceleration for animations */
.thumb-item,
.hamburger span,
.main-nav {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* ============================================
   15. LEGACY SUPPORT (for old templates)
   ============================================ */

/* Old class compatibility */
.thumbs.t2 li {
    /* Maps to .thumb-item in grid */
}

.thumbs.t3 li {
    /* Maps to .thumbs-small .thumb-item */
}

/* Ensure old markup still works */
.thumbs li {
    display: flex;
    flex-direction: column;
}

/* ===== NATIVE AD RESPONSIVE ===== */
.content-ad {
    grid-column: 1 / -1;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    margin: 5px 0;
}

.content-ad ins {
    display: block;
    width: 100%;
}

/* ===== OUTSTREAM AD RESPONSIVE ===== */
.outstream-ad {
    grid-column: 1 / -1;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    margin: 5px 0;
}

.outstream-ad script {
    display: block;
    width: 100%;
}

/* ===== AUTOCOMPLETE DROPDOWN Z-INDEX FIX ===== */
/* Z-index hierarchy:
   - #header: 10002
   - .search-wrapper: 10003
   - .ac-wrapper: 10004
   - .ac-dropdown: 10005
*/

#header {
    z-index: 10002 !important;
}

.search-wrapper {
    z-index: 10003 !important;
}

.ac-wrapper {
    position: relative !important;
    z-index: 10004 !important;
}

.ac-dropdown {
    z-index: 10005 !important;
    position: absolute !important;
    background: #ffffff !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    border: 1px solid #ddd !important;
}

/* Remove autocomplete CSS overrides for input */
.search-input.ac-input,
.search-input.ac-input:focus {
    border: none !important;
    padding: 0 12px !important;
    height: 34px !important;
    background: transparent !important;
    border-radius: 0 !important;
}

/* ============================================
   END OF MODERN CSS
   ============================================ */
