/* ========================================
   THEHUB BADGE DESIGN SYSTEM
   Inspired by: Awakenings
   Use: Series, Events, Sponsors
   ======================================== */

/* ===== CORE BADGE GRID ===== */
.badge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-xl, 2rem);
    padding: var(--space-xl, 2rem) 0;
}

@media (min-width: 600px) {
    .badge-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

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

/* ===== BOLD GRADIENT BADGE (Primary Style) ===== */
.badge-bold {
    position: relative;
    aspect-ratio: 4/5;
    background: linear-gradient(135deg, var(--badge-gradient-start, #004A98) 0%, var(--badge-gradient-end, #001f3f) 100%);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    text-decoration: none;
    display: block;
    color: white;
}

/* Shimmer effect on hover */
.badge-bold::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle at center,
        rgba(255,255,255,0.15) 0%,
        transparent 70%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.badge-bold:hover::before {
    opacity: 1;
}

/* Hover lift effect */
.badge-bold:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.25);
}

/* Active/pressed state */
.badge-bold:active {
    transform: translateY(-4px) scale(1.01);
}

/* ===== BADGE LOGO CONTAINER ===== */
.badge-logo-container {
    position: relative;
    width: 100%;
    height: 60%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl, 2rem);
    z-index: 2;
}

.badge-logo {
    max-width: 80%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
    transition: transform 0.3s ease;
}

.badge-bold:hover .badge-logo {
    transform: scale(1.05);
}

/* Fallback icon when no logo */
.badge-logo-placeholder {
    width: 80px;
    height: 80px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

/* ===== BADGE INFO SECTION ===== */
.badge-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--space-lg, 1.5rem);
    background: linear-gradient(
        to top,
        rgba(0,0,0,0.95) 0%,
        rgba(0,0,0,0.8) 50%,
        transparent 100%
    );
    z-index: 3;
}

/* ===== DISCIPLINE/CATEGORY BADGE ===== */
.badge-discipline {
    display: inline-block;
    padding: 4px 12px;
    background: var(--badge-accent, rgba(97, 206, 112, 0.9));
    color: white;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 4px;
    margin-bottom: var(--space-xs, 0.25rem);
    backdrop-filter: blur(4px);
}

/* Accent color variants */
.badge-bold[data-accent="gold"] .badge-discipline,
.badge-discipline[data-accent="gold"] {
    background: rgba(255, 215, 0, 0.9);
    color: #000;
}

.badge-bold[data-accent="blue"] .badge-discipline,
.badge-discipline[data-accent="blue"] {
    background: rgba(0, 74, 152, 0.9);
}

.badge-bold[data-accent="green"] .badge-discipline,
.badge-discipline[data-accent="green"] {
    background: rgba(97, 206, 112, 0.9);
}

.badge-bold[data-accent="orange"] .badge-discipline,
.badge-discipline[data-accent="orange"] {
    background: rgba(255, 107, 53, 0.9);
}

.badge-bold[data-accent="purple"] .badge-discipline,
.badge-discipline[data-accent="purple"] {
    background: rgba(139, 92, 246, 0.9);
}

.badge-bold[data-accent="red"] .badge-discipline,
.badge-discipline[data-accent="red"] {
    background: rgba(239, 68, 68, 0.9);
}

.badge-bold[data-accent="teal"] .badge-discipline,
.badge-discipline[data-accent="teal"] {
    background: rgba(20, 184, 166, 0.9);
}

/* ===== BADGE TITLE ===== */
.badge-title {
    font-size: var(--text-xl, 1.25rem);
    font-weight: 900;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: var(--space-2xs, 0.125rem);
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* ===== BADGE META INFO ===== */
.badge-meta {
    font-size: var(--text-xs, 0.75rem);
    color: rgba(255,255,255,0.75);
    font-weight: 500;
    margin-bottom: var(--space-sm, 0.5rem);
}

/* ===== BADGE CTA BUTTON ===== */
.badge-cta {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs, 0.25rem);
    padding: 8px 16px;
    background: rgba(97, 206, 112, 0.2);
    border: 1px solid rgba(97, 206, 112, 0.5);
    color: #61CE70;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 6px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.badge-bold:hover .badge-cta {
    background: #61CE70;
    color: white;
    border-color: #61CE70;
}

.badge-cta-arrow {
    transition: transform 0.2s ease;
}

.badge-bold:hover .badge-cta-arrow {
    transform: translateX(4px);
}

/* ===== SPONSOR BADGE (sidebar/ad placement) ===== */
.badge-sponsor {
    position: relative;
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
    border-radius: 12px;
    overflow: hidden;
    padding: var(--space-md, 1rem);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255,255,255,0.1);
    text-decoration: none;
}

.badge-sponsor:hover {
    border-color: var(--color-accent, #61CE70);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.badge-sponsor-logo {
    max-width: 70%;
    max-height: 60%;
    object-fit: contain;
    opacity: 0.9;
    transition: opacity 0.2s ease;
}

.badge-sponsor:hover .badge-sponsor-logo {
    opacity: 1;
}

.badge-sponsor-label {
    position: absolute;
    top: var(--space-xs, 0.25rem);
    right: var(--space-xs, 0.25rem);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255,255,255,0.4);
    font-weight: 600;
}

/* Sponsor tier sizes */
.badge-sponsor[data-tier="title"] {
    aspect-ratio: 21/9;
}

.badge-sponsor[data-tier="gold"] {
    aspect-ratio: 16/9;
}

