:root {
    --verde: #2e7d32;
    --verde-claro: #4caf50;
    --azul: #1e88e5;
    --amarelo: #fbc02d;
    --vermelho: #e53935;
    --cinza: #f4f4f4;
    --cinza-escuro: #555;
    --cinza-claro: #e8e8e8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: "Segoe UI", Arial, sans-serif;
    background: var(--cinza);
    color: #333;
    display: flex;
    flex-direction: column;
}
/* ===== HEADER ===== */
header {
    background: var(--verde);
    color: white;
    padding: 10px 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

header .logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

header .logo img {
    height: 50px; 
    width: auto; 
    border-radius: 5px; 
}

header .logo-text {
    display: flex;
    flex-direction: column;
}

header .logo-text .nome {
    font-size: 22px;
    font-weight: bold;
    line-height: 1;
}

header .logo-text .slogan {
    font-size: 14px;
    font-weight: normal;
    line-height: 1;
    opacity: 0.9;
}

/* Navegação */
header nav a {
    color: white;
    margin-left: 20px;
    text-decoration: none;
    font-size: 14px;
}

header nav a:hover {
    text-decoration: underline;
}

/* Responsivo para mobile */
@media (max-width: 600px) {
    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    header nav {
        width: 100%;
        display: flex;
        justify-content: flex-start;
        gap: 15px;
    }
    header nav a { margin-left: 0; }
}



/* ===== MAIN ===== */
main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
}

.card {
    background: white;
    max-width: 700px;
    width: 100%;
    min-height: 300px;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0,0,0,.15);
    position: relative;
}


/* ===== TEXTO ===== */
h1 {
    text-align: center;
    margin-bottom: 10px;
}

.subtitulo {
    text-align: center;
    font-size: 14px;
    color: var(--cinza-escuro);
    margin-bottom: 20px;
}

/* ===== DROP AREA ===== */
.drop-area {
    border: 2px dashed var(--verde);
    padding: 30px;
    text-align: center;
    cursor: pointer;
    border-radius: 10px;
    transition: 0.3s;
    background: white;
    margin-bottom: 15px;
}

.drop-area.dragover {
    background: #e8f5e9;
    border-color: var(--verde-claro);
    transform: scale(1.02);
}

.drop-area p {
    font-size: 14px;
    color: var(--cinza-escuro);
}

.drop-area input {
    display: none;
}

/* ===== INFO ===== */
.info {
    font-size: 14px;
    margin-bottom: 10px;
}

/* ===== IMAGEM ===== */
#preview-container {
    position: relative; 
    display: inline-block;
    max-width: 100%;
    margin-top: 15px;
}

#preview {
    max-width: 100%;
    display: block; 
    border-radius: 10px;
    border: 1px solid #ccc;
    z-index: 5; 
}

#canvas {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10; 
    pointer-events: none;  
    width: 100%; 
    height: 100%; 
}

/* ===== BOTÕES ===== */
.botoes {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

button {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: 0.3s;
}

.primario {
    background: var(--verde);
    color: white;
}

.primario:hover:enabled {
    background: var(--verde-claro);
}

.primario:disabled {
    background: #a5d6a7;
    cursor: not-allowed;
}

.secundario {
    background: #ababab;
}

.secundario:hover {
    background: #bdbdbd;
}

.secundario:disabled {
    background: #dbdbdb;
    cursor: not-allowed;
}

/* ===== RESULTADO ===== */
.resultado {
    margin-top: 20px;
    border-top: 1px solid #ddd;
    padding-top: 15px;
}

/* ===== BARRA DE CONFIANÇA ===== */

.barra-confianca {
    height: 20px;
    background-color: #ff9800;
    margin-top: 5px;
    border-radius: 15px;
    margin-bottom: 10px;
    position: relative;
    text-align: center;
    color: white;
}


.barra-confianca > div {
    height: 100%;
    width: 0;
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    color: black;
    transition: width 0.5s, background 0.5s;
}

/* ===== FEEDBACK VISUAL ===== */
.feedback {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
}

.feedback label {
    flex: 1 1 45%;
    padding: 10px;
    border: 2px solid #ccc;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s;
    background: white;
    font-weight: bold;
}

.feedback input[type="radio"] {
    display: none;
}

.feedback label.checked {
    border-color: var(--verde);
    background: #e8f5e9;
    box-shadow: 0 0 10px rgba(46,125,50,0.3);
}

/* ===== CATEGORIA CORRETA ESTILIZADA ===== */
#correcao {
    margin-top: 10px;
}

#categoriaCorreta {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 16px;
    background: #f9f9f9;
    margin-bottom: 10px;
}

/* ===== DESTAQUE DE CATEGORIA ===== */
.categoria-destacada {
    font-weight: bold;
    padding: 3px 10px;
    border-radius: 5px;
    color: rgb(3, 1, 124);
}

.categoria-Plástico { background: #4caf50; }
.categoria-Papel { background: #1e88e5; }
.categoria-Metal { background: #757575; }
.categoria-Vidro { background: #00bcd4; }
.categoria-Orgânico { background: #fbc02d; color: #333; }
.categoria-Não\ é\ lixo { background: #9e9e9e; }

/* ===== FOOTER ===== */
footer {
    background: #222;
    color: #ccc;
    text-align: center;
    padding: 15px;
    font-size: 13px;
}

.objeto-item {
    margin-bottom: 10px;
    font-size: 14px;
}

/* ===== LOADER ===== */
.loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 15px;
    z-index: 10;
}

.loader .spinner {
    border: 6px solid #f3f3f3;
    border-top: 6px solid var(--verde);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: girar 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes girar {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader p {
    font-size: 16px;
    color: var(--cinza-escuro);
    font-weight: bold;
}

/* ===== RESPONSIVO ===== */
@media (max-width: 600px) {
    .feedback label { flex: 1 1 100%; }
    header { flex-direction: column; gap: 10px; }
    .card {
        padding: 20px; 
    }

    #preview-container {
        max-width: 100%;
        width: 100%;
        height: auto;
    }

    #canvas {
        width: 100%;
        height: auto;
    }
}
