:root {
    --color-text: #4f4f4f;
    --color-white: #ffffff;
    --color-background: #f5f7fa;
    --color-primary: #4caf4f;
    --color-primary-hover: #2a7e2f;
    --color-secondary: #455a64;
    --color-clean: #a6d6a8;
    --color-clean-opacity: #9bc59c;
    --color-warning: #cc073e; 
    --color-agent-bg: #fafafa;

    --header-height: 8vh;
    --footer-height: 8vh;

    --blob-color-1: 76, 175, 79;     /* #4caf4f - primary light */
    --blob-color-2: 129, 199, 132;   /* #81c784 - primary dark mode */
    --blob-color-3: 166, 214, 168;   /* #a6d6a8 - clean */
    --blob-color-4: 100, 175, 100;
    --blob-color-5: 80, 170, 90;
    --blob-interactive: 76, 175, 79;
}

[data-theme="dark"] {
    --color-text: #e0e0e0;
    --color-white: #121212;
    --color-background: #1e1e1e;
    --color-primary: #81c784;
    --color-secondary: #424242;
    --color-clean: #4caf50;
    --color-clean-opacity: rgba(166, 214, 168, 0.5);
    --color-warning: #cc073e; 
    --color-agent-bg: #464444;
}


/* ************************************************* */
/* *** Reset de CSS para melhor ajuste do layout *** */
/* ************************************************* */
* {
    margin: 0;
    padding: 0;
    outline: 0;
    box-sizing: border-box;
    transition: all 0.5s ease;
}

a {
    all: unset;
    cursor: pointer;
    color: var(--color-text);
    display: inline-block;
    transition: all 0.5s ease;
}

a:hover {
    transform: scale(1.1);
}

.display-none {
    display: none !important;
}


/* ************************************************* */
/* **** Elementos principais de posicionamento ***** */
/* ************************************************* */
body {
    display: flex;
    flex-direction: column;
    color: var(--color-text);
    font-family: "Rubik", sans-serif;
}

h1 {
    font-size: 28px !important;
}

h2 {
    font-size: 24px !important;
}

h3 {
    font-size: 20px !important;
}

nav {
    height: var(--header-height);
    background-color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: rgba(0, 0, 0, 0.05) 0px 0px 0px 1px, rgba(119, 120, 121, 0.493) 0px 0px 0px 1px inset;
}

main {
    min-height: calc(100vh - var(--header-height) - var(--footer-height));
    background-color: var(--color-background);
    display: flex;
    align-items: center;
    flex-direction: column;
    padding: 40px 0px;
}

footer {
    height: var(--footer-height);
    background-color: var(--color-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: rgba(60, 64, 67, 0.3) 0px 1px 2px 0px, rgba(60, 64, 67, 0.15) 0px 1px 3px 1px;
}

.container {
    display: flex;
    width: 100%;
    padding: 0px 20px;
}

.container-column {
    flex-direction: column;
}

.container-row {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

/* ============================================= */
/* TOASTS SIMPLIFICADOS E RESPONSIVOS            */
/* ============================================= */

.toast-container {
    position: fixed;
    top: 20px;
    left: 0;
    right: 0;
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    pointer-events: none;
    width: 100%;
    padding: 0 15px;
    box-sizing: border-box;
}

.toast-message {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 10px;
    max-width: 500px;
    width: 100%;
    pointer-events: auto;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    margin: 5px 0;
    animation: toastSlideIn 0.3s ease-out;
    box-sizing: border-box;
    background: var(--color-white);
    border-left: 4px solid;
}

/* Cores dos toasts */
.toast-error {
    border-left-color: #dc3545;
    color: #721c24;
    background-color: #f8d7da;
}

.toast-warning {
    border-left-color: #ffc107;
    color: #856404;
    background-color: #fff3cd;
}

.toast-info {
    border-left-color: #17a2b8;
    color: #0c5460;
    background-color: #d1ecf1;
}

.toast-success {
    border-left-color: #28a745;
    color: #155724;
    background-color: #d4edda;
}

/* Ícone do toast */
.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

/* Conteúdo do toast - AGORA TOTALMENTE RESPONSIVO */
.toast-content {
    flex: 1;
    min-width: 0; /* CRUCIAL: permite que o texto quebre */
}

.toast-content span {
    display: block;
    font-size: 14px;
    line-height: 1.4;
    text-align: left;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    max-width: 100%;
}

/* Botão de fechar */
.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    color: inherit;
    border-radius: 4px;
    transition: opacity 0.2s, background-color 0.2s;
}

.toast-close:hover {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.1);
}

