/* ========================================
   40 HYDE PARK - FASE 3: EXCELENCIA ABSOLUTA
   Características Premium Avanzadas
   ======================================== */

/* ========================================
   1. PAGE TRANSITIONS
   ======================================== */
.page-transition-overlay {
    position: fixed;
    inset: 0;
    background: var(--primary);
    z-index: 99999;
    transform: translateY(100%);
    pointer-events: none;
}

.page-transition-overlay.active {
    animation: pageTransition 0.8s var(--ease-in-out) forwards;
}

.page-transition-overlay.exit {
    animation: pageTransitionExit 0.6s var(--ease-in-out) forwards;
}

@keyframes pageTransition {
    0% { transform: translateY(100%); }
    50% { transform: translateY(0); }
    100% { transform: translateY(-100%); }
}

@keyframes pageTransitionExit {
    0% { transform: translateY(0); }
    100% { transform: translateY(-100%); }
}

.page-transition-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-white);
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 800;
    opacity: 0;
    animation: fadeInUp 0.4s var(--ease-out) 0.2s forwards;
}

.page-transition-logo span {
    color: var(--accent);
}

/* ========================================
   2. ADVANCED LIGHTBOX
   ======================================== */
.lightbox-advanced {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.lightbox-advanced.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-advanced .lightbox-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.lightbox-advanced .lightbox-image-wrapper {
    position: relative;
    max-width: 90%;
    max-height: 85vh;
    overflow: hidden;
    cursor: grab;
}

.lightbox-advanced .lightbox-image-wrapper:active {
    cursor: grabbing;
}

.lightbox-advanced .lightbox-image {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    transition: transform 0.3s var(--ease-out);
    transform-origin: center center;
}

.lightbox-advanced .lightbox-image.zoomed {
    cursor: zoom-out;
}

/* Lightbox Controls */
.lightbox-advanced .lightbox-controls {
    position: absolute;
    top: var(--space-6);
    right: var(--space-6);
    display: flex;
    gap: var(--space-3);
    z-index: 10;
}

.lightbox-advanced .lightbox-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-white);
    font-size: 1.125rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.lightbox-advanced .lightbox-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    transform: scale(1.1);
}

.lightbox-advanced .lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-white);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    z-index: 10;
}

.lightbox-advanced .lightbox-nav:hover {
    background: var(--accent);
    border-color: var(--accent);
}

.lightbox-advanced .lightbox-prev { left: var(--space-6); }
.lightbox-advanced .lightbox-next { right: var(--space-6); }

/* Lightbox Thumbnails */
.lightbox-advanced .lightbox-thumbnails {
    position: absolute;
    bottom: var(--space-6);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: var(--space-2);
    padding: var(--space-3);
    background: rgba(0, 0, 0, 0.5);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
    max-width: 80%;
    overflow-x: auto;
    scrollbar-width: none;
}

.lightbox-advanced .lightbox-thumbnails::-webkit-scrollbar {
    display: none;
}

.lightbox-advanced .lightbox-thumb {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s;
    flex-shrink: 0;
}

.lightbox-advanced .lightbox-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lightbox-advanced .lightbox-thumb:hover,
.lightbox-advanced .lightbox-thumb.active {
    border-color: var(--accent);
    transform: scale(1.1);
}

/* Zoom Controls */
.lightbox-advanced .lightbox-zoom-controls {
    position: absolute;
    bottom: var(--space-6);
    right: var(--space-6);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.lightbox-advanced .lightbox-counter {
    position: absolute;
    top: var(--space-6);
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-white);
    font-size: 0.875rem;
    font-weight: 500;
    background: rgba(0, 0, 0, 0.5);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full);
    backdrop-filter: blur(10px);
}

/* ========================================
   3. ADVANCED FILTERS
   ======================================== */
.advanced-filters {
    background: var(--bg-light);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    margin-bottom: var(--space-8);
    box-shadow: var(--shadow-md);
}

.filter-group-advanced {
    margin-bottom: var(--space-5);
}

.filter-group-advanced label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-3);
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.filter-chip {
    padding: var(--space-2) var(--space-4);
    background: var(--bg-white);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-medium);
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
    user-select: none;
}

.filter-chip:hover {
    border-color: var(--accent);
    color: var(--primary);
    transform: translateY(-2px);
}

.filter-chip.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--primary);
    box-shadow: 0 4px 12px rgba(201, 162, 39, 0.3);
}

.filter-chip .count {
    display: inline-block;
    margin-left: var(--space-2);
    padding: 2px 6px;
    background: var(--bg-light);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.filter-chip.active .count {
    background: rgba(255, 255, 255, 0.3);
}

/* Filter Animation */
.filtered-item {
    transition: all 0.4s var(--ease-out);
}

.filtered-item.hidden {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
    position: absolute;
}

.filtered-item.visible {
    animation: filterIn 0.4s var(--ease-out) forwards;
}

@keyframes filterIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Active Filters Display */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border-light);
    margin-top: var(--space-4);
}

