/* ====================================
   EVENTS DECK - PLAYING CARD THEME
   E[X]PECTATIONS 2025
   ==================================== */

:root {
    --color-black: #000000;
    --color-red: #841818;
    --color-white: #FAFAFA;
    --color-gray: #888888;
    --card-width: 280px;
    --card-height: 400px;
}

/* ====================================
   EVENTS HERO SECTION
   ==================================== */

.events-hero {
    position: relative;
    height: 50vh;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-top: 80px;
}

.events-hero .hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.events-hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.3) 100%);
    z-index: 2;
}

.events-hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 40px 20px;
}

.events-hero-title {
    font-family: var(--font-title);
    font-size: 64px;
    font-weight: 900;
    color: var(--color-white);
    margin-bottom: 16px;
    letter-spacing: 12px;
    text-transform: uppercase;
    text-shadow: 0 4px 20px rgba(132, 24, 24, 0.8),
                 0 0 40px rgba(132, 24, 24, 0.5);
    animation: fadeInUp 1s ease-out;
}

.events-hero-subtitle {
    font-family: var(--font-subtitle);
    font-size: 20px;
    color: var(--color-white);
    font-weight: 300;
    letter-spacing: 2px;
    opacity: 0.9;
    margin-bottom: 20px;
    animation: fadeInUp 1s ease-out 0.2s both;
}

.card-suits-display {
    display: flex;
    gap: 30px;
    justify-content: center;
    margin-top: 20px;
    animation: fadeInUp 1s ease-out 0.4s both;
}

.suit-symbol {
    font-size: 48px;
    animation: float 3s ease-in-out infinite;
}

.suit-symbol.spade {
    color: var(--color-white);
    animation-delay: 0s;
}

.suit-symbol.heart {
    color: var(--color-red);
    animation-delay: 0.5s;
}

.suit-symbol.diamond {
    color: var(--color-red);
    animation-delay: 1s;
}

.suit-symbol.club {
    color: var(--color-white);
    animation-delay: 1.5s;
}

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

/* ====================================
   EVENT FILTER TABS
   ==================================== */

.events-filter-section {
    background: rgba(0, 0, 0, 0.95);
    padding: 30px 0;
    position: sticky;
    top: 80px;
    z-index: 100;
    border-bottom: 2px solid rgba(132, 24, 24, 0.3);
    backdrop-filter: blur(10px);
}

.event-tabs {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.tab-btn {
    background: rgba(10, 10, 10, 0.9);
    color: rgba(250, 250, 250, 0.7);
    border: 2px solid rgba(250, 250, 250, 0.2);
    border-radius: 0;
    padding: 12px 30px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.tab-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(132, 24, 24, 0.3), transparent);
    transition: left 0.5s ease;
}

.tab-btn:hover::before {
    left: 100%;
}

.tab-btn:hover {
    color: var(--color-white);
    border-color: rgba(132, 24, 24, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(132, 24, 24, 0.3);
}

.tab-btn.active {
    color: var(--color-white);
    background: var(--color-red);
    border-color: var(--color-red);
    box-shadow: 0 0 20px rgba(132, 24, 24, 0.6);
}

/* ====================================
   EVENTS DECK SECTION
   ==================================== */

.events-deck-section {
    background: var(--color-black);
    padding: 80px 0 100px;
    position: relative;
    min-height: 100vh;
}

.events-deck-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(132, 24, 24, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(132, 24, 24, 0.03) 0%, transparent 50%);
    pointer-events: none;
}

.deck-container {
    display: grid;
    /* 3 cards per row on laptop/desktop */
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    padding: 40px 20px;
    position: relative;
    z-index: 1;
    max-width: 1600px;
    margin: 0 auto;
}

/* Fix for card flip overlap - each card stays in its grid cell */
.deck-container > * {
    position: relative;
    /* Remove isolation to allow z-index elevation */
    overflow: visible;
    /* Ensure cards maintain their position */
    display: flex;
    align-items: center;
    justify-content: center;
    /* Add extra padding to prevent visual overlap */
    padding: 30px 0;
}

/* ====================================
   PLAYING CARD STYLES
   ==================================== */

/* Playing card is now a simple clickable card */
.playing-card {
    width: 100%;
    max-width: var(--card-width);
    height: var(--card-height);
    margin: 0 auto;
    cursor: pointer;
    position: relative;
    transition: transform 0.3s ease;
}

.playing-card:hover {
    transform: translateY(-10px) scale(1.05);
}

