:root {
    --bg-color: #f0f0f0;
    --text-color: #333;
    --container-bg: white;
    --button-bg: #fff;
    --button-border: #ccc;
    --input-border: #ccc;
}

body {
    font-family: sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    transition: background-color 0.3s, color 0.3s;
}

body.dark-mode {
    --bg-color: #333;
    --text-color: #f0f0f0;
    --container-bg: #444;
    --button-bg: #555;
    --button-border: #666;
    --input-border: #666;
}

.timer-container {
    text-align: center;
    background-color: var(--container-bg);
    padding: 20px 40px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s, padding 0.3s;
}

.header, .presets, #start, #reset {
    transition: opacity 0.3s, visibility 0.3s;
}

body.timer-running .header,
body.timer-running .presets,
body.timer-running #start,
body.timer-running #reset {
    opacity: 0;
    visibility: hidden;
    height: 0;
    margin: 0;
    padding: 0;
}

body.timer-running .timer-container {
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100vw;
    height: 100vh;
    box-shadow: none;
    border-radius: 0;
    background-color: var(--bg-color);
}

body.timer-running timer-component .time-display {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
    width: 100%;
}

body.timer-running timer-component .time-display input {
    font-size: 60vh; /* Adjust to screen height */
    width: 30vw;
    border-bottom: none;
    color: var(--text-color);
}

body.timer-running timer-component .time-display span {
    font-size: 60vh;
    color: var(--text-color);
}

.settings button {
    margin-left: 10px;
    padding: 8px 12px;
    border: 1px solid var(--button-border);
    border-radius: 5px;
    background-color: var(--button-bg);
    color: var(--text-color);
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
}

.presets {
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.presets button {
    margin: 5px;
    padding: 10px 15px;
    border: 1px solid var(--button-border);
    border-radius: 5px;
    background-color: var(--button-bg);
    color: var(--text-color);
    cursor: pointer;
    transition: background-color 0.3s;
}

.presets button:hover {
    background-color: #eee;
}

body.dark-mode .presets button:hover {
    background-color: #666;
}

.controls button {
    margin: 5px;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s, opacity 0.3s;
}

.controls .hidden {
    display: none;
}

#start {
    background-color: #28a745;
}

#start:hover {
    background-color: #218838;
}

#stop {
    background-color: #dc3545;
}

#stop:hover {
    background-color: #c82333;
}

#reset {
    background-color: #007bff;
}

#reset:hover {
    background-color: #0069d9;
}

timer-component .time-display input {
    width: 50px;
    font-size: 2em;
    text-align: center;
    border: none;
    background: transparent;
    color: var(--text-color);
    border-bottom: 2px solid var(--input-border);
    margin: 0 5px;
    transition: color 0.3s, font-size 0.3s, width 0.3s;
}

#animation-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    overflow: hidden;
    display: none;
}

#mouse-animation {
    position: absolute;
    bottom: 10px;
    left: 0;
    width: 80px;
    height: 80px;
    background-image: url(https://raw.githubusercontent.com/qmin9339-glitch/Timer/main/mouse1.png);
    background-size: contain;
    background-repeat: no-repeat;
    animation: move-mouse 8s linear infinite;
}

@keyframes move-mouse {
    from {
        transform: translateX(-80px);
    }
    to {
        transform: translateX(100vw);
    }
}

@media (max-width: 600px) {
    .timer-container {
        padding: 20px;
    }
    .header {
        flex-direction: column;
    }
    .settings {
        margin-top: 10px;
    }
    .presets {
        flex-direction: column;
    }
}