.active-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-3);
    background: var(--primary);
    color: var(--text-white);
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 500;
}

.active-filter-tag button {
    background: none;
    border: none;
    color: var(--text-white);
    cursor: pointer;
    padding: 0;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.active-filter-tag button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.clear-all-filters {
    margin-left: auto;
    padding: var(--space-2) var(--space-4);
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s;
}

.clear-all-filters:hover {
    color: var(--accent);
}

/* Results Counter */
.filter-results {
    font-size: 0.9375rem;
    color: var(--text-medium);
    margin-bottom: var(--space-6);
}

.filter-results strong {
    color: var(--primary);
    font-weight: 600;
}

/* ========================================
   4. LIVE SEARCH
   ======================================== */
.live-search-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto var(--space-8);
}

.live-search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.live-search-input {
    width: 100%;
    padding: var(--space-4) var(--space-6) var(--space-4) var(--space-12);
    background: var(--bg-white);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-full);
    font-size: 1rem;
    color: var(--text-dark);
    transition: all 0.3s;
}

.live-search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(201, 162, 39, 0.1);
}

.live-search-icon {
    position: absolute;
    left: var(--space-4);
    color: var(--text-light);
    font-size: 1.125rem;
}

.live-search-clear {
    position: absolute;
    right: var(--space-4);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-light);
    border: none;
    color: var(--text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}

.live-search-clear.visible {
    opacity: 1;
    visibility: visible;
}

.live-search-clear:hover {
    background: var(--accent);
    color: var(--primary);
}

/* Search Results Dropdown */
.live-search-results {
    position: absolute;
    top: calc(100% + var(--space-2));
    left: 0;
    right: 0;
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-height: 400px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s;
    z-index: 100;
}

.live-search-results.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.live-search-result-item {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4);
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background 0.2s;
}

.live-search-result-item:last-child {
    border-bottom: none;
}

.live-search-result-item:hover,
.live-search-result-item.selected {
    background: var(--bg-light);
}

.live-search-result-image {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    object-fit: cover;
    flex-shrink: 0;
}

.live-search-result-content {
    flex: 1;
}

.live-search-result-title {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 2px;
}

.live-search-result-meta {
    font-size: 0.8125rem;
    color: var(--text-light);
}

