/* static/css/base.css */
/* Contém estilos globais para o site */

/* Variáveis de cores (para referência em outros ficheiros) */
:root {
    --bg-color: #0f172a;
    --primary-color: #22d3ee;
    --primary-hover: rgb(45, 223, 250);
    --text-color: #cbd5e1;
    --heading-color: #f1f5f9;
    --form-bg-color: #1e293b;
    --input-bg-color: #0f172a;
    --input-border-color: #334155;
    --bg2-color: rgba(72, 69, 69, 0.2);
}

/* --- ESTILOS DO HEADER --- */
.top-box {
    width: 100%;
    padding: 15px 20px;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    border-bottom: 1px solid var(--heading-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: blur(5px);
    box-sizing: border-box;
}

.logo {
    font-size: 2em;
    font-weight: bold;
}

.logo a {
    text-decoration: none;
    color: var(--heading-color);
}

.logo span {
    color: var(--primary-color);
}

.menu-container {
    position: relative;
    margin-right: 20px;
}

/* --- CONTROLO DO MENU DESKTOP/MOBILE --- */

/* Por padrão (mobile-first), esconde o texto do menu desktop */
.menu-container .trigger-box:not(#trigger-box-phone) {
    display: none;
}

/* Mostra e estiliza o ícone do menu mobile por padrão */
#trigger-box-phone {
    display: block;
    padding: 5px;
    border: none;
    background: none;
    cursor: pointer;
}

#trigger-box-phone img {
    width: 30px;
    height: 30px;
    display: block;
}

/* Quando a tela for maior (1024px ou mais) */
@media (min-width: 1024px) {
    /* Esconde o ícone do menu mobile */
    #trigger-box-phone {
        display: none;
    }

    /* Mostra o texto do menu desktop e aplica seus estilos */
    .menu-container .trigger-box:not(#trigger-box-phone) {
        display: block;
        background-color: var(--bg-color);
        color: var(--text-color);
        padding: 10px 20px;
        border-radius: 8px;
        cursor: pointer;
        font-size: 1.2em;
        font-weight: bold;
        border: 2px solid var(--bg2-color);
    }
}


/* Menu dropdown (btns-log) */
.btns-log {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background-color: #1e293b;
    border-radius: 8px;
    border: 1px solid var(--input-border-color);
    padding: 10px;
    width: 200px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    z-index: 10;
}

.btns-log.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 8px;
}

.user-info span {
    color: var(--heading-color);
    font-family: 'Poppins', sans-serif;
    padding: 5px;
    font-size: 1em;
    text-align: center;
    width: 100%;
}

.btns-log button {
    display: block;
    width: 100%;
    padding: 10px;
    margin-bottom: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 1em;
    border-radius: 5px;
    cursor: pointer;
    border: none;
    text-align: center;
    box-sizing: border-box;
}

.btns-log button:last-child {
    margin-bottom: 0;
}

.login-btn {
    color: var(--text-color);
    background: transparent;
}
.login-btn:hover {
    background-color: #141c30;
}

.signup-btn,
.logout-button {
    background-color: var(--primary-color);
    color: #0f172a;
    font-weight: bold;
}
.signup-btn:hover,
.logout-button:hover {
    background-color: var(--primary-hover);
}

/* --- ESTILOS DO FOOTER --- */
.footer {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    gap: 20px;
    text-align: center;
    font-family: 'Poppins', sans-serif;
    width: 100%;
    border-top: solid 1px var(--primary-color);
    box-sizing: border-box;
}

.footer p {
    margin: 0;
    color: var(--text-color);
}

.github-link img {
    width: 32px;
    height: 32px;
    vertical-align: middle;
    transition: opacity 0.3s ease;
}

.github-link:hover img {
    opacity: 0.8;
}

/* --- ESTILOS DE MENSAGENS FLASH --- */
.flash-messages-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1050;
    width: 100%;
    max-width: 350px;
}

.alert {
    position: relative;
    padding: 15px;
    margin-bottom: 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #f1f5f9;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    opacity: 0.95;
    font-family: 'Poppins', sans-serif;
}
.alert .close-btn {
    position: absolute;
    top: 5px;
    right: 10px;
    font-size: 20px;
    cursor: pointer;
    font-weight: bold;
}
.alert-success { background-color: #166534; border-color: #22c55e; }
.alert-danger { background-color: #991b1b; border-color: #ef4444; }
.alert-info { background-color: #1e40af; border-color: #3b82f6; }
.alert-warning { background-color: #b45309; border-color: #f59e0b; }
