/* CSS para a página de listagem de eventos - Conect-r */

.eventos-hero {
    padding: 60px 0 40px;
    text-align: center;
    background: linear-gradient(to bottom, rgba(37, 99, 235, 0.05), transparent);
}

.eventos-hero h1 {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 10px;
    color: var(--primary);
}

.eventos-hero p {
    color: var(--text-gray);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 30px;
}

.search-section {
    margin-bottom: 50px;
}

.search-container-full {
    background: #fff;
    padding: 10px;
    border-radius: 50px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    display: flex;
    max-width: 700px;
    margin: 0 auto;
    border: 1px solid var(--border);
    transition: box-shadow 0.3s ease;
}

.search-container-full:focus-within {
    box-shadow: 0 15px 35px rgba(37, 99, 235, 0.1);
}

.search-input-full {
    flex: 1;
    border: none;
    padding: 15px 25px;
    font-size: 1rem;
    outline: none;
    background: transparent;
    color: var(--dark);
}

.search-btn-full {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 0 30px;
    border-radius: 40px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-btn-full:hover {
    background: var(--primary-dark);
}

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

.no-results {
    text-align: center;
    padding: 100px 0;
    color: var(--texto);
}

.no-results i {
    font-size: 4rem;
    opacity: 0.2;
    display: block;
    margin-bottom: 20px;
}

/* Event Card Adjustments for Grid */
.eventos-grid .event-card-mosaic {
    width: 100% !important;
    margin: 0 !important;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.eventos-grid .event-card-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.eventos-grid .event-footer {
    margin-top: auto;
}

@media (max-width: 600px) {
    .eventos-hero h1 {
        font-size: 2rem;
    }
    .search-container-full {
        border-radius: 15px;
        flex-direction: column;
        padding: 15px;
    }
    .search-input-full {
        padding: 10px;
        text-align: center;
    }
    .search-btn-full {
        padding: 12px;
        justify-content: center;
    }
}

/* Modal de Eventos (Copiado do index para consistência) */
.event-modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.9);
    z-index: 99999; display: flex; align-items: center; justify-content: center;
    padding: 20px; backdrop-filter: blur(10px);
}
.event-modal-content {
    background: white !important; border-radius: 32px; max-width: 1100px; width: 100%;
    display: flex !important; overflow: hidden; position: relative; height: 85vh;
    box-shadow: 0 35px 70px -15px rgba(0,0,0,0.6);
}
.event-modal-left {
    width: 60% !important; background: #000; position: relative;
    display: flex !important; align-items: center; justify-content: center;
    border-right: 1px solid #f1f5f9;
}
.event-modal-right {
    width: 40% !important; padding: 45px 35px; overflow-y: auto;
    display: flex !important; flex-direction: column; gap: 20px;
    background: white !important; position: relative; z-index: 2;
}
.event-swiper-modal { width: 100%; height: 100%; position: relative; }
.event-swiper-modal .swiper-slide { display: flex; align-items: center; justify-content: center; }
.event-swiper-modal img, .event-swiper-modal video { max-width: 100%; max-height: 100%; object-fit: contain; }

