/* Reset i podstawowe style */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
}

.app-container {
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    max-width: 100vw;
}

/* Header */
.race-header {
    background: linear-gradient(90deg, #ff6b35 0%, #f7931e 100%);
    padding: 20px;
    border-radius: 0 0 20px 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(255, 107, 53, 0.3);
}

.race-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.race-title {
    font-family: 'Orbitron', monospace;
    font-size: 2rem;
    font-weight: 900;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin: 0;
}

.race-clock {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.clock-display {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px 25px;
    border-radius: 15px;
    font-family: 'Orbitron', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.race-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Disclaimer */
.disclaimer {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    margin: 0 -20px 20px -20px;
    padding: 15px 20px;
    border-bottom: 3px solid #e65100;
    box-shadow: 0 2px 10px rgba(255, 152, 0, 0.3);
}

.disclaimer-content {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    justify-content: center;
}

.disclaimer-content i {
    font-size: 1.1rem;
    color: #fff;
    flex-shrink: 0;
}

.disclaimer-content strong {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Class Filter */
.class-filter {
    margin-bottom: 30px;
}

.filter-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.filter-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.filter-btn.active {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
}

.class-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Results Container */
.results-container {
    min-height: 400px;
    margin-bottom: 200px;
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 400px;
    gap: 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left: 4px solid #ff6b35;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Class Section */
.class-section {
    margin-bottom: 40px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.class-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.class-name {
    font-family: 'Orbitron', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: #ff6b35;
}

.class-count {
    background: rgba(255, 107, 53, 0.2);
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 0.9rem;
}

/* Podium */
.podium {
    display: grid;
    grid-template-columns: 1fr 1.2fr 1.2fr;
    gap: 20px;
    margin-bottom: 30px;
    align-items: end;
}

.podium-place {
    text-align: center;
    padding: 20px;
    border-radius: 15px;
    position: relative;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.podium-place:hover {
    transform: translateY(-5px);
}

.podium-place.first {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #333;
    height: 200px;
    order: 2;
}

.podium-place.second {
    background: linear-gradient(135deg, #c0c0c0 0%, #e5e5e5 100%);
    color: #333;
    height: 170px;
    order: 1;
}

.podium-place.third {
    background: linear-gradient(135deg, #cd7f32 0%, #daa520 100%);
    color: #333;
    height: 140px;
    order: 3;
}

.podium-number {
    font-size: 3rem;
    font-weight: 900;
    font-family: 'Orbitron', monospace;
    margin-bottom: 10px;
}

.podium-racer {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.podium-laps {
    font-size: 0.9rem;
    opacity: 0.8;
}

.podium-time {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: 2px;
    word-break: break-word;
    white-space: normal;
}

/* Results Table */
.results-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.results-table th,
.results-table td {
    padding: 12px 6px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    vertical-align: middle;
}

.results-table th {
    background: rgba(255, 255, 255, 0.1);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.results-table tr {
    transition: all 0.3s ease;
}

.results-table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.position-cell {
    font-weight: 700;
    font-family: 'Orbitron', monospace;
    text-align: center;
    width: 40px;
}

.racer-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 120px;
}

.racer-name {
    font-weight: 600;
    font-size: 1.1rem;
}

.racer-details {
    font-size: 0.8rem;
    opacity: 0.7;
    display: flex;
    gap: 12px;
}

.time-cell {
    /* font-family: 'Orbitron', monospace; */
    font-family: 'Roboto', sans-serif;
    font-size: 0.9rem;
    min-width: 70px;
    text-align: center;
    font-weight: 600;
}

.laps-cell {
    text-align: center;
    font-weight: 600;
    font-size: 1.1rem;
    min-width: 50px;
}

/* Animations */
@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.slide-up {
    animation: slideUp 0.5s ease-out;
}

.slide-down {
    animation: slideDown 0.5s ease-out;
}

/* Connection Status */
.connection-status {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    padding: 10px 15px;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    z-index: 1000;
}

.connection-status.connected {
    background: rgba(76, 175, 80, 0.8);
}

.connection-status.disconnected {
    background: rgba(244, 67, 54, 0.8);
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-container {
        padding: 0 10px;
        max-width: 100vw;
    }
    
    .disclaimer {
        margin: 0 -10px 15px -10px;
        padding: 12px 15px;
    }
    
    .disclaimer-content {
        font-size: 0.8rem;
        gap: 8px;
    }
    
    .disclaimer-content i {
        font-size: 1rem;
    }
    
    .results-container {
        margin-bottom: 150px;
    }
    
    .race-info {
        flex-direction: column;
        text-align: center;
    }
    
    .race-title {
        font-size: 1.2rem;
    }
    
    .clock-display {
        font-size: 1rem;
        padding: 8px 15px;
    }
    
    .filter-container {
        flex-direction: column;
        align-items: center;
    }
    
    .class-buttons {
        justify-content: center;
    }
    
    .podium {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .podium-place {
        height: auto !important;
        order: unset !important;
        padding: 15px;
    }
    
    .results-table {
        width: 100%;
        font-size: 0.6rem;
    }
    
    .results-table th,
    .results-table td {
        padding: 8px 4px;
        font-size: 0.55rem;
    }
    
    .racer-name {
        font-size: 0.65rem;
        font-weight: 600;
    }
    
    .racer-details {
        flex-direction: column;
        gap: 1px;
        font-size: 0.5rem;
    }
    
    .class-section {
        width: 100%;
        padding: 15px;
    }
    
    .class-name {
        font-size: 1.2rem;
    }
    
    .position-cell {
        width: 30px;
        font-size: 0.7rem;
        font-weight: 700;
    }
    
    .laps-cell {
        font-size: 0.75rem;
        font-weight: 600;
    }
    
    .time-cell {
        /* font-family: 'Orbitron', monospace; */
        font-family: 'Roboto', sans-serif;
        font-size: 0.55rem;
        min-width: 50px;
        font-weight: 600;
    }
}

@media (max-width: 480px) {
    .app-container {
        padding: 0 5px;
    }
    
    .results-container {
        margin-bottom: 120px;
    }
    
    .race-header {
        padding: 10px;
    }
    
    .race-title {
        font-size: 1rem;
    }
    
    .clock-display {
        font-size: 0.9rem;
        padding: 6px 12px;
    }
    
    .results-table {
        font-size: 0.5rem;
    }
    
    .results-table th,
    .results-table td {
        padding: 6px 3px;
        font-size: 0.45rem;
    }
    
    .racer-name {
        font-size: 0.55rem;
        font-weight: 600;
    }
    
    .racer-details {
        font-size: 0.4rem;
    }
    
    .class-section {
        padding: 10px;
    }
    
    .class-name {
        font-size: 1rem;
    }
    
    .position-cell {
        width: 25px;
        font-size: 0.6rem;
        font-weight: 700;
    }
    
    .laps-cell {
        font-size: 0.65rem;
        font-weight: 600;
    }
    
    .time-cell {
        /* font-family: 'Orbitron', monospace; */
        font-family: 'Roboto', sans-serif;
        font-size: 0.45rem;
        min-width: 40px;
        font-weight: 600;
    }
    
    .filter-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

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

.mb-20 {
    margin-bottom: 20px;
}

.mt-20 {
    margin-top: 20px;
} 