/* ============================================
   RESULTADOS.CSS
   Estilos para la página de Resultados
   ============================================ */

.results-section {
    padding: var(--space-3xl) 0;
    min-height: calc(100vh - 200px);
    position: relative;
    z-index: 1;
}

.page-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.page-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 20px;
    color: #60a5fa;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--space-md);
}

.page-title {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: var(--space-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.title-line {
    color: var(--color-text);
}

.title-highlight {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    color: var(--color-text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Filters - Modern Design */
.results-filters {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(139, 92, 246, 0.08));
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 16px;
    padding: var(--space-xl);
    margin-bottom: var(--space-2xl);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.filters-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
}

.filters-header svg {
    color: #60a5fa;
    width: 24px;
    height: 24px;
}

.filters-header h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0;
    letter-spacing: 0.5px;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-lg);
}

.filter-group {
    position: relative;
}

.filter-group label {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    color: var(--color-text);
    font-weight: 600;
    margin-bottom: var(--space-sm);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group label svg {
    color: #60a5fa;
    width: 16px;
    height: 16px;
}

.filter-group select {
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    background: rgba(5, 5, 8, 0.8);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 4L6 8L10 4' stroke='%2360a5fa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 3rem;
    backdrop-filter: blur(10px);
}

.filter-group select option {
    background: rgba(5, 5, 8, 0.95);
    color: var(--color-text);
    padding: var(--space-sm);
}

.filter-group select:hover {
    background-color: rgba(15, 15, 20, 0.9);
    border-color: rgba(59, 130, 246, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.filter-group select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15), 0 4px 12px rgba(59, 130, 246, 0.2);
    background-color: rgba(15, 15, 20, 0.95);
}

/* Results Container */
.results-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.result-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    transition: all 0.3s ease;
}

.result-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(59, 130, 246, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--color-border);
    flex-wrap: wrap;
    gap: var(--space-md);
}

.result-title {
    flex: 1;
}

.result-title h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: var(--space-xs);
}

.result-meta {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
    margin-top: var(--space-sm);
}

.result-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-gran-premio {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.badge-evento {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #60a5fa;
}

.badge-libres {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #86efac;
}

.badge-clasificacion {
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    color: #fde047;
}

.badge-carrera {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.result-date {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

/* Results Table */
.results-table-container {
    overflow-x: auto;
    margin-top: var(--space-lg);
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.results-table thead {
    background: rgba(255, 255, 255, 0.03);
}

.results-table th {
    padding: var(--space-md);
    text-align: left;
    color: var(--color-text);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--color-border);
}

.results-table th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background 0.2s ease;
}

.results-table th.sortable:hover {
    background: rgba(255, 255, 255, 0.05);
}

.results-table th .sort-icon {
    margin-left: 0.5rem;
    opacity: 0.3;
    font-size: 0.9rem;
    transition: opacity 0.2s ease;
}

.results-table th.sortable:hover .sort-icon {
    opacity: 0.6;
}

.results-table td {
    padding: var(--space-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--color-text);
}

.results-table tbody tr {
    transition: background 0.2s ease;
}

.results-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.position-cell {
    font-weight: 700;
    font-size: 1.1rem;
    text-align: center;
    width: 60px;
}

.position-1 {
    color: #fbbf24;
}

.position-2 {
    color: #94a3b8;
}

.position-3 {
    color: #f97316;
}

.driver-name {
    font-weight: 600;
    color: var(--color-text);
}

.driver-name.clickable:hover {
    color: #60a5fa;
    text-decoration: underline;
}

.time-cell {
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

.best-lap {
    color: #22c55e;
    font-weight: 700;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: var(--space-3xl);
    color: var(--color-text-muted);
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--space-md);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--space-3xl);
    color: var(--color-text-muted);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-md);
    opacity: 0.5;
}

/* Pilot Detail Modal - Modern Design */
.pilot-modal {
    max-width: 800px;
    background: linear-gradient(135deg, rgba(5, 5, 8, 0.98), rgba(15, 15, 20, 0.98));
    border: 1px solid rgba(59, 130, 246, 0.3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(59, 130, 246, 0.1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-xl);
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
}

.modal-header-content {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.modal-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2));
    border-radius: 12px;
    color: #60a5fa;
}

.modal-header h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0;
}

.modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
    transform: rotate(90deg);
}

.pilot-info-section {
    margin-bottom: var(--space-xl);
    padding: var(--space-xl);
    padding-bottom: var(--space-xl);
    border-bottom: 1px solid rgba(59, 130, 246, 0.1);
}

.pilot-info-header {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.pilot-avatar-placeholder {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2));
    border-radius: 20px;
    border: 2px solid rgba(59, 130, 246, 0.3);
    color: #60a5fa;
    flex-shrink: 0;
}

.pilot-info-text {
    flex: 1;
}

.pilot-info-header h4 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: var(--space-sm);
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pilot-discord-info {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--color-text-muted);
    font-size: 1rem;
}