.badge-sponsor[data-tier="silver"],
.badge-sponsor[data-tier="bronze"] {
    aspect-ratio: 3/2;
}

/* ===== EVENT HEADER BADGE (wide format) ===== */
.badge-event-header {
    position: relative;
    aspect-ratio: 21/9;
    background: linear-gradient(135deg, var(--badge-gradient-start, #004A98) 0%, var(--badge-gradient-end, #001f3f) 100%);
    border-radius: 16px;
    overflow: hidden;
    padding: var(--space-xl, 2rem);
    display: flex;
    align-items: flex-end;
    margin-bottom: var(--space-xl, 2rem);
}

.badge-event-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 20px,
            rgba(255,255,255,0.03) 20px,
            rgba(255,255,255,0.03) 40px
        );
    pointer-events: none;
}

.badge-event-header-content {
    position: relative;
    z-index: 2;
    flex: 1;
}

.badge-event-header .badge-title {
    font-size: var(--text-3xl, 1.875rem);
    margin-bottom: var(--space-sm, 0.5rem);
}

.badge-event-header .badge-meta {
    font-size: var(--text-base, 1rem);
}

.badge-event-header-sponsors {
    position: relative;
    z-index: 2;
    display: flex;
    gap: var(--space-md, 1rem);
    align-items: center;
    padding: var(--space-md, 1rem);
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
    border-radius: 8px;
}

.badge-event-sponsor-logo {
    height: 40px;
    width: auto;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.badge-event-sponsor-logo:hover {
    opacity: 1;
}

/* ===== SERIES HEADER BADGE ===== */
.badge-series-header {
    position: relative;
    aspect-ratio: 3/1;
    background: linear-gradient(135deg, var(--badge-gradient-start, #004A98) 0%, var(--badge-gradient-end, #001f3f) 100%);
    border-radius: 16px;
    overflow: hidden;
    padding: var(--space-xl, 2rem);
    display: flex;
    align-items: center;
    gap: var(--space-xl, 2rem);
    margin-bottom: var(--space-xl, 2rem);
}

.badge-series-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        repeating-linear-gradient(
            -45deg,
            transparent,
            transparent 30px,
            rgba(255,255,255,0.02) 30px,
            rgba(255,255,255,0.02) 60px
        );
    pointer-events: none;
}

.badge-series-header-logo {
    position: relative;
    z-index: 2;
    max-height: 100%;
    max-width: 200px;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
}

.badge-series-header-content {
    position: relative;
    z-index: 2;
    flex: 1;
}

/* ===== SPONSOR GRID LAYOUTS ===== */
.sponsor-badges {
    display: grid;
    gap: var(--space-md, 1rem);
    margin: var(--space-lg, 1.5rem) 0;
}

/* Sidebar sponsor grid (vertical) */
.sidebar-section .sponsor-grid,
.sponsor-grid-sidebar {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md, 1rem);
}

/* Content area sponsor grid (horizontal) */
.content-sponsors,
.sponsor-grid-horizontal {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md, 1rem);
    padding: var(--space-xl, 2rem) 0;
    border-top: 1px solid var(--color-border, rgba(255,255,255,0.1));
    border-bottom: 1px solid var(--color-border, rgba(255,255,255,0.1));
}

/* Footer sponsor grid */
.footer-sponsors,
.sponsor-grid-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-xl, 2rem);
    flex-wrap: wrap;
    padding: var(--space-xl, 2rem) 0;
    opacity: 0.7;
}

.footer-sponsors .badge-sponsor-logo,
.sponsor-grid-footer .badge-sponsor-logo {
    height: 30px;
    width: auto;
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 599px) {
    .badge-bold {
        aspect-ratio: 1;
    }

    .badge-event-header {
        aspect-ratio: 4/3;
        flex-direction: column;
        align-items: stretch;
    }

    .badge-event-header-sponsors {
        margin-top: var(--space-md, 1rem);
        flex-wrap: wrap;
        justify-content: center;
    }

    .badge-series-header {
        aspect-ratio: 4/3;
        flex-direction: column;
        text-align: center;
    }

    .badge-series-header-logo {
        max-height: 80px;
    }
}

/* ===== LIGHT THEME ADJUSTMENTS ===== */
[data-theme="light"] .badge-sponsor {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-color: rgba(0,0,0,0.1);
}

[data-theme="light"] .badge-sponsor-label {
    color: rgba(0,0,0,0.4);
}

/* ===== DARK THEME ADJUSTMENTS ===== */
[data-theme="dark"] .badge-sponsor {
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
}

[data-theme="dark"] .badge-sponsor-logo {
    filter: brightness(1.1);
}

/* ===== ANIMATION KEYFRAMES ===== */
@keyframes badge-pulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    }
    50% {
        box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    }
}

.badge-bold.badge-featured {
    animation: badge-pulse 2s ease-in-out infinite;
}

/* ===== BADGE STATUS INDICATORS ===== */
.badge-status {
    position: absolute;
    top: var(--space-md, 1rem);
    right: var(--space-md, 1rem);
    padding: 4px 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 4px;
    z-index: 4;
}

.badge-status-live {
    background: #ef4444;
    color: white;
    animation: badge-pulse 1s ease-in-out infinite;
}

.badge-status-upcoming {
    background: #f59e0b;
    color: white;
}

.badge-status-completed {
    background: rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.8);
}

/* ===== SKELETON LOADING STATE ===== */
.badge-skeleton {
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

@keyframes skeleton-loading {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.badge-skeleton .badge-logo-container,
.badge-skeleton .badge-info {
    visibility: hidden;
}
