/* Stopwatch Styles */

/* Main display container */
.stopwatch-display {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, rgba(5, 44, 101, 0.05), rgba(5, 44, 101, 0.02));
    border-radius: 16px;
    margin-bottom: 24px;
    position: relative;
}

/* Fullscreen button */
.btn-fullscreen {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(5, 44, 101, 0.1);
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.btn-fullscreen:hover {
    background: rgba(5, 44, 101, 0.2);
    transform: scale(1.05);
}

.btn-fullscreen:active {
    transform: scale(0.95);
}

/* Time display */
.time-display {
    font-family: 'Courier New', 'Consolas', monospace;
    font-size: 4rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--bs-primary-text-emphasis);
    margin-bottom: 16px;
    line-height: 1;
}

.milliseconds {
    font-size: 2rem;
    color: var(--bs-secondary-color);
    opacity: 0.8;
}

/* Control buttons */
.stopwatch-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.stopwatch-btn {
    min-width: 120px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: none;
    position: relative;
    overflow: hidden;
}

.stopwatch-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}

.stopwatch-btn:active::before {
    width: 300px;
    height: 300px;
}

.btn-start {
    background: #198754;
    color: white;
}

.btn-start:hover {
    background: #157347;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(25, 135, 84, 0.3);
}

.btn-pause {
    background: #ffc107;
    color: #000;
}

.btn-pause:hover {
    background: #ffb000;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

.btn-reset {
    background: #dc3545;
    color: white;
}

.btn-reset:hover {
    background: #bb2d3b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.btn-lap {
    background: #0d6efd;
    color: white;
}

.btn-lap:hover {
    background: #0b5ed7;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

.stopwatch-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Fullscreen mode styles */
.stopwatch-display.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    margin: 0;
    border-radius: 0;
    z-index: 9999;
    background: linear-gradient(135deg, rgba(5, 44, 101, 0.95), rgba(5, 44, 101, 0.85));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
}

.stopwatch-display.fullscreen .time-display {
    font-size: 8rem;
    color: #fff;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.stopwatch-display.fullscreen .milliseconds {
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.9);
}

.stopwatch-display.fullscreen .stopwatch-btn {
    min-width: 140px;
    padding: 16px 32px;
    font-size: 18px;
}

.stopwatch-display.fullscreen .btn-fullscreen {
    background: rgba(255, 255, 255, 0.2);
}

.stopwatch-display.fullscreen .btn-fullscreen:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Lap times section */
.laps-container {
    margin-top: 24px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 8px;
}

.laps-container::-webkit-scrollbar {
    width: 8px;
}

.laps-container::-webkit-scrollbar-track {
    background: var(--bs-secondary-bg);
    border-radius: 4px;
}

.laps-container::-webkit-scrollbar-thumb {
    background: var(--bs-primary);
    border-radius: 4px;
}

.laps-container::-webkit-scrollbar-thumb:hover {
    background: var(--bs-primary-text-emphasis);
}

.lap-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bs-secondary-bg);
    border-left: 3px solid var(--bs-primary);
    border-radius: 6px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.lap-item:hover {
    background: var(--bs-tertiary-bg);
    transform: translateX(4px);
}

.lap-item.fastest {
    border-left-color: #198754;
    background: rgba(25, 135, 84, 0.05);
}

.lap-item.slowest {
    border-left-color: #dc3545;
    background: rgba(220, 53, 69, 0.05);
}

.lap-number {
    font-weight: 600;
    color: var(--bs-secondary-color);
    min-width: 80px;
}

.lap-time {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: var(--bs-primary-text-emphasis);
    flex: 1;
    text-align: right;
}

.lap-delta {
    font-size: 12px;
    font-family: 'Courier New', monospace;
    margin-left: 12px;
    padding: 2px 8px;
    border-radius: 4px;
    min-width: 80px;
    text-align: right;
}

.lap-delta.positive {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
}

.lap-delta.negative {
    color: #198754;
    background: rgba(25, 135, 84, 0.1);
}

/* Stats section */
.stopwatch-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.stat-item {
    padding: 12px;
    background: var(--bs-secondary-bg);
    border-radius: 8px;
    text-align: center;
}

.stat-label {
    font-size: 12px;
    color: var(--bs-secondary-color);
    font-weight: 500;
    margin-bottom: 4px;
}

.stat-value {
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: 700;
    color: var(--bs-primary-text-emphasis);
}

/* Running animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.stopwatch-display.running .time-display {
    animation: pulse 1s ease-in-out infinite;
}

/* Empty state */
.empty-laps {
    text-align: center;
    padding: 40px 20px;
    color: var(--bs-secondary-color);
}

.empty-laps .fsvg {
    width: 48px;
    height: 48px;
    opacity: 0.3;
    margin-bottom: 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .time-display {
        font-size: 3rem;
    }
    
    .milliseconds {
        font-size: 1.5rem;
    }
    
    .stopwatch-controls {
        gap: 8px;
    }
    
    .stopwatch-btn {
        min-width: 100px;
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .lap-item {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .lap-delta {
        display: none;
    }
    
    .stopwatch-stats {
        grid-template-columns: 1fr;
    }
    
    .stopwatch-display.fullscreen .time-display {
        font-size: 5rem;
    }
    
    .stopwatch-display.fullscreen .milliseconds {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .time-display {
        font-size: 2.5rem;
    }
    
    .milliseconds {
        font-size: 1.2rem;
    }
    
    .stopwatch-display {
        padding: 30px 15px;
    }
    
    .stopwatch-display.fullscreen .time-display {
        font-size: 4rem;
    }
    
    .stopwatch-display.fullscreen .milliseconds {
        font-size: 2rem;
    }
}

/* Dark mode */
[data-bs-theme="dark"] .stopwatch-display {
    background: linear-gradient(135deg, rgba(110, 168, 254, 0.1), rgba(110, 168, 254, 0.05));
}

[data-bs-theme="dark"] .time-display {
    color: #6ea8fe;
}

[data-bs-theme="dark"] .btn-fullscreen {
    background: rgba(110, 168, 254, 0.15);
}

[data-bs-theme="dark"] .btn-fullscreen:hover {
    background: rgba(110, 168, 254, 0.25);
}

[data-bs-theme="dark"] .stopwatch-display.fullscreen {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.95), rgba(13, 110, 253, 0.85));
}

[data-bs-theme="dark"] .lap-item {
    background: rgba(255, 255, 255, 0.05);
    border-left-color: #6ea8fe;
}

[data-bs-theme="dark"] .lap-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

[data-bs-theme="dark"] .lap-item.fastest {
    border-left-color: #75b798;
    background: rgba(25, 135, 84, 0.1);
}

[data-bs-theme="dark"] .lap-item.slowest {
    border-left-color: #ea868f;
    background: rgba(220, 53, 69, 0.1);
}

[data-bs-theme="dark"] .stat-item {
    background: rgba(255, 255, 255, 0.05);
}

/* Print styles */
@media print {
    .stopwatch-controls {
        display: none;
    }
    
    .btn-fullscreen {
        display: none;
    }
    
    .stopwatch-display {
        background: none;
        border: 2px solid #000;
    }
}