:root {
    --primary-color: #00d2ff;
    --secondary-color: #3a7bd5;
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-color: #f8fafc;
    --text-muted: #94a3b8;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    background: var(--bg-color);
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 500px;
}

.stopwatch-card {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 2rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 2rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.display {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 2.5rem;
    font-variant-numeric: tabular-nums;
    color: var(--text-color);
    text-shadow: 0 0 20px rgba(0, 210, 255, 0.3);
}

.milliseconds {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-left: 5px;
}

.controls {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-start {
    background: var(--success);
    color: white;
}

.btn-start:hover:not(:disabled) {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-stop {
    background: var(--danger);
    color: white;
}

.btn-stop:hover:not(:disabled) {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-lap {
    background: var(--secondary-color);
    color: white;
}

.btn-lap:hover:not(:disabled) {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(58, 123, 213, 0.3);
}

.btn-reset {
    background: #475569;
    color: white;
}

.btn-reset:hover:not(:disabled) {
    background: #334155;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(71, 85, 105, 0.3);
}

.laps-container {
    max-height: 250px;
    overflow-y: auto;
    margin-top: 1rem;
    text-align: left;
    padding-right: 5px;
}

.laps-container h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
}

#lapsList {
    list-style: none;
}

.lap-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.lap-number {
    color: var(--text-muted);
    font-weight: 600;
}

.lap-time {
    font-family: monospace;
    color: var(--primary-color);
}

/* Scrollbar Styling */
.laps-container::-webkit-scrollbar {
    width: 6px;
}

.laps-container::-webkit-scrollbar-track {
    background: transparent;
}

.laps-container::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 10px;
}

/* Responsive adjustments */
@media (max-width: 400px) {
    .display {
        font-size: 3rem;
    }
    .stopwatch-card {
        padding: 1.5rem;
    }
}
