.timer-page {
    padding: 24px 20px;
    max-width: var(--medium-width);
    margin: 0 auto;
}

.timer-display {
    background: linear-gradient(135deg, #3b0764 0%, #1e1b4b 100%);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(59, 7, 100, 0.4);
}

.timer-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

.timer-display-inner {
    position: relative;
    z-index: 1;
    text-align: center;
}

.timer-name {
    font-size: 80px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.timer-time {
    font-size: 280px;
    font-weight: 700;
    color: #ffffff;
    font-family: 'Courier New', 'Consolas', monospace;
    line-height: 1.2;
    text-shadow: 0 0 30px rgba(168, 85, 247, 0.8), 0 0 60px rgba(168, 85, 247, 0.4);
    transition: all 0.3s;
    letter-spacing: -4px;
}

.timer-time-end {
    color: #ef4444;
    animation: timeEnd 0.5s ease-in-out infinite;
}

@keyframes timeEnd {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.98); }
}

.timer-controls {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 20px;
}

.timer-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.timer-btn-start {
    background: linear-gradient(135deg, #6d28d9 0%, #4c1d95 100%);
    color: white;
    border: 1px solid rgba(109, 40, 217, 0.4);
}

.timer-btn-start:hover {
    border: 1px solid rgba(109, 40, 217, 0.5);
}

.timer-btn-pause {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.timer-btn-pause:hover {
    background: rgba(255, 255, 255, 0.3);
}

.timer-btn-reset {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.timer-btn-reset:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.timer-config {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.config-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.config-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #4b5563;
}

.config-input {
    min-width: 100px;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    color: #1f2937;
    background: #fafafa;
    transition: all 0.2s;
}

.config-input:focus {
    outline: none;
    border-color: #6d28d9;
    background: white;
    box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.1);
}

.preset-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.preset-btn {
    padding: 8px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.preset-btn:hover {
    border-color: #a78bfa;
    color: #6d28d9;
}

.preset-btn.active {
    background: linear-gradient(135deg, #6d28d9 0%, #4c1d95 100%);
    border-color: #6d28d9;
    color: white;
    box-shadow: 0 4px 12px rgba(109, 40, 217, 0.3);
}

.custom-input-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}

.custom-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: #f9fafb;
    border: none;
    font-size: 20px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
}

.custom-btn:hover {
    background: #f3f4f6;
    color: #6d28d9;
}

.custom-input {
    flex: 1;
    width: 60px;
    padding: 8px;
    border: none;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    background: white;
}

.custom-input:focus {
    outline: none;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 56px;
    height: 32px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e5e7eb;
    transition: 0.3s;
    border-radius: 32px;
}

.toggle-switch .slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .slider {
    background: linear-gradient(135deg, #6d28d9 0%, #4c1d95 100%);
}

.toggle-switch input:checked + .slider:before {
    transform: translateX(24px);
}

.config-apply-btn {
    padding: 12px 32px;
    background: linear-gradient(135deg, #6d28d9 0%, #4c1d95 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(109, 40, 217, 0.4);
    white-space: nowrap;
}

.config-apply-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(109, 40, 217, 0.5);
}

@media (max-width: 640px) {
    .timer-display {
        padding: 40px 20px;
    }

    .timer-time {
        font-size: 80px;
        letter-spacing: -2px;
    }

    .timer-name {
        font-size: 18px;
    }

    .timer-controls {
        gap: 10px;
        margin-top: 25px;
    }

    .timer-btn {
        padding: 10px 20px;
        font-size: 14px;
    }

    .timer-config {
        padding: 20px;
        flex-direction: column;
        align-items: stretch;
    }

    .preset-buttons {
        justify-content: flex-start;
    }

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

    .config-apply-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .timer-time {
        font-size: 60px;
    }
}