/* STYLE GLOBAL MODULE (MAIN CSS - CRITICAL): Styles every section of the app. */

* {
    margin: 0;
    padding: 0;
}

:root {
    --primaryColor: #b9e1ff;
    --bg: linear-gradient(to right, #f7faff, #dbeafe);
    --textColor: rgb(30, 30, 30);
    --btnBg: #767676;
    --btnHv: #8d8d8d;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: clamp(16px, 4vw, 20px);
    background: var(--bg);
    color: var(--textColor);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    place-content: space-around;
    text-align: center;
    line-height: 1.4;
}

/* Dark Mode */
body.dark-mode {
    --primaryColor: rgb(58, 74, 99);
    --bg: linear-gradient(to right, #1f1f1f, #1e2021);
    --textColor: rgb(250, 250, 250);
    --border: 2px solid var(--primaryColor);
    --btnBg: #d8d8d8;
    --btnHv: #ffffff;
}

/* Basic Elements */
body,
button,
a {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

h1 {
    font-size: clamp(1.25rem, 1.5rem, 1.5vmax);
}

h2 {
    font-size: clamp(1rem, 1.5rem, 1.5vmax);
}

h3 {
    font-size: clamp(0.8rem, 1rem, 1.2vmax);
}

p {
    font-size: clamp(0.7rem, 0.95rem, 1vmax);
}

img {
    pointer-events: none;
}

a {
    text-decoration: none;
    cursor: pointer;
    color: rgb(144, 144, 144);
    transition: color 0.2s ease;
}

a:hover {
    color: var(--color-font);
}

button {
    display: block;
    width: max-content;
    background-color: #4caf50;
    color: white;
    padding: 0.8rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #2f8b34;
}

/* Header — Nav Bar */
#nav {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    padding: 10px 0;
    box-sizing: border-box;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1;
    width: 100vw;
}

#nav h2 {
    font-size: xx-large;
    margin: auto;
}

#nav,
#nav ul {
    gap: 0 0.8rem;
}

#nav ul {
    display: flex;
}

#nav ul li {
    list-style: none;
}

/* Greeting Sect */
#greet {
    opacity: 0;
    background: linear-gradient(to right, #00c6ff, #0072ff, #9c27b0, #ff9800);
    font-weight: bold;
    background-clip: text;
    color: transparent;
    transition: opacity 1s ease-in-out;
}

#greet.show {
    opacity: 1;
}

/* Search Container */
#search-cont {
    gap: 0 0.25rem;
    display: flex;
    justify-content: center;
    align-items: center;
    width: max-content;
}

/* Search Bar */
#search-bar {
    height: 3rem;
    padding: 0 1rem;
    border-radius: 24px;
    cursor: text;
    border: none;
    font-weight: 400;
    width: 50vw;
    max-width: 500px;
    color: #9a9a9a;
    background-color: var(--primaryColor);
    transition: background-color 0.2s ease;
    font-size: clamp(0.7rem, 0.95rem, 1.5vmax);
}

#search-bar::placeholder {
    text-wrap: wrap;
}

#search-bar:hover {
    outline: 1px solid rgba(255, 255, 255, 0.3);
    background-color: #c4ff64;
}

/* Toggle Button Styling */
#dark-mode {
    padding: 10px;
    background-color: var(--btnBg);
    border-radius: 20%;
    transition: all 0.3s ease;
}

#dark-mode:hover {
    background-color: var(--btnHv);
    transform: scale(1.03);
    box-shadow: 0 0 20px var(--btnBg);
}

#dark-mode img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

/* Logout */
#logout {
    background-color: #f44336;
    transition: transform 0.3s ease;
}

#logout:hover {
    transform: scale(1.03);
    box-shadow: 0 0px 20px 0px #f44336
}

@media (max-width:768px) {
    #logout {
        padding: 0.6rem;
        font-size: 0.7rem;
    }
}

/* Logout Modal */
#logout-modal {
    position: fixed;
    inset: 0;
    /* top:0 right:0 bottom:0 left:0 */
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.logout-box {
    background: var(--bg);
    color: var(--textColor);
    padding: 1.2rem 1.5rem;
    border-radius: 10px;
    width: min(90%, 420px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    text-align: center;
}

.logout-box p {
    margin: 0.6rem 0;
}

.logout-box .note {
    font-size: 0.85rem;
    opacity: 0.8;
}

.logout-box .actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.logout-box button {
    padding: 0.45rem 1rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
}

/* Logout Confirmation */
#logout-confirm {
    background: #e63946;
    color: #fff;
}

#logout-cancel {
    background: var(--primaryColor);
}

main {
    margin: auto;
    max-width: 80vw;
    font-size: large;
}

footer a {
    color: cornflowerblue;
}

footer {
    width: 100%;
    font-size: 1rem;
    margin-top: auto;
    padding: 1rem 0;
}