.pilot-discord-info svg {
    width: 20px;
    height: 20px;
    color: #5865F2;
}

.pilot-discord-info.clickable-discord {
    cursor: pointer;
    transition: all 0.2s ease;
}

.pilot-discord-info.clickable-discord:hover {
    opacity: 0.8;
    transform: translateY(-1px);
}

.pilot-discord-info.clickable-discord:hover svg {
    color: #7289da;
}

.pilot-stats-section {
    margin-bottom: var(--space-xl);
    padding: var(--space-xl);
    padding-bottom: var(--space-xl);
    border-bottom: 1px solid rgba(59, 130, 246, 0.1);
}

.section-title-modern {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.section-title-modern svg {
    color: #60a5fa;
    width: 20px;
    height: 20px;
}

.pilot-stats-section h4,
.pilot-laps-section h4 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0;
    letter-spacing: 0.5px;
}

.pilot-laps-section {
    padding: var(--space-xl);
    margin-bottom: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

.stat-item.modern-stat {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(139, 92, 246, 0.08));
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 14px;
    padding: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    transition: all 0.3s ease;
}

.stat-item.modern-stat:hover {
    transform: translateY(-2px);
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.2);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(139, 92, 246, 0.12));
}

.stat-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2));
    border-radius: 12px;
    color: #60a5fa;
    flex-shrink: 0;
}

.stat-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    flex: 1;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-text);
}

.pilot-laps-section {
    margin-bottom: var(--space-lg);
}

.laps-container {
    max-height: 400px;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
}

.no-laps {
    text-align: center;
    color: var(--color-text-muted);
    padding: var(--space-lg);
    font-style: italic;
}

.lap-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s ease;
}

.lap-item:last-child {
    border-bottom: none;
}

.lap-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.lap-item.best-lap-item {
    background: rgba(34, 197, 94, 0.1);
    border-left: 3px solid #22c55e;
}

.lap-number {
    font-weight: 600;
    color: var(--color-text);
}

.lap-time {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    color: var(--color-text);
}

.lap-item.best-lap-item .lap-time {
    color: #22c55e;
}

.lap-item.invalid-lap {
    opacity: 0.6;
    background: rgba(239, 68, 68, 0.05);
}

.lap-item.invalid-lap .lap-time {
    text-decoration: line-through;
    color: #ef4444;
}

.lap-number {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lap-invalid-badge,
.lap-best-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

.lap-invalid-badge {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.lap-best-badge {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.lap-cuts {
    font-size: 0.85rem;
    color: #ef4444;
    margin-left: auto;
    margin-right: 1rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-md);
    padding: var(--space-xl);
    border-top: 1px solid rgba(59, 130, 246, 0.1);
    background: rgba(5, 5, 8, 0.5);
}

.btn-close-modal {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-md) var(--space-xl);
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-close-modal:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.3);
}

/* Footer Styles for Results Page */
.footer {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.6), rgba(5, 5, 8, 0.8));
    border-top: 1px solid rgba(59, 130, 246, 0.2);
    padding: var(--space-3xl) 0 var(--space-lg);
    margin-top: var(--space-3xl);
    position: relative;
    z-index: 1;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: var(--space-3xl);
    margin-bottom: var(--space-2xl);
}

.footer-brand {
    max-width: 400px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: 0.1em;
}

.footer-logo img {
    width: 2.5rem;
    height: 2.5rem;
}

.footer-logo span {
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-tagline {
    color: #60a5fa;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-description {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

.footer-links h4,
.footer-social h4 {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-lg);
    color: var(--color-text);
    text-transform: uppercase;
}

.footer-links nav {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.footer-links a {
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    padding: var(--space-xs) 0;
}

.footer-links a:hover {
    color: #60a5fa;
    transform: translateX(4px);
}

.social-links {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    color: var(--color-text-muted);
    transition: all 0.3s ease;
}

.social-link:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2));
    border-color: rgba(59, 130, 246, 0.4);
    color: #60a5fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--space-xl);
    border-top: 1px solid rgba(59, 130, 246, 0.1);
}

.footer-bottom p {
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .page-title {
        font-size: 2rem;
    }

    .filters-grid {
        grid-template-columns: 1fr;
    }

    .filter-group {
        min-width: 100%;
    }

    .result-header {
        flex-direction: column;
    }

    .results-table {
        font-size: 0.85rem;
    }

    .results-table th,
    .results-table td {
        padding: var(--space-sm);
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .pilot-modal {
        max-width: 95%;
    }

    .pilot-info-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }

    .footer-logo {
        font-size: 1.25rem;
    }
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-md);
    padding: var(--space-xl);
    border-top: 1px solid rgba(59, 130, 246, 0.1);
    background: rgba(5, 5, 8, 0.5);
}

.btn-close-modal {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-md) var(--space-xl);
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-close-modal:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.3);
}

