/* ==========================================================================
   League Event Card Compact
   Themed cards for league events on Series and Nearby pages
   Based on compact patterns from PRs 1076/1080/1081
   ========================================================================== */

/* ============================================
   CSS Variables
   ============================================ */
.lec-card {
    --lec-radius: 1rem;
    --lec-radius-sm: 0.5rem;
    --lec-radius-pill: 2rem;

    --lec-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    --lec-shadow-hover: 0 8px 32px rgba(0, 0, 0, 0.25);
    --lec-shadow-pill: 0 2px 8px rgba(0, 0, 0, 0.3);

    --lec-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Default colors (overridden by league theme via inline style) */
    --lec-primary: #4a90e2;
    --lec-gradient: #357abd;
    --lec-contrast: #ffffff;
    --lec-text: #ffffff;
    --lec-contrast-text: #1a1a1a;

    /* Glass effect */
    --lec-glass: rgba(0, 0, 0, 0.65);
    --lec-glass-border: rgba(255, 255, 255, 0.15);

    /* Status colors */
    --lec-status-registered: #28a745;
    --lec-status-open: #0d6efd;
    --lec-status-opens-soon: #6c757d;
    --lec-status-closed: #dc3545;
}

/* ============================================
   Card Grid
   ============================================ */
.lec-grid {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .lec-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (min-width: 1400px) {
    .lec-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================
   Card Base
   ============================================ */
.lec-card {
    position: relative;
    border-radius: var(--lec-radius);
    overflow: hidden;
    box-shadow: var(--lec-shadow);
    transition: var(--lec-transition);
    background: linear-gradient(135deg, var(--lec-primary), var(--lec-gradient));
    display: flex;
    flex-direction: column;
}

.lec-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--lec-shadow-hover);
}

/* Card-level animated background pattern */
.lec-card > .tiled-bg-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.15;
    pointer-events: none;
}

/* ============================================
   Hero Section - Horizontal Layout
   ============================================ */
.lec-hero {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: stretch;
    gap: 1rem;
    padding: 1rem;
}

/* Image wrapper (left side) */
.lec-hero-image-wrap {
    flex-shrink: 0;
    border-radius: var(--lec-radius);
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    line-height: 0;
    align-self: flex-start;
}

.lec-hero-image {
    display: block;
    max-width: 180px;
    height: auto;
    transition: var(--lec-transition);
}

.lec-card:hover .lec-hero-image {
    transform: scale(1.05);
}

/* Info section (right side) */
.lec-hero-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.5rem;
    min-width: 0;
    overflow: hidden;
}

/* ============================================
   Week Badge
   ============================================ */
.lec-week-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.3rem 0.7rem;
    background: var(--lec-contrast, rgba(255, 255, 255, 0.3));
    color: var(--lec-contrast-text, #000000);
    font-family: 'Karla', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-radius: var(--lec-radius-sm);
    box-shadow: var(--lec-shadow-pill);
}


/* ============================================
   Info Pills (Date, Time, Location, Format)
   ============================================ */
.lec-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.4rem;
    max-width: 100%;
    overflow: hidden;
}

.lec-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.6rem;
    background: var(--lec-glass);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--lec-glass-border);
    border-radius: var(--lec-radius-pill);
    color: #fff;
    font-size: clamp(0.75rem, 2vw, 0.875rem);
    font-weight: 500;
    white-space: nowrap;
}

.lec-pill i {
    font-size: clamp(0.65rem, 1.5vw, 0.75rem);
    opacity: 0.85;
    flex-shrink: 0;
}

.lec-pill--handicap {
    background: rgba(0, 166, 156, 0.7);
    border-color: rgba(0, 166, 156, 0.3);
}

.lec-pill--link {
    text-decoration: none;
    cursor: pointer;
    transition: var(--lec-transition);
}

.lec-pill--link:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
}

/* ============================================
   League Title - Full width centered section
   ============================================ */
.lec-league-title {
    position: relative;
    z-index: 1;
    padding: 0.125rem 1rem 0.25rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.175rem;
}

.lec-league-name {
    font-family: 'Karla', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
    margin: 0;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
}

.lec-league-title .lec-event-name {
    font-family: 'Karla', sans-serif;
    font-size: 1.35rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    margin: 0;
    line-height: 1.2;
}

/* Schedule badge below league name */
.lec-schedule-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.85rem;
    margin-top: 0.35rem;
    border-radius: var(--lec-radius-pill);
    font-family: 'Karla', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    /* Color set via inline style using theme's PrimaryTextColor */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.lec-schedule-badge i {
    font-size: 0.75rem;
    opacity: 0.9;
}

