/*CSS variables reset css and basic body properties*/
:root { 
    --background-color: #F0F4F8;
    --background-timer-color: #FFFFFF;
    --accent-workmode-color: #2A9D8F;
    --accent-breakmode-color: #E9C46A;
    --text-primary-color: #264653;
    --text-principal-font: 'Montserrat', sans-serif;
    --text-secondary-font: 'Roboto', sans-serif;
    /*Dark Mode*/
    --background-color-dark: #121212;
    --background-timer-color-dark: #1F1F1F;
    --text-primary-color-dark: #E0E0E0;
    --accent-workmode-color-dark: #4ECDC4;
    --accent-breakmode-color-dark: #FFD700;

}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    border: 0;
}
body {
    background-color: var(--background-color);
    font-family: var(--text-principal-font);
    height: 100vh; /*Min para evitar problemas de scroll y moviles*/
    font-size: 18px;
    margin: 0;
    padding: 0;
    color: var(--text-primary-color);
}

/*Header styles*/
header {
    height: 10%;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/*Main container styles -> Timer and control buttons*/
main {
    height: 80%;
    width: 100%;
    display: flex;
    align-items: center;
    padding-top: 1%;
    justify-content: flex-start;
    text-align: center;
    flex-direction: column;
}

#darkMode {
    position: absolute;
    top: 25px;
    right: 80px;
    width: 40px;
    height: 40px;
    background-color: transparent;
    transition: all 0.3s ease;
}

/*Counter and control styles*/
.counter {
    padding: 30px;
    padding-bottom: 60px;
    width: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: solid 4px var(--text-primary-color);
    border-radius: 30px;
    background-color: var(--background-timer-color);
}
.counter .timer  {
    font-size: 10rem;
    font-weight: bold;
    text-align: center;
    padding: 10px;

}
.controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    padding-top: 30px;
}
.controls button {
    background-color: transparent;
    transition: all 0.3s ease;
}
.controls button:hover, #darkMode:hover {
    cursor: pointer;
    transform: scale(1.1);
    filter: brightness(1.2);
}

/*Change mode buttons*/
.buttons {
    padding-top: 50px;
    width: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.buttons button {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2rem;
    padding: 20px 40px;
    font-weight: bold;
    border-radius: 15px;
    color: var(--background-color);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}
.buttons .workBtn {
    background-color: var(--accent-workmode-color);
}

.buttons .breakBtn {
    background-color: var(--accent-breakmode-color);
}
.buttons button:hover {
    cursor: pointer;
    background-color: transparent;
}
.buttons .breakBtn:hover {
    color: var(--accent-breakmode-color);
    border: solid 2px var(--accent-breakmode-color);
}

.buttons .workBtn:hover {
    color: var(--accent-workmode-color);
    border: solid 2px var(--accent-workmode-color);
}

/*Footer styles*/
footer {
    height: 10%;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}
footer a {
    color: var(--text-primary-color);
    text-decoration: none;  
    font-weight: bold;
    font-size: 1.4rem;
    transition: all 0.3s ease;
}
footer a:hover {
    transform: scale(1.05);
    filter: brightness(1.5);
}

/*ANIMATIONS - Fade in on page load*/
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Apply animations to elements */
header {
    animation: fadeInDown 0.4s ease-out;
}

#darkMode {
    animation: fadeIn 0.5s ease-out 0.15s both;
}

.counter {
    animation: fadeInUp 0.45s ease-out 0.2s both;
}

.buttons {
    animation: fadeInUp 0.45s ease-out 0.35s both;
}

footer {
    animation: fadeInUp 0.4s ease-out 0.5s both;
}

/*MEDIA QUERIES*/
@media (max-width: 1200px) {
    .counter {
        width: 70%;
    }
    .counter .timer {
        font-size: 8rem;
    }
}

@media (max-width: 700px) {
    .counter {
        width: 80%;
    }
    .counter .timer {
        font-size: 6rem;
    }
    header h1 {
        font-size: 28px;
        text-align: center;
    }
    main {
        height: 70vh;  
    }

}

@media (max-width: 550px) {
    #darkMode {
        top: 15px;
        right: 15px;
        height: 30px;
        width: 30px;
    }
}

@media (max-width: 400px) {
    header h1 {
        font-size: 20px;
    }
}