/* Animações */
@keyframes toastSlideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes toastSlideOut {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-20px);
        opacity: 0;
    }
}

.toast-message.hidden {
    display: none !important;
}

.toast-message.fading-out {
    animation: toastSlideOut 0.3s ease-out forwards;
}

/* ============================================= */
/* RESPONSIVIDADE PARA MOBILE                    */
/* ============================================= */

@media screen and (max-width: 768px) {
    .toast-container {
        top: 10px;
        padding: 0 10px;
    }
    
    .toast-message {
        padding: 12px 14px;
        gap: 10px;
        max-width: 100%;
        margin: 3px 0;
    }
    
    /* Ícone menor em mobile */
    .toast-icon {
        width: 20px;
        height: 20px;
        font-size: 16px;
    }
    
    /* Texto menor e melhor quebrado */
    .toast-content span {
        font-size: 13px;
        line-height: 1.3;
    }
    
    /* Botão de fechar menor */
    .toast-close {
        width: 20px;
        height: 20px;
        font-size: 14px;
    }
}

/* Para telas muito pequenas (mobile pequeno) */
@media screen and (max-width: 480px) {
    .toast-container {
        top: 5px;
        padding: 0 8px;
    }
    
    .toast-message {
        padding: 10px 12px;
        gap: 8px;
        border-radius: 8px;
    }
    
    .toast-icon {
        width: 18px;
        height: 18px;
        font-size: 14px;
    }
    
    .toast-content span {
        font-size: 12px;
        line-height: 1.2;
    }
    
    .toast-close {
        width: 18px;
        height: 18px;
        font-size: 12px;
    }
}

/* Para modo paisagem em mobile */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .toast-container {
        top: 5px;
    }
    
    .toast-message {
        padding: 8px 10px;
        max-width: 90%;
    }
    
    .toast-content span {
        font-size: 12px;
        line-height: 1.2;
    }
}

/* Para telas grandes */
@media screen and (min-width: 1200px) {
    .toast-message {
        max-width: 600px;
    }
}

/* Para telas muito grandes */
@media screen and (min-width: 1600px) {
    .toast-message {
        max-width: 700px;
    }
}

/* ============================================= */
/* UTILITÁRIOS                                   */
/* ============================================= */
.hidden {
    display: none !important;
}

.opacity-0 {
    opacity: 0;
}

.opacity-100 {
    opacity: 1;
}

.transition-opacity {
    transition: opacity 0.3s ease-in-out;
}

.flex {
    display: flex !important;
}

/* Estilos para tema escuro */
[data-theme="dark"] .toast-error {
    background-color: #422;
    color: #f8d7da;
    border-left-color: #ff6b6b;
}

[data-theme="dark"] .toast-warning {
    background-color: #332b00;
    color: #fff3cd;
    border-left-color: #ffd93d;
}

[data-theme="dark"] .toast-info {
    background-color: #0d3c45;
    color: #d1ecf1;
    border-left-color: #4dccbd;
}

[data-theme="dark"] .toast-success {
    background-color: #1e3c29;
    color: #d4edda;
    border-left-color: #6bcf7f;
}

[data-theme="dark"] .toast-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* ************************************************* */
/* ******** Configuração do header principal ******* */
/* ************************************************* */
.header .navbar-logo {
    width: auto;
    height: 100%;
    display: flex;
    flex-direction: row;
    gap: 5px;
    align-items: center;
    justify-content: center;
}

