/* =========================================
   COMPONENTS.CSS - Reusable UI Components
   Shared across all pages
   ========================================= */

/* =========================================
   CONTAINER
   ========================================= */
.container {
    width: 100%;
    max-width: 75rem;
    /* 1200px / 16 */
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    position: relative;
    z-index: 1;
    padding: var(--space-1) var(--space-2) var(--space-2);
}

/* Home Button */
.home-btn {
    position: fixed;
    top: 1rem;
    right: 1rem;
    color: var(--text-muted);
    font-size: 1.25rem;
    text-decoration: none;
    padding: var(--space-1);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    z-index: 100;
}

.home-btn:hover {
    color: var(--primary-color);
    background: color-mix(in srgb, var(--primary-color), transparent 90%);
}

/* Disclaimer */
.disclaimer {
    font-size: var(--text-sm);
    color: var(--text-muted);
    text-align: center;
    margin-top: var(--space-3);
    font-weight: 400;
    opacity: 0.7;
}

/* =========================================
   LOGO
   ========================================= */
.logo {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--space-1) var(--space-2);
    font-family: var(--font-heading);
    font-size: var(--text-5xl);
    letter-spacing: 2px;
    margin-bottom: var(--space-4);
    color: var(--text-color);
    text-transform: uppercase;
    line-height: 1.1;
}

.logo i {
    color: var(--primary-color);
    font-size: var(--text-5xl);
    filter: drop-shadow(0 0 10px color-mix(in srgb, var(--primary-color), transparent 60%));
}

/* =========================================
   CARDS - Search Card
   ========================================= */
.search-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-2) var(--space-3);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 34.375rem;
    /* 550px / 16 */
    margin: 0 auto;
    position: relative;
}

.search-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
    pointer-events: none;
    border-radius: var(--radius-lg);
}

/* =========================================
   FORM ELEMENTS
   ========================================= */
.input-row {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.input-group {
    flex: 1;
}

/* Autocomplete wrapper for ghost suggestion */
.autocomplete-wrapper {
    position: relative;
    width: 100%;
}

.autocomplete-wrapper input {
    position: relative;
    z-index: 2;
    background: transparent;
}

.ghost-suggestion {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: var(--space-2);
    font-family: var(--font-body);
    font-size: var(--text-base);
    color: rgba(255, 255, 255, 0.7);
    pointer-events: none;
    z-index: 1;
    display: flex;
    align-items: center;
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tab-hint {
    position: absolute;
    right: var(--space-2);
    top: 50%;
    transform: translateY(-50%);
    font-size: var(--text-xs);
    color: rgba(255, 255, 255, 0.8);
    background: color-mix(in srgb, var(--primary-color), transparent 70%);
    padding: 4px 8px;
    border-radius: 4px;
    pointer-events: none;
    z-index: 3;
}

.input-group label {
    display: block;
    margin-bottom: var(--space-1);
    color: var(--text-muted);
    font-size: var(--text-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: var(--font-body);
}

input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: var(--space-2);
    color: var(--text-color);
    font-family: var(--font-body);
    font-size: var(--text-base);
    transition: all 0.3s ease;
    width: 100%;
}

input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary-color), transparent 80%), 0 0 15px color-mix(in srgb, var(--primary-color), transparent 80%);
    background: rgba(0, 0, 0, 0.6);
}

input:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Select */
select {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    padding: var(--space-1) var(--space-4) var(--space-1) var(--space-2);
    appearance: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    cursor: pointer;
    font-size: var(--text-sm);
}

select:focus {
    outline: none;
    border-color: var(--primary-color);
}

select option {
    background: #1a1a1a;
    color: var(--text-color);
}

.select-wrapper {
    position: relative;
    flex: 1;
}

.select-wrapper i {
    position: absolute;
    right: var(--space-2);
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
    pointer-events: none;
    font-size: var(--text-sm);
}

/* =========================================
   BUTTONS
   ========================================= */
