/* ================================================ */
/*  SCHEDULE PAGE - WHITE LABEL THEME AWARE        */
/*  Uses CSS variables from theme-system.css       */
/* ================================================ */

/* ================================================ */
/*  SCHEDULE PAGE STYLES - Padel and Go Tournament */
/*  Follows home page design with glow effects     */
/* ================================================ */

main {
    overflow: visible !important;
}

/* ===== HERO SECTION WITH ENHANCED GRADIENT ===== */
.hero-schedule {
    position: relative;
    background: var(--bg-primary);
    overflow: visible;
    padding: 8rem 0 4rem;
    min-height: 40vh;
    display: flex;
    align-items: center;
}

/* Top-left glow - matching teams page */
.hero-schedule::before {
    content: "";
    position: absolute;
    top: -20%;
    left: -15%;
    width: 60%;
    height: 80%;
    background: radial-gradient(
        circle at center,
        color-mix(in srgb, var(--accent-secondary), 0.15) 0%,
        rgba(255, 217, 0, 0.08) 30%,
        transparent 70%
    );
    pointer-events: none;
    z-index: 1;
    animation: pulse-glow 8s ease-in-out infinite;
    filter: blur(60px);
}

/* Bottom-right subtle glow */
.hero-schedule::after {
    content: "";
    position: absolute;
    bottom: -20%;
    right: -15%;
    width: 50%;
    height: 60%;
    background: radial-gradient(
        circle at center,
        color-mix(in srgb, var(--accent-primary), 0.1) 0%,
        color-mix(in srgb, var(--accent-primary), 0.05) 30%,
        transparent 70%
    );
    pointer-events: none;
    z-index: 1;
    animation: pulse-glow 8s ease-in-out infinite 4s;
    filter: blur(60px);
}

.hero-schedule > * {
    position: relative;
    z-index: 3;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

/* ===== SEARCH AND FILTERS ===== */
.search-wrapper {
    max-width: 600px;
    margin: 0 auto 1.5rem;
}

.search-container {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    background: color-mix(in srgb, var(--bg-secondary) 80%, transparent);
    border: 1px solid var(--border-primary);
    border-radius: 9999px;
    color: var(--text-primary);
    font-size: 0.9375rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-secondary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-secondary), 0.1), 0 0 30px color-mix(in srgb, var(--accent-secondary), 0.2);
    background: color-mix(in srgb, var(--bg-secondary) 90%, transparent);
}

.search-input::placeholder {
    color: var(--text-tertiary);
}

/* Category/Filter Buttons */
.filter-btn, .phase-btn, .view-toggle {
    background: color-mix(in srgb, var(--bg-secondary) 80%, transparent);
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-btn:hover, .phase-btn:hover, .view-toggle:hover {
    background: color-mix(in srgb, var(--bg-secondary) 90%, transparent);
    border-color: var(--accent-secondary);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.filter-btn.active, .phase-btn.active, .view-toggle.active-view {
    background: transparent;
    border-color: var(--accent-secondary);
    color: var(--accent-secondary);
    box-shadow: 0 0 15px color-mix(in srgb, var(--accent-secondary), 0.3);
}

/* ===== MATCH CARDS - LIST VIEW WITH GRADIENT STYLE ===== */
.match-card {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid color-mix(in srgb, var(--text-primary) 10%, transparent);
    border-radius: 1rem;
    padding: 1.25rem;
    overflow: visible;
    transition: all 0.3s ease;
}

/* Gradient overlay - orange theme for schedule */
.match-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent-secondary), 0.15) 0%, rgba(255, 217, 0, 0.08) 100%);
    opacity: 0.6;
    pointer-events: none;
    z-index: 1;
    border-radius: inherit;
    transition: opacity 0.3s ease;
}

.match-card:hover::after {
    opacity: 0.8;
}

/* Dot pattern */
.match-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 2px 2px, color-mix(in srgb, var(--text-primary) 5%, transparent) 1px, transparent 0);
    background-size: 20px 20px;
    pointer-events: none;
    z-index: 2;
    border-radius: inherit;
}