/* ============================================
   Content Section
   ============================================ */
.lec-content {
    position: relative;
    z-index: 1;
    padding: 0 1rem 0.25rem;
    background: transparent;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* Flippy Says section - compact full width styling */
.lec-content .flippy-says-simple {
    margin: 0;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    display: flex !important;
}

.lec-content .flippy-says-simple .flippy-avatar {
    width: 32px;
    height: 32px;
}

/* ============================================
   Pot Pills (Ace Pot / Super Ace)
   ============================================ */
.lec-pot-pills {
    display: flex;
    gap: 0.5rem;
    width: 100%;
    margin-bottom: 0.25rem;
}

.lec-pot-pill {
    flex: 1 1 calc(50% - 0.25rem);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--lec-radius-sm);
    color: #fff;
    font-family: 'Karla', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
}

.lec-pot-pill i {
    font-size: 0.9rem;
    opacity: 0.9;
}

.lec-pot-pill--ace i {
    color: #ffd700;
}

.lec-pot-pill--super {
    background: rgba(255, 215, 0, 0.15);
    border-color: rgba(255, 215, 0, 0.4);
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.3), inset 0 0 8px rgba(255, 215, 0, 0.1);
}

.lec-pot-pill--super i {
    color: #ffd700;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
}

.lec-pot-label {
    opacity: 0.85;
    font-weight: 500;
}

.lec-pot-amount {
    font-weight: 700;
    color: #fff;
}

/* ============================================
   Action Bar
   ============================================ */
.lec-actions {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem 0.75rem;
    background: transparent;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Action Buttons */
.lec-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1rem;
    border-radius: var(--lec-radius-sm);
    font-family: 'Karla', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--lec-transition);
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

.lec-btn i {
    font-size: 0.8rem;
}

/* Status button - full width, color-coded */
.lec-btn--status {
    flex: 1 1 100%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.lec-btn--status:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    text-decoration: none;
}

.lec-btn--status.lec-status--registered {
    background: var(--lec-status-registered);
    color: #ffffff;
}

.lec-btn--status.lec-status--open {
    background: var(--lec-status-open);
    color: #ffffff;
}

.lec-btn--status.lec-status--details {
    background: var(--lec-primary);
    color: #ffffff;
}

/* Primary button (View League Info) */
.lec-btn--primary {
    background: var(--lec-primary);
    color: var(--lec-text, #fff);
    flex: 1 1 100%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.lec-btn--primary:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    color: var(--lec-text, #fff);
    text-decoration: none;
}

/* Secondary buttons - 1/3 width each */
.lec-btn--secondary {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex: 1 1 calc(33.333% - 0.35rem);
}

.lec-btn--secondary:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    color: #ffffff;
    text-decoration: none;
}

.lec-btn--secondary .badge {
    background: var(--lec-primary);
    color: #fff;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 1rem;
    margin-left: 0.25rem;
}

/* Friends badge in action bar */
.lec-actions .friends-badge-wrapper {
    flex-shrink: 0;
}

.lec-actions .friends-badge {
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 767px) {
    .lec-hero {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .lec-hero-image {
        max-width: 140px;
    }

    .lec-hero-info {
        gap: 0.3rem;
    }

    .lec-pills {
        flex-direction: column;
        gap: 0.3rem;
        max-width: 100%;
    }

    .lec-pill {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
        justify-content: center;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Hide handicap pill on mobile */
    .lec-pill--handicap {
        display: none;
    }

    .lec-event-name {
        font-size: 1.2rem;
    }

    .lec-league-name {
        font-size: 0.9rem;
    }

    .lec-pot-pill {
        padding: 0.5rem 0.65rem;
        font-size: 0.8rem;
    }

    .lec-btn--secondary {
        flex: 1 1 100%;
    }
}

/* ============================================
   Dark Mode Support
   ============================================ */
[data-bs-theme="dark"] .lec-card {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .lec-card:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

[data-bs-theme="dark"] .lec-card > .tiled-bg-pattern {
    opacity: 0.2;
    mix-blend-mode: screen;
}

[data-bs-theme="dark"] .lec-hero-image-wrap {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

[data-bs-theme="dark"] .lec-glass {
    background: rgba(0, 0, 0, 0.75);
}

[data-bs-theme="dark"] .lec-btn--secondary {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
}

[data-bs-theme="dark"] .lec-btn--secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}