.primary-btn {
    width: 100%;
    padding: var(--space-2);
    background-color: var(--primary-color);
    background-image: var(--primary-gradient);
    color: #000;
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--text-lg);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 20px color-mix(in srgb, var(--primary-color), transparent 80%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    text-transform: uppercase;
    font-family: var(--font-heading);
    letter-spacing: 1px;
}

.primary-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 30px color-mix(in srgb, var(--primary-color), transparent 60%);
}

.primary-btn:active {
    transform: translateY(0) scale(0.98);
}

.primary-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.primary-btn i {
    transition: transform 0.5s ease;
}

.primary-btn:hover i {
    transform: rotate(360deg);
}

/* Ticket Button (Secondary) */
.ticket-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--team-color, var(--primary-color));
    color: var(--text-color);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-family: var(--font-heading);
    font-size: var(--text-lg);
    letter-spacing: 1px;
    transition: all 0.3s ease;
    margin-top: var(--space-2);
    width: 100%;
}

.ticket-btn:hover {
    background: var(--team-color, var(--primary-color));
    color: #000;
    box-shadow: 0 0 15px var(--team-color, var(--primary-color));
}

/* =========================================
   SORT CONTROLS
   ========================================= */
.sort-controls {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
    background: rgba(255, 255, 255, 0.05);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-left: auto;
    width: fit-content;
    backdrop-filter: blur(10px);
}

.sort-controls label {
    font-family: var(--font-heading);
    color: var(--text-muted);
    font-size: var(--text-base);
    letter-spacing: 1px;
}

/* =========================================
   TEAM DROPDOWN
   ========================================= */
.team-dropdown {
    position: absolute;
    left: calc(100% + 1rem);
    top: 0;
    width: 20rem;
    /* 320px / 16 */
    background: rgba(20, 20, 25, 0.98);
    border: 1px solid var(--primary-color);
    border-radius: var(--radius-md);
    max-height: 25rem;
    /* 400px / 16 */
    overflow-y: auto;
    backdrop-filter: blur(16px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    scrollbar-width: none;
    -ms-overflow-style: none;
    z-index: 100;
}

.team-dropdown::-webkit-scrollbar {
    display: none;
}

.team-dropdown-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: var(--space-1.5) var(--space-2);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-color);
    font-size: var(--text-base);
}

.dropdown-team-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.team-dropdown-item:hover {
    background: color-mix(in srgb, var(--primary-color), transparent 90%);
    color: var(--primary-color);
}

.team-dropdown-item:hover .dropdown-team-logo {
    transform: scale(1.1);
    filter: drop-shadow(0 0 8px var(--primary-color)) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

.team-dropdown-item.selected {
    background: color-mix(in srgb, var(--primary-color), transparent 80%);
    color: var(--primary-color);
}

/* =========================================
   EVENT CARDS
   ========================================= */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-3);
    padding-bottom: var(--space-6);
}

.event-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    position: relative;
    display: flex;
    flex-direction: column;
}

.event-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 20px var(--team-color, var(--primary-color));
    border-color: rgba(255, 255, 255, 0.2);
}

.event-card:active {
    transform: scale(0.98);
    opacity: 0.95;
}

.event-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--team-color, var(--primary-color));
    box-shadow: 0 2px 10px var(--team-color, var(--primary-color));
}

