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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
}

.container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    font-weight: 300;
    font-size: 1.8rem;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.tab {
    flex: 1;
    padding: 12px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.tab:hover {
    background: rgba(255, 255, 255, 0.2);
}

.tab.active {
    background: #4facfe;
}

.section {
    display: none;
    min-height: 280px;
}

.section.active {
    display: block;
}

.section-header {
    height: 95px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.display {
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    text-align: center;
    padding: 25px 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    margin-bottom: 25px;
    letter-spacing: 1px;
    overflow: hidden;
    word-break: keep-all;
}

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

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #555 !important;
    color: #999 !important;
}

.btn-start {
    background: #00d26a;
    color: #fff;
}

.btn-start:hover:not(:disabled) {
    background: #00b359;
}

.btn-stop {
    background: #ff4757;
    color: #fff;
}

.btn-stop:hover:not(:disabled) {
    background: #e84150;
}

.btn-reset {
    background: #ffa502;
    color: #fff;
}

.btn-reset:hover:not(:disabled) {
    background: #e69400;
}

.btn-lap {
    background: #4facfe;
    color: #fff;
}

.btn-lap:hover:not(:disabled) {
    background: #3a9ce8;
}

.laps {
    margin-top: 20px;
    max-height: 200px;
    overflow-y: auto;
}

.lap-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-bottom: 8px;
    font-family: 'SF Mono', monospace;
}

.lap-item:first-child {
    background: rgba(79, 172, 254, 0.3);
}

.timer-setup {
    width: 100%;
}

.time-input {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-bottom: 15px;
}

.time-input input {
    width: 60px;
    padding: 10px;
    font-size: 1.2rem;
    text-align: center;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.time-input input:focus {
    outline: 2px solid #4facfe;
}

.time-input span {
    font-size: 1.5rem;
}

.presets {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.preset {
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: transparent;
    color: #fff;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.preset:hover {
    background: rgba(255, 255, 255, 0.2);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.timer-finished {
    animation: pulse 0.5s ease-in-out infinite;
    color: #ff4757;
}

/* Scrollbar styling */
.laps::-webkit-scrollbar {
    width: 6px;
}

.laps::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.laps::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}
