@font-face {
    font-family: 'DBNeoOfficeHead';
    src: url('../public/DBNeoOfficeHead-Regular.ttf') format('truetype');
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.bg-image {
    position: fixed;
    top: -10px;
    left: -10px;
    width: calc(100% + 20px);
    height: calc(100% + 20px);
    background-image: url('../public/bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(5px);
    z-index: -1;
}

body {
    background-image: url('../public/bg.jpg');
    background-color: #303030;
    min-height: 100vh;
    font-family: 'DBNeoOfficeHead', Arial, sans-serif;
    overflow-x: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    position: relative;
    width: min(85vw, 900px);
    max-width: 900px;
    min-height: min(85vh, 600px);
    background-color: rgba(255, 255, 255, 0.90);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    padding: min(5vw, 40px);
    margin: 20px;
    transform: scale(min(1, 100vw / 1000px, 100vh / 700px));
    transform-origin: center;
}

.logo {
    position: absolute;
    top: min(4vw, 30px);
    left: min(4vw, 30px);
    width: min(200px, 20vw);
    height: auto;
}

.title {
    margin-top: min(12vw, 80px);
    margin-bottom: min(6vw, 40px);
    text-align: center;
    font-size: clamp(1.5rem, 3.5vw, 2.5rem);
    font-weight: bold;
    color: #000;
}

.title2 {
    margin-top: min(12vw, 80px);
    margin-bottom: min(6vw, 40px);
    text-align: center;
    font-size: clamp(1.5rem, 3.5vw, 2.5rem);
    font-weight: bold;
    color: #000;
}

.timer-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(15px, 4vw, 40px);
    flex: 1;
    flex-wrap: wrap;
    margin-bottom: min(4vw, 30px);
}

.timer-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: min(2vw, 15px);
}

.digit-pair {
    display: flex;
    gap: min(1vw, 8px);
}

.digit.timer-running {
    transform: scale(1.05);
    background-color: rgba(224, 224, 224, 0.8);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.digit {
    width: clamp(50px, 7vw, 80px);
    height: clamp(75px, 10.5vw, 120px);
    background-color: rgb(255, 255, 255, 0.4);
    border: 2px solid rgb(255, 255, 255, 0.6);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(30px, 5vw, 50px);
    font-weight: bold;
    color: #000;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.digit.changing {
    transform: scale(1.05);
    background-color: #e0e0e0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.label {
    font-size: clamp(14px, 2.5vw, 24px);
    color: #000;
    text-align: center;
    font-weight: 600;
}

.progress-bar-container {
    width: 100%;
    height: min(1.2vw, 15px);
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: min(4vw, 30px);
}

.progress-bar {
    height: 100%;
    background-color: #408335;
    border-radius: 4px;
    width: 0%;
    transition: width 1.1s ease-out;
}

.progress-bar.resetting {
    transition: width 0.3s ease-out;
}

.footer-text {
    position: absolute;
    bottom: min(4vw, 30px);
    left: min(4vw, 30px);
    color: #000;
    font-size: clamp(10px, 1.8vw, 16px);
}

.main-page-controls {
    position: absolute;
    top: min(4vw, 30px);
    right: min(4vw, 30px);
}

.settings-link {
    background-color: rgba(255, 255, 255, 0.0);
    color: rgba(0, 0, 0, 0.0);
    padding: 12px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.2s;
}

.settings-link:hover {
    background-color: rgba(255, 255, 255, 0.4);
    color: #000;
    transform: translateY(-2px);
}

.back-to-main {
    position: absolute;
    top: min(4vw, 30px);
    right: min(4vw, 30px);
}

.back-link {
    background-color: rgba(0, 0, 0, 0.4);
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.2s;
}

.back-link:hover {
    background-color: rgba(0, 0, 0, 0.8);
    transform: translateY(-2px);
}

.wave-effect {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border: 15px solid #408335;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    pointer-events: none;
    z-index: 1;
}

.wave-effect.active {
    animation: wave-animation 0s ease-out forwards;
}

.wave-effect.second {
    animation-delay: 0.5s;
}

@keyframes wave-animation {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
    }
    100% {
        width: 200vw;
        height: 200vw;
        opacity: 0;
    }
}

#title {
    white-space: pre-wrap;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: min(350px, 100vw);
    height: 100vh;
    background-color: rgba(255, 255, 255, 0.90);
    padding: min(4vw, 30px);
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    z-index: 500;
}

.sidebar h3 {
    margin-bottom: min(4vw, 30px);
    color: #000;
    font-size: clamp(20px, 3vw, 24px);
}

.setting-group {
    margin-bottom: min(3vw, 25px);
}

.setting-group label {
    display: block;
    margin-bottom: 8px;
    color: #000;
    font-weight: bold;
    font-size: clamp(16px, 2.5vw, 18px);
}

.setting-group select,
.setting-group input {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: clamp(14px, 2vw, 16px);
    font-family: inherit;
    background-color: rgb(255, 255, 255, 0.8);
}

.setting-group select,
.setting-group input,
.setting-group textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: clamp(14px, 2vw, 16px);
    font-family: inherit;
    background-color: rgb(255, 255, 255, 0.8);
    resize: vertical;
}

.setting-group select:focus,
.setting-group input:focus,
.setting-group textarea:focus {
    outline: none;
    border-color: #408335;
}

.setting-group select:focus,
.setting-group input:focus {
    outline: none;
    border-color: #408335;
}

.time-inputs {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.time-inputs input {
    flex: 1;
}

.control-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: min(4vw, 30px);
}

.control-buttons button {
    padding: min(1.5vw, 12px);
    border: none;
    border-radius: 6px;
    font-size: clamp(14px, 2vw, 16px);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

#set-btn {
    background-color: rgb(64,131,53,1);
    color: white;
}

#reset-btn {
    background-color: rgb(236,0,22,1);
    color: white;
}

#start-btn {
    background-color: rgb(30,77,121,1);
    color: white;
}

#stop-btn {
    background-color: rgb(246,202,54,1);
    color: white;
}
#close-btn {
    background-color: rgb(255, 0, 0, 1);
    color: white;
}

.control-buttons button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.control-buttons button:active {
    transform: translateY(0);
}

.error-message {
    margin-top: 15px;
    padding: 10px;
    background-color: #ffebee;
    border: 1px solid #f44336;
    border-radius: 6px;
    color: #c62828;
    font-size: clamp(12px, 1.8vw, 14px);
    display: none;
    text-align: center;
}

.error-message.show {
    display: block;
}

/* Responsive adjustments */
/* @media (max-width: 1600px) {
    body {
        justify-content: flex-end;
        padding-right: 370px;
    }
} */

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        box-shadow: none;
        order: 2;
    }
    
    body {
        flex-direction: column;
        justify-content: flex-start;
        padding: 20px;
        padding-right: 20px;
    }
    
    .container {
        margin: 0;
        order: 1;
        width: 100%;
        transform: none;
    }
    
    .timer-container {
        gap: 20px;
        padding: 20px 0;
    }
    
    .time-inputs {
        flex-direction: row;
    }
}

/* Very small screens */
@media (max-width: 480px) {
    .container {
        transform: scale(0.8);
        min-height: 70vh;
    }
    
    .sidebar {
        padding: 20px;
    }
}