/* Glow behind card */
.match-card {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent-secondary), 0);
}

.match-card:hover {
    background: var(--bg-secondary);
    border-color: color-mix(in srgb, var(--accent-secondary), 0.4);
    transform: translateY(-2px);
    box-shadow: 0 0 30px color-mix(in srgb, var(--accent-secondary), 0.2), 0 4px 20px rgba(0, 0, 0, 0.3);
}

.match-card > * {
    position: relative;
    z-index: 3;
}

/* Match Card Header */
.match-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
    gap: 1rem;
}

.match-card-court-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.court-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 15px color-mix(in srgb, var(--accent-secondary), 0.3);
}

.court-icon i {
    color: var(--bg-primary);
    font-size: 0.875rem;
}

.court-name {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.9375rem;
}

/* Match Badges */
.match-card-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.group-badge, .list-group-badge {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.375rem 0.875rem;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
}

.phase-badge, .list-phase-badge {
    padding: 0.375rem 0.875rem;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
}

.phase-badge.finals, .list-phase-badge.finals {
    background: color-mix(in srgb, var(--accent-primary) 15%, transparent);
    color: var(--accent-primary);
    border: 1px solid color-mix(in srgb, var(--accent-primary) 30%, transparent);
}

.phase-badge.semifinals, .list-phase-badge.semifinals {
    background: color-mix(in srgb, var(--accent-secondary) 15%, transparent);
    color: var(--accent-secondary);
    border: 1px solid color-mix(in srgb, var(--accent-secondary) 30%, transparent);
}

.phase-badge.quarterfinals, .list-phase-badge.quarterfinals {
    background: color-mix(in srgb, var(--accent-primary) 10%, transparent);
    color: var(--accent-primary);
    border: 1px solid color-mix(in srgb, var(--accent-primary) 20%, transparent);
}

/* Match Players */
.match-player-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
}

.match-player-names, .match-player-names-text {
    flex: 1;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

.score-display, .list-score-display {
    background: color-mix(in srgb, var(--bg-secondary) 80%, transparent);
    border: 1px solid var(--border-primary);
    border-radius: 0.5rem;
    padding: 0.5rem 0.875rem;
    font-family: 'Monaco', 'Menlo', monospace;
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.9375rem;
    min-width: 50px;
    text-align: center;
}

/* VS Divider */
.match-vs-divider, .vs-divider {
    display: flex;
    align-items: center;
    margin: 0.75rem 0;
}

.match-vs-divider::before,
.match-vs-divider::after,
.vs-divider::before,
.vs-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-primary);
}

.match-vs-text, .vs-text {
    color: var(--text-tertiary);
    font-size: 0.75rem;
    font-weight: 700;
    margin: 0 0.75rem;
}

/* ===== TABLE VIEW WITH GRADIENT STYLE ===== */
.schedule-table {
    background: linear-gradient(145deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    border: 1px solid color-mix(in srgb, var(--text-primary) 10%, transparent);
    border-radius: 1rem;
    overflow: hidden;
    position: relative;
    margin-bottom: 2rem;
}

/* Glow behind table */
.schedule-table::before {
    content: "";
    position: absolute;
    inset: -15px;
    background: radial-gradient(
        circle at center,
        color-mix(in srgb, var(--accent-secondary), 0.08) 0%,
        color-mix(in srgb, var(--accent-secondary), 0.04) 40%,
        transparent 70%
    );
    z-index: -1;
    opacity: 0.6;
    filter: blur(30px);
    pointer-events: none;
    border-radius: inherit;
}

/* Dot pattern for table */
.schedule-table::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 2px 2px, color-mix(in srgb, var(--text-primary) 5%, transparent) 1px, transparent 0);
    background-size: 20px 20px;
    opacity: 0.8;
    pointer-events: none;
    z-index: 1;
    border-radius: inherit;
}

