:root {
    --color-bg-gradient-start: oklch(65% 0.25 265);
    --color-bg-gradient-end: oklch(55% 0.22 300);
    --color-container-bg: oklch(100% 0 0 / 0.95);
    --color-container-shadow: oklch(0% 0 0 / 0.3);
    --color-text-primary: oklch(20% 0 0);
    --color-text-secondary: oklch(35% 0 0);
    --color-text-tertiary: oklch(50% 0 0);
    --color-text-muted: oklch(60% 0 0);
    --color-text-placeholder: oklch(70% 0 0);
    --color-border-light: oklch(85% 0 0);
    --color-border-focus: oklch(65% 0.25 265);
    --color-success: oklch(65% 0.2 145);
    --color-success-hover: oklch(60% 0.2 145);
    --color-warning: oklch(70% 0.15 70);
    --color-warning-hover: oklch(65% 0.15 70);
    --color-danger: oklch(55% 0.22 25);
    --color-danger-hover: oklch(50% 0.22 25);
    --color-action-primary: oklch(60% 0.15 250);
    --color-action-primary-hover: oklch(55% 0.15 250);
    --color-action-secondary: oklch(60% 0.2 300);
    --color-action-secondary-hover: oklch(55% 0.2 300);
    --color-action-secondary-active: oklch(45% 0.2 300);
    --color-bg-light: oklch(97% 0 0);
    --color-bg-very-light: oklch(98% 0 0);
    --color-task-bg: oklch(90% 0 0);
    --color-task-break-bg: oklch(95% 0.1 25);
    --color-task-break-bg-hover: oklch(90% 0.1 25);
}

* {
    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, var(--color-bg-gradient-start) 0%, var(--color-bg-gradient-end) 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: var(--color-container-bg);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px var(--color-container-shadow);
    text-align: center;
    max-width: 500px;
    width: 100%;
}

.timer-display {
    font-size: 120px;
    font-weight: bold;
    color: var(--color-text-primary);
    margin: 20px 0;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.task-input-container {
    margin: 20px 0;
}

.task-input {
    width: 100%;
    padding: 15px;
    font-size: 20px;
    border: none;
    border-bottom: 2px solid var(--color-border-light);
    background: transparent;
    text-align: center;
    outline: none;
    color: var(--color-text-secondary);
    transition: border-color 0.3s ease;
}

.task-input::placeholder {
    color: var(--color-text-placeholder);
}

.task-input:focus {
    border-bottom-color: var(--color-border-focus);
}

.timer-display.finished {
    color: var(--color-danger);
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.elapsed-time-counter {
    font-size: 24px;
    font-weight: 500;
    color: var(--color-text-tertiary);
    margin: 10px 0 20px 0;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.progress-bar-container {
    width: 100%;
    height: 12px;
    background: var(--color-border-light);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-bar {
    height: 100%;
    border-radius: 6px;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 30px 0;
}

.btn {
    padding: 15px 30px;
    font-size: 18px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-play {
    background: var(--color-success);
    color: white;
}

.btn-play:hover {
    background: var(--color-success-hover);
    transform: translateY(-2px);
}

.btn-pause {
    background: var(--color-warning);
    color: white;
}

.btn-pause:hover {
    background: var(--color-warning-hover);
    transform: translateY(-2px);
}

.btn-reset {
    background: var(--color-danger);
    color: white;
}

.btn-reset:hover {
    background: var(--color-danger-hover);
    transform: translateY(-2px);
}

.btn-finish {
    background: var(--color-action-secondary);
    color: white;
}

.btn-finish:hover {
    background: var(--color-action-secondary-hover);
    transform: translateY(-2px);
}

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

.preset-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.preset-btn {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: var(--color-action-primary);
    color: white;
    transition: all 0.3s ease;
}

.preset-btn:hover {
    background: var(--color-action-primary-hover);
    transform: translateY(-2px);
}

.preset-btn.active {
    background: var(--color-action-secondary-hover);
}

.custom-time-section {
    margin-top: 20px;
    width: 100%;
}

.custom-time-btn {
    width: 100%;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: var(--color-action-secondary);
    color: white;
    transition: all 0.3s ease;
    margin-bottom: 15px;
}

.custom-time-btn:hover {
    background: var(--color-action-secondary-hover);
    transform: translateY(-2px);
}

.custom-time-btn.active {
    background: var(--color-action-secondary-active);
}

.range-slider-container {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
}

.range-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    border-radius: 5px;
    background: var(--color-border-light);
    outline: none;
    cursor: pointer;
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-action-secondary);
    cursor: pointer;
    transition: background 0.3s ease;
}

.range-slider::-webkit-slider-thumb:hover {
    background: var(--color-action-secondary-hover);
}

.range-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-action-secondary);
    cursor: pointer;
    border: none;
    transition: background 0.3s ease;
}

.range-slider::-moz-range-thumb:hover {
    background: var(--color-action-secondary-hover);
}

.range-value {
    min-width: 40px;
    text-align: center;
    font-weight: 600;
    color: var(--color-text-muted);
    font-size: 16px;
}

.status {
    margin-top: 20px;
    font-size: 18px;
    color: var(--color-text-muted);
    min-height: 27px;
}

.log-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid var(--color-bg-very-light);
}