.event-swiper-container { width: 100%; height: 100%; position: relative; background: #000; overflow: hidden; }
.event-swiper { width: 100%; height: 100%; }

/* FIX: Force Swiper to use flex layout to prevent overlap */
.event-swiper .swiper-wrapper {
    display: flex !important;
    flex-direction: row !important;
    height: 100% !important;
}

.event-swiper .swiper-slide {
    width: 100% !important;
    height: 100% !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    position: relative !important;
}
.event-swiper img, .event-swiper video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

/* Botões de Navegação Customizados */
.event-modal-next,
.event-modal-prev {
    position: absolute !important;
    color: white !important;
    background: rgba(255,255,255,0.2) !important;
    width: 48px !important;
    height: 48px !important;
    border-radius: 50% !important;
    border: 1px solid rgba(255,255,255,0.3) !important;
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
    z-index: 20;
    top: 50% !important;
    transform: translateY(-50%) !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0 !important;
}
.event-modal-next { right: 20px !important; }
.event-modal-prev { left: 20px !important; }

.event-modal-next:hover,
.event-modal-prev:hover {
    background: rgba(255,255,255,0.4) !important;
    transform: translateY(-50%) scale(1.1) !important;
}

/* Swiper default icons hidden in favor of actual i tags */
.event-modal-next::after, .event-modal-prev::after {
    display: none !important;
}
.event-modal-next, .event-modal-prev {
    font-size: 1.5rem !important;
    color: white !important;
}

.event-swiper-container .swiper-pagination {
    bottom: 20px !important;
    z-index: 10 !important;
}
.event-swiper-container .swiper-pagination-bullet { background: white !important; opacity: 0.6; }
.event-swiper-container .swiper-pagination-bullet-active { background: white !important; opacity: 1; }

.btn-close-event {
    position: absolute; top: 20px; right: 20px; border: none; background: #f1f5f9;
    width: 40px; height: 40px; border-radius: 50%; font-size: 1.2rem; cursor: pointer;
    z-index: 100; display: flex; align-items: center; justify-content: center;
    transition: 0.3s; color: #0f172a;
}
.btn-close-event:hover { background: #ef4444; color: white; transform: rotate(90deg); }

.swiper-pagination-bullet-active { background: var(--primary) !important; }

@media (max-width: 900px) {
    .event-modal-content { flex-direction: column; height: 95vh; }
    .event-modal-left { width: 100% !important; height: 45%; }
    .event-modal-right { width: 100% !important; height: 55%; padding: 30px 20px; }
}

/* CUSTOM VIDEO PLAYER CONTROLS (Padrão Site) */
.video-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.video-wrapper:fullscreen,
.video-wrapper:-webkit-full-screen,
.video-wrapper.is-fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    background: #000 !important;
}

.video-wrapper:fullscreen video,
.video-wrapper:-webkit-full-screen video,
.video-wrapper.is-fullscreen video {
    width: 100vw !important;
    height: 100vh !important;
    object-fit: contain !important;
}

.video-preview-container {
    pointer-events: none;
    z-index: 1;
}

.event-card-img:hover .video-preview-container video {
    opacity: 1 !important;
}

.video-overlay-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 5rem;
    color: white;
    opacity: 0;
    pointer-events: none;
    transition: 0.3s;
    z-index: 10;
}

.custom-player-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 20;
}

.video-wrapper:hover .custom-player-controls,
.video-wrapper:fullscreen .custom-player-controls,
.video-wrapper:-webkit-full-screen .custom-player-controls,
.video-wrapper.is-fullscreen .custom-player-controls {
    opacity: 1;
}

.video-wrapper video::-webkit-media-controls,
.video-wrapper video::-webkit-media-controls-enclosure {
    display: none !important;
}

.video-progress {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    transition: height 0.1s;
}

.video-progress:hover {
    height: 8px;
}

.video-progress-fill {
    height: 100%;
    width: 0%;
    background: #2563eb;
    border-radius: 10px;
    position: relative;
}

.video-btns-row {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #fff;
}

.video-btns-row button {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: 0.2s;
}

.video-btns-row button:hover {
    transform: scale(1.2);
    color: #2563eb;
}

.video-btns-row span {
    font-size: 0.85rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* Eventos motion layer */
.eventos-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background:
        radial-gradient(circle at 16% 18%, rgba(37,99,235,0.16), transparent 24rem),
        radial-gradient(circle at 86% 6%, rgba(217,119,6,0.12), transparent 20rem),
        linear-gradient(180deg, rgba(37,99,235,0.08), transparent 84%) !important;
}

.eventos-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgba(37,99,235,0.10) 1px, transparent 1px),
        linear-gradient(90deg, rgba(37,99,235,0.10) 1px, transparent 1px);
    background-size: 58px 58px;
    mask-image: linear-gradient(180deg, rgba(0,0,0,0.75), transparent 78%);
    animation: eventosGridDrift 18s linear infinite;
}

.eventos-hero::after {
    content: "";
    position: absolute;
    width: clamp(170px, 24vw, 340px);
    aspect-ratio: 1;
    right: 7%;
    top: 18%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37,99,235,0.18), transparent 66%);
    filter: blur(2px);
    opacity: 0.75;
    z-index: -1;
    animation: eventosFloat 9s ease-in-out infinite alternate;
}

.eventos-hero .container > .btn-user,
.eventos-hero h1,
.eventos-hero p,
.search-section {
    animation: eventosRise 0.75s cubic-bezier(.16,1,.3,1) both;
}

.eventos-hero h1 { animation-delay: 0.08s; }
.eventos-hero p { animation-delay: 0.16s; }
.search-section { animation-delay: 0.24s; }

.eventos-hero h1 {
    text-shadow: 0 18px 38px rgba(37,99,235,0.14);
}

.search-container-full {
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
}

.search-container-full::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(110deg, transparent, rgba(37,99,235,0.12), transparent);
    transform: translateX(-120%);
    transition: transform 0.7s ease;
}

.search-container-full:focus-within::after,
.search-container-full:hover::after {
    transform: translateX(120%);
}