.schedule-table > * {
    position: relative;
    z-index: 2;
}

.time-slot-header {
    background: color-mix(in srgb, var(--accent-secondary), 0.1);
    border-bottom: 1px solid color-mix(in srgb, var(--accent-secondary), 0.2);
    color: var(--text-primary);
    font-weight: 700;
    font-size: 0.9375rem;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.time-slot-header i {
    color: var(--accent-secondary);
}

.schedule-table table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.schedule-table th {
    background: color-mix(in srgb, var(--bg-secondary) 80%, transparent);
    color: var(--text-primary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid color-mix(in srgb, var(--text-primary) 10%, transparent);
    border-right: 1px solid color-mix(in srgb, var(--text-primary) 5%, transparent);
    text-align: center;
    font-size: 0.875rem;
}

.schedule-table th:last-child {
    border-right: none;
}

.schedule-table td {
    border-right: 1px solid color-mix(in srgb, var(--text-primary) 5%, transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--text-primary) 10%, transparent);
    padding: 0.5rem 0.25rem;
    vertical-align: top;
}

.schedule-table td:last-child {
    border-right: none;
}

/* ===== COMPACT TABLE MATCH CARDS WITH GRADIENT ===== */
.table-match-card {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid color-mix(in srgb, var(--text-primary) 10%, transparent);
    border-radius: 0.5rem;
    padding: 0.5rem;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: visible;
    transition: all 0.3s ease;
}

/* Gradient overlay - orange theme */
.table-match-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent-secondary), 0.12) 0%, rgba(255, 217, 0, 0.06) 100%);
    opacity: 0.6;
    pointer-events: none;
    z-index: 1;
    border-radius: inherit;
    transition: opacity 0.3s ease;
}

.table-match-card:hover::after {
    opacity: 0.8;
}

/* Dot pattern */
.table-match-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 2px 2px, color-mix(in srgb, var(--text-primary) 5%, transparent) 1px, transparent 0);
    background-size: 15px 15px;
    pointer-events: none;
    z-index: 2;
    border-radius: inherit;
}

.table-match-card:hover {
    border-color: color-mix(in srgb, var(--accent-secondary), 0.4);
    background: var(--bg-secondary);
    box-shadow: 0 0 20px color-mix(in srgb, var(--accent-secondary), 0.2);
}

.table-match-card > * {
    position: relative;
    z-index: 3;
}

.table-match-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
    gap: 0.25rem;
}

.table-group-badge {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 0.625rem;
    font-weight: 600;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table-phase-badge {
    font-size: 0.5rem;
    font-weight: 700;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    min-width: 12px;
    text-align: center;
}

.table-phase-badge.finals {
    background: color-mix(in srgb, var(--accent-primary) 15%, transparent);
    color: var(--accent-primary);
}

.table-phase-badge.semifinals {
    background: color-mix(in srgb, var(--accent-secondary) 15%, transparent);
    color: var(--accent-secondary);
}

.table-phase-badge.quarterfinals {
    background: color-mix(in srgb, var(--accent-primary) 10%, transparent);
    color: var(--accent-primary);
}

.table-match-player {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
    gap: 0.25rem;
}

.table-player-name {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
    flex: 1;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.table-score-display {
    background: color-mix(in srgb, var(--bg-secondary) 90%, transparent);
    border: 1px solid var(--border-primary);
    border-radius: 0.25rem;
    padding: 0.125rem 0.25rem;
    font-family: 'Monaco', 'Menlo', monospace;
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.6rem;
    min-width: 35px;
    text-align: center;
    white-space: nowrap;
    flex-shrink: 0;
}

.table-vs-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0.25rem 0;
}

.table-vs-divider::before,
.table-vs-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-primary);
}

.table-vs-text {
    color: var(--text-tertiary);
    font-size: 0.625rem;
    font-weight: 700;
    margin: 0 0.5rem;
}

.table-empty-cell {
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.75rem;
    padding: 1rem 0.5rem;
}