.header .navbar-logo .big-icon {
    padding: 5px 10px;
    font-size: 25px;
    color: #fff;
    margin: auto;
    background: var(--color-primary);
    border-radius: 10px;
}

.header .navbar-logo .logo a {
    font-family: "Audiowide", sans-serif;
    font-weight: 600;
    font-size: 30px;
    margin: 0px 10px;
    transform: none;
}

.header .buttons {
    gap: 15px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    height: 100%;
    align-items: center;
    justify-content: center;
}

.header .buttons a {
    font-size: 15px;
    color: var(--color-text);
    font-weight: 500;
    margin-right: 10px;
}

.header .buttons .btn-logout {
    background-color: var(--color-warning);
    color: #fff;
    padding: 5px 15px;
    border-radius: 10px;
}

.header .buttons .btn-theme {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--color-text);
    padding: 5px 12px;
    border-radius: 10px;
    font-size: 14px;
    padding: 0;
}

/* ************************************************* */
/* ********************** HOME *********&&&********* */
/* ************************************************* */
.home-content h1 {
    font-weight: bolder;
}

/* ************************************************* */
/* ********* Estilização das páginas gerais ******** */
/* ************************************************* */
.container.title h1 {
    font-size: 25px;
    font-weight: 400;
    margin-bottom: 30px;
}

.container .display-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    margin: 20px 0px;
}

.display-row.justify-end {
    justify-content: flex-end;
}

.container .action-button {
    cursor: pointer;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    background-color: var(--color-primary);
    color: var(--color-white);
    font-weight: 600;
    padding: 5px 15px;
    border-radius: 3px;
    box-shadow: 0 2px 2px rgba(0, 0, 0, 0.3);
}

.container .action-button:hover {
    transform: scale(1.05);
}

.container .simulai-form {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    margin: 5px 0px;
}

.container .simulai-form label {
    font-size: 16px;
}

.container .simulai-form select {
    font-size: 15px;
    color: var(--color-text);
    background-color: var(--color-white);
    border: 1px solid var(--color-secondary);
    border-radius: 5px;
    padding: 2px 2px 2px 5px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: border-color 0.2s, box-shadow 0.2s;
}


/* ************************************************* */
/* **** Elementos principais de posicionamento ***** */
/* ************************************************* */
.form-row {
    display: flex;
    flex-direction: column;
    max-width: 400px;
    margin-bottom: 20px;
}

.form-row label {
    font-size: 16px;
}

.form-row input {
    font-size: 15px;
    color: var(--color-text);
    background-color: var(--color-white);
    border: 1px solid var(--color-secondary);
    border-radius: 5px;
    padding: 2px 2px 2px 5px;
}

/* ************************************************* */
/* ********** Bara de rolagem customizada ********** */
/* ************************************************* */
::-webkit-scrollbar {
    width: 10px;           
    height: 10px;          
}

::-webkit-scrollbar-track {
    background: transparent; 
}

::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: 10px;
    border: 2px solid var(--color-background); 
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary-hover, #3d8b40); 
}

::-webkit-scrollbar-corner {
    background: transparent;
}


html {
    scrollbar-width: thin;                   
    scrollbar-color: var(--color-primary) transparent;
}


[data-theme="dark"]::-webkit-scrollbar-thumb {
    border-color: var(--color-background);
}

[data-theme="dark"]::-webkit-scrollbar-thumb:hover {
    background: #a5d6a7; /
}


/* ************************************************* */
/* ******* Responsividade geral para mobile ******** */
/* ************************************************* */
@media (max-width: 768px) {
    nav{
        height: 10vh;
    }
    .header .navbar-logo .big-icon {
        padding: 5px;
        font-size: 14px;
    }
    .header .navbar-logo .logo a {
        font-size: 22px;
        margin: auto;
        margin-right: 10px;
        margin-top: -10px;
    }
    .header .buttons {
        gap: 10px;
        margin-left: 10px;
    }

    .header .buttons a {
        margin-right: 10px;
        font-size: 12px;
    }
    /* .header .logo a { font-size: 22px; } */

}