@keyframes cardGlow {
    0%, 100% {
        filter: drop-shadow(0 25px 50px rgba(132, 24, 24, 0.6))
                drop-shadow(0 0 30px rgba(132, 24, 24, 0.4));
    }
    50% {
        filter: drop-shadow(0 25px 50px rgba(132, 24, 24, 0.8))
                drop-shadow(0 0 40px rgba(132, 24, 24, 0.6));
    }
}

/* Card inner is now a simple link wrapper */
.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6),
                0 2px 10px rgba(0, 0, 0, 0.4);
    transition: box-shadow 0.4s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.playing-card:hover .card-front {
    box-shadow: 0 20px 60px rgba(132, 24, 24, 0.4),
                0 10px 30px rgba(0, 0, 0, 0.6);
}

/* ====================================
   CARD FRONT DESIGN (Playing Card Style)
   ==================================== */

.card-front {
    /* Remove white background to let video show through */
    background: transparent;
    border: 3px solid #333;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0;
    position: relative;
    overflow: hidden;
}

.card-front::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* Subtle overlay to make text readable while keeping video visible */
    background: linear-gradient(135deg, 
        rgba(0, 0, 0, 0.3) 0%, 
        rgba(0, 0, 0, 0.1) 50%,
        rgba(0, 0, 0, 0.3) 100%);
    pointer-events: none;
    z-index: 1;
}

.card-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Make video more visible and vibrant */
    opacity: 0.75;
    filter: grayscale(0%) brightness(1.15) contrast(1.15) saturate(1.2);
    z-index: 0;
    transition: opacity 0.4s ease, filter 0.4s ease;
}

.playing-card:hover .card-video {
    opacity: 0.85;
    filter: grayscale(0%) brightness(1.2) contrast(1.2) saturate(1.3);
}

.card-front::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* Subtle vignette to make center content readable */
    background: radial-gradient(circle at center, transparent 30%, rgba(0, 0, 0, 0.4) 100%);
    pointer-events: none;
    z-index: 1;
}

.card-corner {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
    z-index: 2;
    position: relative;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.card-corner.top-left {
    position: absolute;
    top: 15px;
    left: 15px;
}

.card-corner.bottom-right {
    position: absolute;
    bottom: 15px;
    right: 15px;
    transform: rotate(180deg);
}

.card-rank {
    font-size: 32px;
    font-weight: 900;
    /* Change to white for better visibility on video */
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 0, 0, 0.6);
}

.card-suit {
    font-size: 28px;
    margin-top: -5px;
}

/* All cards use spade suit with white color */
.card-suit,
.card-rank {
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 0, 0, 0.6);
}

.card-center {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}

/* Hide the decorative icon */
.card-icon {
    display: none;
}

@keyframes iconShine {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.3));
    }
    50% {
        transform: scale(1.05);
        filter: drop-shadow(0 8px 16px rgba(132, 24, 24, 0.4));
    }
}

.card-title {
    font-family: var(--font-title);
    font-size: 24px;
    font-weight: 900;
    color: #ffffff;
    margin: 0;
    padding: 14px 16px;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: 0 4px 16px rgba(0, 0, 0, 1),
                 0 2px 8px rgba(0, 0, 0, 0.9),
                 0 0 40px rgba(0, 0, 0, 0.8);
    position: relative;
    z-index: 3;
    line-height: 1.3;
    background: linear-gradient(180deg, 
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.75) 20%,
        rgba(0, 0, 0, 0.95) 100%);
    border-top: 2px solid rgba(132, 24, 24, 0.7);
    width: 100%;
    backdrop-filter: blur(8px);
    text-align: center;
}

/* Hide the tagline */
.card-tagline {
    display: none;
}

/* Hide flip indicator - cards now link directly */
.flip-indicator {
    display: none;
}

/* Hide card back - cards now link directly to event page */
.card-back {
    display: none;
}

.card-back-header h3 {
    font-size: 24px;
    font-weight: 800;
    color: var(--color-white);
    margin: 0;
    letter-spacing: 1px;
}

.card-back-content {
    flex: 1;
    overflow-y: auto;
    z-index: 2;
}

.event-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 15px;
    background: rgba(132, 24, 24, 0.1);
    padding: 12px;
    border-radius: 0;
    border: 1px solid rgba(132, 24, 24, 0.3);
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--color-white);
    padding: 6px 0;
    border-left: 2px solid rgba(132, 24, 24, 0.5);
    padding-left: 12px;
}

.detail-icon {
    display: none;
}

.detail-text {
    font-weight: 500;
    opacity: 0.95;
    letter-spacing: 0.5px;
}