.live-search-result-type {
    padding: 2px 8px;
    background: var(--accent);
    color: var(--primary);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* Search Highlight */
.search-highlight {
    background: rgba(201, 162, 39, 0.3);
    padding: 0 2px;
    border-radius: 2px;
    font-weight: 600;
}

/* ========================================
   5. ADVANCED PRELOADER
   ======================================== */
.preloader-advanced {
    position: fixed;
    inset: 0;
    background: var(--primary);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s, visibility 0.6s;
}

.preloader-advanced.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

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

.preloader-logo {
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: 800;
    color: var(--text-white);
    margin-bottom: var(--space-6);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
}

.preloader-logo-number {
    display: inline-block;
    animation: preloaderNumber 2s ease infinite;
}

.preloader-logo-text {
    color: var(--accent);
}

@keyframes preloaderNumber {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Progress Bar */
.preloader-progress-container {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--space-4);
}

.preloader-progress-bar {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: inherit;
    width: 0%;
    transition: width 0.3s;
}

.preloader-percentage {
    color: var(--accent);
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.preloader-status {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-top: var(--space-4);
}

/* Animated Dots */
.preloader-dots {
    display: flex;
    gap: var(--space-2);
    margin-top: var(--space-6);
}

.preloader-dot {
    width: 12px;
    height: 12px;
    background: var(--accent);
    border-radius: 50%;
    animation: preloaderDot 1.4s ease-in-out infinite both;
}

.preloader-dot:nth-child(1) { animation-delay: -0.32s; }
.preloader-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes preloaderDot {
    0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* ========================================
   6. HORIZONTAL SCROLL SECTIONS
   ======================================== */
.horizontal-scroll-section {
    position: relative;
    height: 300vh; /* Altura para el scroll */
}

.horizontal-scroll-container {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
}

.horizontal-scroll-wrapper {
    display: flex;
    height: 100%;
    will-change: transform;
}

.horizontal-scroll-item {
    flex: 0 0 100vw;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-12);
}

.horizontal-scroll-item-content {
    max-width: 800px;
    text-align: center;
}

/* Scroll Indicator */
.horizontal-scroll-indicator {
    position: absolute;
    bottom: var(--space-8);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    color: var(--text-light);
    font-size: 0.875rem;
}

.horizontal-scroll-indicator i {
    animation: scrollIndicator 1.5s ease-in-out infinite;
}

@keyframes scrollIndicator {
    0%, 100% { transform: translateX(0); opacity: 1; }
    50% { transform: translateX(10px); opacity: 0.5; }
}

/* Progress Line */
.horizontal-scroll-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background: var(--accent);
    width: var(--progress, 0%);
    transition: width 0.1s linear;
}

/* ========================================
   7. ADVANCED HOVER EFFECTS
   ======================================== */
/* Image Reveal on Hover */
.image-reveal {
    position: relative;
    overflow: hidden;
}

.image-reveal img {
    transition: transform 0.8s var(--ease-out);
}

.image-reveal:hover img {
    transform: scale(1.1);
}

/* Image reveal effect - SIMPLIFICADO */
.image-reveal {
    position: relative;
    overflow: hidden;
}

/* Magnetic Effect Intensity */
.magnetic-strong {
    transition: transform 0.2s var(--ease-out);
}

/* Clip Path Reveal */
.clip-reveal {
    clip-path: polygon(0 0, 0 0, 0 100%, 0 100%);
    transition: clip-path 0.8s var(--ease-out);
}

.clip-reveal.active {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

/* ========================================
   8. CURSOR FOLLOWER ELEMENTS
   ======================================== */
.cursor-follower {
    position: fixed;
    pointer-events: none;
    z-index: 9998;
    mix-blend-mode: difference;
    transition: transform 0.15s var(--ease-out), opacity 0.2s;
    opacity: 0;
}

.cursor-follower.active {
    opacity: 1;
}

.cursor-follower-text {
    background: var(--accent);
    color: var(--primary);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* ========================================
   9. STAGGER GRID ANIMATIONS
   ======================================== */
.stagger-grid {
    display: grid;
    gap: var(--space-6);
}

.stagger-grid-item {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.stagger-grid.active .stagger-grid-item {
    opacity: 1;
    transform: translateY(0);
}

/* Delays automáticos basados en posición */
.stagger-grid.active .stagger-grid-item:nth-child(1) { transition-delay: 0s; }
.stagger-grid.active .stagger-grid-item:nth-child(2) { transition-delay: 0.1s; }
.stagger-grid.active .stagger-grid-item:nth-child(3) { transition-delay: 0.2s; }
.stagger-grid.active .stagger-grid-item:nth-child(4) { transition-delay: 0.3s; }
.stagger-grid.active .stagger-grid-item:nth-child(5) { transition-delay: 0.4s; }
.stagger-grid.active .stagger-grid-item:nth-child(6) { transition-delay: 0.5s; }

/* ========================================
   10. SCROLL VELOCITY EFFECTS
   ======================================== */
.velocity-skew {
    will-change: transform;
    transition: transform 0.1s linear;
}

/* ========================================
   11. MORPHING SHAPES
   ======================================== */
.morph-shape {
    animation: morphShape 8s ease-in-out infinite;
}

@keyframes morphShape {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
    50% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
}

/* ========================================
   12. NOISE ANIMATION
   ======================================== */
.animated-noise {
    position: relative;
}

.animated-noise::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.03;
    pointer-events: none;
    animation: noiseAnimation 0.5s steps(10) infinite;
}

@keyframes noiseAnimation {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-5%, -5%); }
    20% { transform: translate(-10%, 5%); }
    30% { transform: translate(5%, -10%); }
    40% { transform: translate(-5%, 15%); }
    50% { transform: translate(-10%, 5%); }
    60% { transform: translate(15%, 0); }
    70% { transform: translate(0, 10%); }
    80% { transform: translate(-15%, 0); }
    90% { transform: translate(10%, 5%); }
}

/* ========================================
   13. LIQUID BUTTON
   ======================================== */
.btn-liquid {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-liquid::before {
    content: '';
    position: absolute;
    top: var(--y, 50%);
    left: var(--x, 50%);
    width: 0;
    height: 0;
    background: var(--accent);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    z-index: -1;
}

.btn-liquid:hover::before {
    width: 300%;
    height: 300%;
}

/* ========================================
   14. TEXT MASK REVEAL
   ======================================== */
.text-mask-reveal {
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    background-image: linear-gradient(
        90deg,
        var(--primary) 50%,
        transparent 50%
    );
    background-size: 200% 100%;
    background-position: 100% 0;
    transition: background-position 0.8s var(--ease-out);
}

.text-mask-reveal.active {
    background-position: 0 0;
}

/* ========================================
   15. GLITCH EFFECT
   ======================================== */
.glitch-text {
    position: relative;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
}

.glitch-text:hover::before {
    animation: glitch-1 0.3s linear infinite;
    color: #ff0000;
    z-index: -1;
    opacity: 0.8;
}

.glitch-text:hover::after {
    animation: glitch-2 0.3s linear infinite;
    color: #00ffff;
    z-index: -2;
    opacity: 0.8;
}

@keyframes glitch-1 {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
}

@keyframes glitch-2 {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(2px, -2px); }
    40% { transform: translate(2px, 2px); }
    60% { transform: translate(-2px, -2px); }
    80% { transform: translate(-2px, 2px); }
}