.search-btn-full {
    position: relative;
    overflow: hidden;
    box-shadow: 0 12px 24px rgba(37,99,235,0.18);
}

.search-btn-full:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 34px rgba(37,99,235,0.25);
}

.eventos-lista {
    position: relative;
}

.eventos-grid {
    perspective: 1200px;
}

.eventos-grid .event-card-mosaic {
    position: relative;
    transform-style: preserve-3d;
    animation: eventosCardIn 0.72s cubic-bezier(.16,1,.3,1) both;
    animation-delay: calc(min(var(--motion-index, 0), 10) * 60ms);
    transition:
        transform 0.28s ease,
        box-shadow 0.28s ease,
        border-color 0.28s ease,
        filter 0.28s ease;
    will-change: transform;
}

.eventos-grid .event-card-mosaic::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: radial-gradient(circle at var(--event-x, 50%) var(--event-y, 50%), rgba(255,255,255,0.34), transparent 40%);
    opacity: 0;
    transition: opacity 0.24s ease;
}

.eventos-grid .event-card-mosaic:hover::after {
    opacity: 1;
}

.eventos-grid .event-card-mosaic:hover {
    transform: perspective(1000px) translateY(-10px) rotateX(var(--event-tilt-y, 0deg)) rotateY(var(--event-tilt-x, 0deg));
    box-shadow: 0 28px 58px rgba(15,23,42,0.16);
}

.eventos-grid .event-date-badge {
    transform: translateZ(26px);
    animation: eventosDatePulse 2.8s ease-in-out infinite;
}

.eventos-grid .event-tag,
.eventos-grid .btn-event-details-simple,
.eventos-grid .btn-event-action {
    transform: translateZ(18px);
}

.event-modal-overlay {
    animation: eventosModalFade 0.25s ease both;
}

.event-modal-content {
    animation: eventosModalIn 0.42s cubic-bezier(.16,1,.3,1) both;
}

.no-results {
    animation: eventosRise 0.7s cubic-bezier(.16,1,.3,1) both;
}

@keyframes eventosRise {
    from { opacity: 0; transform: translateY(22px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes eventosCardIn {
    from { opacity: 0; transform: perspective(900px) translateY(30px) rotateX(10deg) scale(0.98); filter: blur(4px); }
    to { opacity: 1; transform: perspective(900px) translateY(0) rotateX(0) scale(1); filter: blur(0); }
}

@keyframes eventosGridDrift {
    from { background-position: 0 0, 0 0; }
    to { background-position: 58px 58px, 58px 58px; }
}

@keyframes eventosFloat {
    from { transform: translate3d(-12px, 8px, 0) scale(0.96); }
    to { transform: translate3d(14px, -16px, 0) scale(1.06); }
}

@keyframes eventosDatePulse {
    0%, 100% { box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
    50% { box-shadow: 0 10px 24px rgba(37,99,235,0.20); }
}

@keyframes eventosModalFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes eventosModalIn {
    from { opacity: 0; transform: perspective(1000px) translateY(24px) rotateX(7deg) scale(0.98); }
    to { opacity: 1; transform: perspective(1000px) translateY(0) rotateX(0) scale(1); }
}

@media (max-width: 900px) {
    .eventos-hero::before { background-size: 44px 44px; opacity: 0.72; }
    .eventos-hero::after { opacity: 0.42; }

    .eventos-grid .event-card-mosaic {
        animation-duration: 0.58s;
        animation-delay: calc(min(var(--motion-index, 0), 5) * 45ms);
    }

    .eventos-grid .event-card-mosaic:hover {
        transform: translateY(-4px);
    }
}

@media (max-width: 600px) {
    .eventos-hero .container > .btn-user,
    .eventos-hero h1,
    .eventos-hero p,
    .search-section {
        animation-duration: 0.56s;
    }

    .eventos-grid .event-card-mosaic {
        animation-name: eventosCardInMobile;
    }
}

@keyframes eventosCardInMobile {
    from { opacity: 0; transform: perspective(720px) translateY(24px) rotateX(7deg) scale(0.985); }
    to { opacity: 1; transform: perspective(720px) translateY(0) rotateX(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .eventos-hero::before,
    .eventos-hero::after,
    .eventos-grid .event-date-badge {
        animation: none !important;
    }

    .eventos-hero .container > .btn-user,
    .eventos-hero h1,
    .eventos-hero p,
    .search-section,
    .eventos-grid .event-card-mosaic,
    .event-modal-overlay,
    .event-modal-content,
    .no-results {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
    }
}
