* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colores oficiales Basalto Rules */
    --basalto-aqua: #87C5D0;
    --basalto-dark: #152129;
    --basalto-white: #ffffff;

    /* Paleta de la aplicación basada en identidad de marca */
    --bg-primary: #152129;
    --bg-secondary: #1a2a34;
    --bg-card: #1f3340;
    --bg-card-hover: #253d4d;
    --text-primary: #ffffff;
    --text-secondary: #87C5D0;
    --accent: #87C5D0;
    --accent-secondary: #6ab3be;
    --accent-muted: #5a9aa3;
    --border: #2a4653;
    --border-light: #335260;
    --shadow: rgba(21, 33, 41, 0.6);
    --empty-lane: #1a2a34;
}

body {
    font-family: 'Helvetica Neue', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    font-weight: 300;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header - Minimalista */
header {
    text-align: center;
    padding: 30px 20px 20px;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--border);
}

header h1 {
    font-family: 'Helvetica Neue', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    color: var(--text-primary);
    text-transform: uppercase;
}

.subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.last-update {
    margin-top: 8px;
    font-size: 0.7rem;
    color: var(--accent-muted);
    font-style: italic;
}

/* Search Section */
.search-section {
    margin-bottom: 24px;
}

#teamSearch {
    width: 100%;
    padding: 16px 20px;
    font-size: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    outline: none;
    transition: all 0.3s ease;
}

#teamSearch::placeholder {
    color: var(--text-secondary);
}

#teamSearch:focus {
    border-color: var(--accent-muted);
    background: var(--bg-card-hover);
}

/* Filter Section - Dropdown */
.filter-section {
    margin-bottom: 30px;
    position: relative;
}

.filter-dropdown {
    width: 100%;
    padding: 14px 40px 14px 16px;
    font-size: 0.95rem;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    font-weight: 500;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

.filter-dropdown:hover {
    border-color: var(--accent-muted);
    background-color: var(--bg-card-hover);
}

.filter-dropdown:focus {
    border-color: var(--accent-secondary);
}

.filter-dropdown option {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 10px;
}

/* Schedule Container */
.schedule-container {
    flex: 1;
}

.category-section {
    margin-bottom: 40px;
}

.category-header {
    margin-bottom: 20px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

.category-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.2px;
    color: var(--text-primary);
}

/* Heat Cards */
.heat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
}


.heat-header {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.heat-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Time Details */
.time-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 10px;
    border: 1px solid var(--border-light);
}

.time-item {
    text-align: center;
}

.time-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 4px;
}

.time-value {
    font-size: 1.125rem;
    color: var(--text-primary);
    font-weight: 700;
}

/* Teams List */
.teams-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.team-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    transition: all 0.2s ease;
    border: 1px solid var(--border-light);
}

.team-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-muted);
}

.team-item.highlight {
    background: var(--accent);
    color: var(--bg-primary);
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(135, 197, 208, 0.4);
    border-color: var(--accent);
}

.team-item.empty {
    background: var(--empty-lane);
    border: 1px dashed var(--border);
    opacity: 0.5;
}

.lane-number {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--accent-muted);
    min-width: 60px;
    margin-right: 12px;
}

.team-item.highlight .lane-number {
    color: var(--bg-primary);
}

.team-item.empty .lane-number {
    color: var(--accent-muted);
}

.team-name {
    font-size: 1rem;
    font-weight: 600;
}

.team-item.empty .team-name {
    color: var(--text-secondary);
    font-style: italic;
    font-weight: 400;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.no-results p {
    font-size: 1.125rem;
    margin-bottom: 8px;
}

/* Hidden */
.hidden {
    display: none;
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 32px;
    padding: 4px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.nav-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-tab:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.nav-tab.active {
    background: var(--accent);
    color: var(--basalto-dark);
    box-shadow: 0 4px 12px rgba(135, 197, 208, 0.3);
}

.tab-icon {
    font-size: 1.25rem;
}

.tab-text {
    display: inline;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* Leaderboard Section */
.leaderboard-container {
    width: 100%;
    height: calc(100vh - 300px);
    min-height: 600px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
    position: relative;
}

.leaderboard-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.leaderboard-fallback {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    padding: 16px 24px;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.leaderboard-fallback p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 12px;
}

.leaderboard-link {
    display: inline-block;
    padding: 10px 20px;
    background: var(--accent);
    color: var(--basalto-dark);
    text-decoration: none;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.leaderboard-link:hover {
    background: var(--accent-secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(135, 197, 208, 0.4);
}

/* Footer */
footer {
    text-align: center;
    padding: 30px 20px;
    margin-top: 40px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    border-top: 1px solid var(--border);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 12px;
    }

    header {
        padding: 24px 16px 16px;
        margin-bottom: 30px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .nav-tabs {
        gap: 6px;
        padding: 3px;
    }

    .nav-tab {
        padding: 12px 16px;
        font-size: 0.9rem;
    }

    .tab-icon {
        font-size: 1.1rem;
    }

    .tab-text {
        display: none;
    }

    .leaderboard-container {
        height: calc(100vh - 150px);
        min-height: 700px;
    }

    .time-details {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        padding: 12px;
    }

    .time-label {
        font-size: 0.65rem;
    }

    .time-value {
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.25rem;
    }

    .subtitle {
        font-size: 0.8rem;
    }

    .heat-card {
        padding: 16px;
    }

    .time-details {
        grid-template-columns: 1fr;
    }

    .team-item {
        padding: 10px 12px;
    }

    .team-name {
        font-size: 0.875rem;
    }
}