.log-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 15px;
}

.log-list {
    max-height: 300px;
    overflow-y: auto;
    text-align: left;
}

.log-date-group {
    margin-bottom: 20px;
}

.log-date-header {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.log-item {
    background: var(--color-bg-light);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.log-item-content {
    flex: 1;
}

.log-task {
    font-weight: 600;
    color: var(--color-text-primary);
    font-size: 15px;
    margin-bottom: 4px;
}

.log-task.no-task {
    color: var(--color-text-placeholder);
    font-style: italic;
}

.log-times {
    font-size: 12px;
    color: var(--color-text-muted);
    line-height: 1.4;
    text-transform: lowercase;
}

.log-time-range {
    display: block;
    margin-bottom: 2px;
}

.delete-btn {
    background: var(--color-danger);
    color: white;
    border: none;
    border-radius: 5px;
    padding: 4px 8px;
    font-size: 11px;
    cursor: pointer;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.delete-btn:hover {
    background: var(--color-danger-hover);
}

.empty-log {
    color: var(--color-text-placeholder);
    font-style: italic;
    padding: 20px;
    text-align: center;
}

.work-day-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid var(--color-bg-very-light);
}

.work-day-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: 15px;
}

.work-day-display {
    font-size: 48px;
    font-weight: bold;
    color: var(--color-action-secondary);
    margin: 15px 0;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.work-day-start-time {
    font-size: 14px;
    color: var(--color-text-muted);
    margin: 10px 0;
    font-weight: 500;
}

.work-day-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
}

.work-day-btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.work-day-btn-play {
    background: var(--color-success);
    color: white;
}

.work-day-btn-play:hover {
    background: var(--color-success-hover);
    transform: translateY(-2px);
}

.work-day-btn-pause {
    background: var(--color-warning);
    color: white;
}

.work-day-btn-pause:hover {
    background: var(--color-warning-hover);
    transform: translateY(-2px);
}

.work-day-btn-reset {
    background: var(--color-danger);
    color: white;
}

.work-day-btn-reset:hover {
    background: var(--color-danger-hover);
    transform: translateY(-2px);
}

.log-item.break {
    background: var(--color-task-break-bg);
    border-left: 4px solid var(--color-danger);
}

.log-item.break .log-task {
    color: var(--color-danger);
}

@media (max-width: 600px) {
    .timer-display {
        font-size: 80px;
    }

    .btn {
        padding: 12px 20px;
        font-size: 16px;
    }

    .preset-btn {
        padding: 10px 18px;
        font-size: 14px;
    }

    .container {
        padding: 25px;
    }

    .log-item {
        flex-direction: column;
    }

    .delete-btn {
        align-self: flex-end;
    }
}