/* ===== DATE GROUP HEADERS ===== */
.date-group h3 {
    color: var(--text-primary);
    font-weight: 900;
    margin-bottom: 2rem;
    position: relative;
    padding-left: 1rem;
}

.date-group h3::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

/* ===== TIME SLOTS ===== */
.time-slot {
    margin-bottom: 2rem;
}

.time-slot h4 {
    color: var(--text-primary);
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.time-slot h4 i {
    color: var(--accent-secondary);
}

/* ===== EMPTY STATES ===== */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-icon, .no-matches-icon, .search-icon {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 30px color-mix(in srgb, var(--accent-secondary), 0.3);
    animation: float 3s ease-in-out infinite;
}

.empty-icon i, .no-matches-icon i, .search-icon i {
    color: var(--bg-primary);
    font-size: 2rem;
}

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

.empty-state h3 {
    color: var(--text-primary);
}

.empty-state p {
    color: var(--text-secondary);
}

/* ===== INFO BOXES ===== */
.info-box, .section-header-card {
    background: linear-gradient(145deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    border: 1px solid color-mix(in srgb, var(--text-primary) 10%, transparent);
    border-radius: 1.5rem;
    padding: 1.5rem;
    position: relative;
    overflow: visible;
}

/* Glow behind info box */
.info-box::before, .section-header-card::before {
    content: "";
    position: absolute;
    inset: -15px;
    background: radial-gradient(
        circle at center,
        color-mix(in srgb, var(--accent-primary), 0.06) 0%,
        color-mix(in srgb, var(--accent-secondary), 0.04) 40%,
        transparent 70%
    );
    z-index: -1;
    opacity: 0.6;
    filter: blur(30px);
    pointer-events: none;
    border-radius: inherit;
}

/* Dot pattern */
.info-box::after, .section-header-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 2px 2px, color-mix(in srgb, var(--text-primary) 5%, transparent) 1px, transparent 0);
    background-size: 20px 20px;
    opacity: 0.8;
    pointer-events: none;
    z-index: 1;
    border-radius: inherit;
}

.info-box > *, .section-header-card > * {
    position: relative;
    z-index: 2;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .hero-schedule {
        padding: 6rem 0 3rem;
        min-height: 50vh;
    }
    
    .match-card {
        padding: 1rem;
    }
    
    .match-card-header {
        flex-wrap: wrap;
    }
    
    .match-card-court-info {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .match-card-badges {
        width: 100%;
    }
    
    .match-player-names, .match-player-names-text {
        font-size: 0.9rem;
    }
    
    .score-display, .list-score-display {
        font-size: 0.875rem;
        padding: 0.375rem 0.75rem;
    }
    
    /* Reduce glow intensity on mobile */
    .hero-schedule::before,
    .hero-schedule::after {
        opacity: 0.5;
    }
    
    .match-card::after,
    .table-match-card::after {
        opacity: 0.4;
    }
}

@media (max-width: 1200px) {
    .table-player-name {
        font-size: 0.68rem;
    }
    
    .table-score-display {
        font-size: 0.58rem;
        min-width: 32px;
    }
}

/* ===== UTILITIES ===== */
.page-transition {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.page-transition.loaded {
    opacity: 1;
    transform: translateY(0);
}

.mobile-clickable {
    position: relative;
    z-index: 10;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.no-select {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* ===== LOADING ANIMATIONS ===== */
.floating-card-grid {
    animation: fadeIn 0.5s ease-out;
}

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

/* ===== PRINT STYLES ===== */
@media print {
    .hero-schedule::before,
    .hero-schedule::after,
    .search-wrapper,
    .filter-btn,
    .phase-btn,
    .view-toggle,
    .info-box::before,
    .section-header-card::before,
    .match-card::before,
    .match-card::after,
    .table-match-card::before,
    .table-match-card::after {
        display: none;
    }
    
    .match-card,
    .table-match-card {
        break-inside: avoid;
    }
}