.event-details {
    padding: var(--space-6) var(--space-3) var(--space-2) var(--space-3);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.price-drop-badge {
    position: absolute;
    top: var(--space-1);
    right: var(--space-1);
    background: linear-gradient(135deg, #0cebeb 0%, #20e3b2 50%, #29ffc6 100%);
    color: #000;
    padding: var(--space-0.5) var(--space-2);
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-size: var(--text-sm);
    font-weight: 700;
    letter-spacing: 1px;
    transform: rotate(2deg);
    box-shadow: 0 4px 15px rgba(32, 227, 178, 0.4);
    z-index: 10;
    animation: drop-pulse 2s infinite ease-in-out;
}

@keyframes drop-pulse {

    0%,
    100% {
        transform: rotate(2deg) scale(1);
        box-shadow: 0 4px 15px rgba(32, 227, 178, 0.4);
    }

    50% {
        transform: rotate(2deg) scale(1.05);
        box-shadow: 0 8px 25px rgba(32, 227, 178, 0.6);
    }
}


.event-date {
    color: var(--team-color, var(--primary-color));
    font-family: var(--font-heading);
    font-size: var(--text-lg);
    letter-spacing: 1.5px;
    margin-bottom: var(--space-1);
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.event-name {
    font-family: var(--font-body);
    font-size: var(--text-xl);
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: var(--space-2);
    color: var(--text-color);
    letter-spacing: 0;
}

.event-venue {
    color: var(--text-muted);
    font-size: var(--text-lg);
    margin-bottom: var(--space-3);
    display: flex;
    align-items: center;
    gap: var(--space-1);
    font-weight: 300;
}

.event-venue i {
    color: var(--team-color, var(--primary-color));
}

/* =========================================
   PRICING
   ========================================= */
.price-container {
    margin-top: auto;
    background: rgba(0, 0, 0, 0.2);
    margin: var(--space-1) calc(var(--space-3) * -1) 0 calc(var(--space-3) * -1);
    padding: var(--space-2) var(--space-3);
    border-top: 1px solid var(--border-color);
}

.price-with-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
}

.team-logo {
    width: 6.5rem;
    height: 6.5rem;
    object-fit: contain;
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0.25rem;
    /* Unified depth and presence */
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}

.team-logo:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.4));
}

.team-logo-placeholder,
.team-logo-fallback {
    width: 6.5rem;
    height: 6.5rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    /* Concrete fallback background */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--text-color);
    /* Bright text for initials */
    text-align: center;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.price-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
}

.price-center .price-label,
.price-center .price-sublabel {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.price-center .price-value {
    font-family: var(--font-heading);
    font-size: var(--text-3xl);
    color: var(--price-color);
    line-height: 1;
}

.price-disclaimer {
    display: block;
    font-size: var(--text-xs);
    color: #666;
    margin-top: var(--space-1);
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price-label {
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 0.25rem;
}

.price-value {
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
    color: var(--price-color);
    line-height: 1;
    text-shadow: 0 0 15px rgba(76, 217, 100, 0.2);
}

.price-value-total {
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
    font-weight: 400;
    color: #ff4444;
    line-height: 1;
    text-shadow: 0 0 15px rgba(255, 68, 68, 0.2);
}

/* =========================================
   BADGES
   ========================================= */
.cheapest-badge {
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #000;
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-size: var(--text-base);
    font-weight: 700;
    letter-spacing: 1px;
    transform: rotate(3deg);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
    z-index: 2;
    animation: badge-pulse 2s infinite ease-in-out;
}

@keyframes badge-pulse {

    0%,
    100% {
        transform: rotate(3deg) scale(1);
    }

    50% {
        transform: rotate(3deg) scale(1.05);
    }
}

/* =========================================
   ERROR MESSAGE
   ========================================= */
.error-msg {
    color: var(--error-color);
    background: rgba(255, 77, 77, 0.1);
    padding: var(--space-2);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 77, 77, 0.2);
    text-align: center;
    margin-top: var(--space-2);
    font-weight: 500;
}

/* =========================================
   EMPTY STATE
   ========================================= */
.empty-state {
    text-align: center;
    padding: var(--space-8) var(--space-4);
    max-width: 400px;
    margin: 0 auto;
}

.empty-state-icon {
    font-size: var(--text-5xl);
    opacity: 0.3;
    margin-bottom: var(--space-3);
}

.empty-state h3 {
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
    color: var(--text-color);
    margin-bottom: var(--space-2);
    letter-spacing: 1px;
}

.empty-state p {
    color: var(--text-muted);
    font-size: var(--text-base);
    margin-bottom: var(--space-4);
    line-height: 1.6;
}

.empty-state .primary-btn {
    width: auto;
    display: inline-flex;
    padding: var(--space-2) var(--space-4);
}

/* =========================================
   SKELETON LOADER
   ========================================= */
.skeleton-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: var(--space-4);
}