.detail-text::before {
    content: '▸';
    margin-right: 8px;
    color: var(--color-red);
    font-weight: 700;
}

.event-description {
    font-size: 13px;
    line-height: 1.6;
    color: rgba(250, 250, 250, 0.85);
    margin-top: 10px;
    text-align: justify;
}

.card-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    z-index: 10;
    pointer-events: auto; /* CRITICAL */
}

.card-btn {
    flex: 1;
    padding: 10px 15px;
    border-radius: 0;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
    text-decoration: none;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    z-index: 10; /* Ensure buttons are on top */
    pointer-events: auto; /* CRITICAL: Re-enable pointer events */
}

.card-btn.know-more {
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-white);
    border: 2px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
}

.card-btn.know-more:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.2);
}

.card-btn.register {
    background: linear-gradient(135deg, var(--color-red) 0%, #a01f1f 100%);
    color: var(--color-white);
    border: 2px solid transparent;
    box-shadow: 0 4px 15px rgba(132, 24, 24, 0.4);
}

.card-btn.register:hover {
    background: linear-gradient(135deg, #a01f1f 0%, #b82424 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(132, 24, 24, 0.6);
}

/* ====================================
   FILTER ANIMATIONS
   ==================================== */

.playing-card {
    animation: cardSlideIn 0.6s ease-out forwards;
    animation-play-state: running;
}

/* Prevent animation from interfering with flip transform */
.playing-card.flipped {
    animation: none !important;
}

.playing-card.hidden {
    display: none;
}

@keyframes cardSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate3d(0,0,0) scale(1);
    }
}

/* ====================================
   RESPONSIVE DESIGN
   ==================================== */

@media (max-width: 768px) {
    .events-hero-title {
        font-size: 42px;
        letter-spacing: 6px;
    }

    .events-hero-subtitle {
        font-size: 16px;
    }

    .card-suits-display {
        gap: 20px;
    }

    .suit-symbol {
        font-size: 36px;
    }

    .events-filter-section {
        top: 60px;
        padding: 20px 0;
    }

    .event-tabs {
        gap: 10px;
    }

    .tab-btn {
        padding: 10px 20px;
        font-size: 12px;
    }

    .events-deck-section {
        padding: 40px 0 60px;
    }

    .deck-container {
        /* 2 cards per row on tablet */
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
        padding: 10px;
    }

    :root {
        --card-width: 240px;
        --card-height: 340px;
    }

    .card-icon {
        font-size: 48px;
    }

    .card-title {
        font-size: 20px;
    }

    .card-tagline {
        font-size: 12px;
    }

    .card-rank {
        font-size: 28px;
    }

    .card-suit {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .events-hero-title {
        font-size: 32px;
        letter-spacing: 4px;
    }

    .events-hero-subtitle {
        font-size: 14px;
    }

    .deck-container {
        /* 2 cards per row even on mobile */
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 10px;
    }

    :root {
        --card-width: 260px;
        --card-height: 360px;
    }

    .card-back-header h3 {
        font-size: 18px;
    }

    .event-description {
        font-size: 12px;
    }

    .card-btn {
        padding: 10px 16px;
        font-size: 12px;
        min-height: 44px;
    }

    .playing-card {
        /* Ensure cards don't overflow on small screens */
        max-width: 100%;
    }

    .deck-container > * {
        padding: 15px 0;
    }

    /* Make filter buttons more touch-friendly */
    .tab-btn {
        min-height: 44px;
        padding: 12px 16px;
        font-size: 13px;
    }

    .events-hero-title {
        font-size: 28px;
    }

    .events-hero-subtitle {
        font-size: 12px;
    }
}

/* Very small mobile screens */
@media (max-width: 375px) {
    .deck-container {
        gap: 10px;
        padding: 10px 8px;
    }

    :root {
        --card-width: 240px;
        --card-height: 340px;
    }

    .card-title {
        font-size: 16px;
    }

    .card-icon {
        font-size: 40px;
    }

    .card-rank {
        font-size: 20px;
    }

    .card-suit {
        font-size: 18px;
    }
}


/* ====================================
   ANIMATIONS
   ==================================== */

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

/* Smooth scrollbar for card back content */
.card-back-content::-webkit-scrollbar {
    width: 4px;
}

.card-back-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0;
}

.card-back-content::-webkit-scrollbar-thumb {
    background: rgba(132, 24, 24, 0.5);
    border-radius: 0;
}

.card-back-content::-webkit-scrollbar-thumb:hover {
    background: rgba(132, 24, 24, 0.7);
}
