/* Header y search overlay */
.site-header {
    background: rgba(20, 20, 30, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 52px;
    padding: 0 16px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Header más compacto en móviles */
@media (max-width: 768px) {
    .header-container {
        height: 44px;
        padding: 0 12px;
    }
    .site-header {
        background: rgba(20, 20, 30, 0.6);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }
}

.logo-text {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.3px;
    background: linear-gradient(135deg, #ff6b9d 0%, #c44dff 40%, #00E5FF 70%, #00ff88 100%);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

@media (max-width: 480px) {
    .logo-text {
        font-size: 1rem;
    }
}

.search-toggle {
    background: none;
    border: none;
    cursor: pointer;
    margin-left: 0.5rem;
    color: #fff;
    opacity: 0.8;
    transition: opacity 0.2s;
}
.search-toggle:hover {
    opacity: 1;
    color: #00E5FF;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    width: 32px;
    height: 32px;
    position: relative;
    margin-left: 0.5rem;
}
.hamburger,
.hamburger::before,
.hamburger::after {
    content: '';
    display: block;
    width: 20px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.25s ease;
    position: absolute;
    left: 6px;
}
.hamburger {
    top: 15px;
}
.hamburger::before {
    top: -6px;
}
.hamburger::after {
    bottom: -6px;
}
.menu-toggle.active .hamburger {
    background: transparent;
}
.menu-toggle.active .hamburger::before {
    transform: rotate(45deg);
    top: 0;
}
.menu-toggle.active .hamburger::after {
    transform: rotate(-45deg);
    bottom: 0;
}

.main-nav {
    display: flex;
    align-items: center;
}
.primary-menu {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
}
.primary-menu a {
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    color: #fff;
    opacity: 0.8;
    transition: opacity 0.2s;
}
.primary-menu a:hover {
    opacity: 1;
    color: #00E5FF;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    .main-nav {
        position: fixed;
        top: 0;
        right: -260px;
        width: 260px;
        max-width: 80%;
        height: 100vh;
        background: rgba(20, 20, 30, 0.95);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        box-shadow: -2px 0 20px rgba(0,0,0,0.3);
        transition: right 0.3s ease;
        z-index: 1000;
        padding: 70px 1.5rem 2rem;
        overflow-y: auto;
        border-left: 1px solid rgba(255,255,255,0.1);
    }
    .main-nav.active {
        right: 0;
    }
    .primary-menu {
        flex-direction: column;
        gap: 1.2rem;
    }
    .primary-menu a {
        font-size: 1rem;
        display: block;
        padding: 0.4rem 0;
    }
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 999;
    display: none;
}
.menu-overlay.active {
    display: block;
}

.language-switcher {
    position: relative;
    margin-left: 0.75rem;
    cursor: pointer;
}
.lang-current {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 6px;
    background: rgba(255,255,255,0.12);
    border-radius: 30px;
    font-size: 0.75rem;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.08);
}
.lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: rgba(20, 20, 30, 0.98);
    backdrop-filter: blur(15px);
    border-radius: 14px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
    min-width: 130px;
    max-height: 350px;
    overflow-y: auto;
    display: none;
    z-index: 1001;
    border: 1px solid rgba(255,255,255,0.1);
}
.language-switcher:hover .lang-dropdown {
    display: block;
}
.lang-dropdown a {
    display: block;
    padding: 8px 14px;
    text-decoration: none;
    color: #fff;
    font-size: 0.8rem;
    transition: background 0.2s;
}
.lang-dropdown a:hover {
    background: rgba(255,255,255,0.1);
}
.lang-dropdown a.active {
    background: #00E5FF;
    color: #000;
}

@media (max-width: 768px) {
    .language-switcher {
        margin-left: 0.25rem;
    }
    .lang-current .lang-code {
        display: none;
    }
    .lang-current {
        padding: 3px 5px;
    }
}

/* Search Overlay */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    backdrop-filter: blur(12px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}
.search-overlay.active {
    display: flex;
}
.search-overlay-container {
    background: #1a1a2e;
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    border-radius: 24px;
    padding: 1.5rem;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
    color: #fff;
}
.search-overlay-container h2 {
    color: #fff;
    margin-bottom: 1.2rem;
    font-size: 1.4rem;
    font-weight: 600;
}
.close-overlay {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #fff;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.close-overlay:hover {
    opacity: 1;
}
.search-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 1.5rem 0;
}
.search-fields input {
    padding: 0.8rem 1rem;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 40px;
    font-size: 0.95rem;
    flex: 1;
    background: #2a2a3e;
    color: #fff;
}
.search-fields input::placeholder {
    color: #aaa;
}
.search-submit {
    padding: 0.8rem 1.5rem;
    background: #00E5FF;
    color: #000;
    border: none;
    border-radius: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.search-submit:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(0,229,255,0.3);
}

/* Resultados de búsqueda estilo TikTok (solo thumbnails) */
.video-search-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 10px;
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 4px;
}

.video-search-card {
    text-decoration: none;
    color: #fff;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    display: block;
    position: relative;
}
.video-search-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.4);
}

.video-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 16;
    background: #2a2a3e;
    overflow: hidden;
    border-radius: 10px;
}
.video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.video-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 6px;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    display: flex;
    justify-content: flex-start;
}
.video-likes {
    color: #fff;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 3px;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.no-results, .error {
    text-align: center;
    padding: 2rem;
    color: #fff;
    opacity: 0.7;
    font-size: 0.95rem;
}

.search-loading {
    text-align: center;
    padding: 2rem;
    color: #fff;
    opacity: 0.7;
}

/* Scroll personalizado */
.video-search-grid::-webkit-scrollbar {
    width: 4px;
}
.video-search-grid::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.03);
    border-radius: 2px;
}
.video-search-grid::-webkit-scrollbar-thumb {
    background: #00E5FF;
    border-radius: 2px;
}

/* Ajustes responsive */
@media (min-width: 600px) {
    .video-search-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }
}
@media (min-width: 900px) {
    .video-search-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}
@media (max-width: 480px) {
    .search-overlay-container {
        padding: 1rem;
        width: 95%;
    }
    .search-fields input {
        padding: 0.7rem 0.9rem;
        font-size: 0.9rem;
    }
    .search-submit {
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
    }
    .video-search-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}