.loading-status {
    grid-column: 1 / -1;
    text-align: center;
    margin-bottom: var(--space-3);
    color: var(--primary-color);
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    letter-spacing: 2px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    animation: loading-pulse 2s infinite ease-in-out;
}

@keyframes loading-pulse {

    0%,
    100% {
        opacity: 0.7;
        transform: translateY(0);
    }

    50% {
        opacity: 1;
        transform: translateY(-2px);
    }
}

.skeleton-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    position: relative;
    overflow: hidden;
}

.skeleton-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: color-mix(in srgb, var(--primary-color, #ff6b00), transparent 70%);
}

.skeleton-line {
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    position: relative;
    overflow: hidden;
}

.skeleton-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.08) 50%,
            transparent 100%);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.skeleton-date {
    width: 40%;
    height: var(--space-2);
    margin-bottom: var(--space-1);
}

/* =========================================
   ANIMATIONS & POLISH
   ========================================= */

@keyframes fadeSlideUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    opacity: 0;
    animation: fadeSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Enhanced Empty State Animation */
@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

.empty-state-icon {
    animation: float 4s ease-in-out infinite;
}

/* =========================================
   MOBILE RESPONSIVENESS
   ========================================= */
@media (max-width: 768px) {
    .container {
        padding: var(--space-1) var(--space-1) var(--space-4);
    }

    /* Improve Home Button Touch Target */
    .home-btn {
        top: 0.5rem;
        right: 0.5rem;
        padding: 0.75rem;
        background: rgba(0, 0, 0, 0.2);
        backdrop-filter: blur(4px);
    }

    .logo {
        font-size: var(--text-4xl);
        margin-top: var(--space-4);
    }

    .search-card {
        padding: var(--space-2);
    }

    .event-name {
        font-size: 1.25rem;
    }

    .event-details {
        padding: var(--space-4) var(--space-2) var(--space-2);
    }

    .team-logo {
        width: 4.5rem;
        height: 4.5rem;
    }

    .price-center .price-value {
        font-size: 2rem;
    }

    /* Stack filter controls on mobile */
    .filter-group {
        flex-direction: column;
        width: 100%;
    }

    .select-wrapper {
        width: 100%;
    }
}

.skeleton-title {
    width: 80%;
    height: var(--space-3);
    margin-bottom: var(--space-1);
}

.skeleton-title-2 {
    width: 60%;
    height: var(--space-3);
    margin-bottom: var(--space-2);
}

.skeleton-venue {
    width: 50%;
    height: var(--space-2);
    margin-bottom: var(--space-4);
}

.skeleton-price-container {
    background: rgba(0, 0, 0, 0.2);
    margin: var(--space-2) calc(var(--space-4) * -1) 0 calc(var(--space-4) * -1);
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.skeleton-price {
    width: 30%;
    height: var(--space-4);
    margin: 0 auto var(--space-2);
}

.skeleton-button {
    width: 100%;
    height: 2.75rem;
    /* 44px / 16 */
    margin-top: var(--space-2);
}

/* All-Star Page Overrides */
.all-star-page main {
    padding-bottom: var(--space-8);
}

/* =========================================
   FILTER CHIPS
   ========================================= */
.filter-chips-container {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-heading);
    letter-spacing: 1px;
}

.filter-chip:hover {
    background: rgba(255, 107, 0, 0.1);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.filter-chip.active {
    background: var(--primary-color);
    color: #000;
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(255, 107, 0, 0.3);
}

/* Moved down by user request */
.sort-controls {
    margin-top: 2rem;
}

/* Dynamic Theme Overrides */
.tab-hint {
    background: color-mix(in srgb, var(--primary-color), transparent 70%);
}

.team-dropdown-item:hover {
    background: color-mix(in srgb, var(--primary-color), transparent 90%);
    color: var(--primary-color);
}

.team-dropdown-item.selected {
    background: color-mix(in srgb, var(--primary-color), transparent 80%);
    color: var(--primary-color);
}

.sort-controls i {
    color: var(--primary-color);
}