﻿/* ===========================
   Font locali
   =========================== */

@font-face {
    font-family: 'Inter';
    src: url('/fonts/inter/inter-v20-latin-regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('/fonts/inter/inter-v20-latin-500.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('/fonts/inter/inter-v20-latin-600.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('/fonts/inter/inter-v20-latin-700.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Poppins';
    src: url('/fonts/poppins/poppins-v24-latin-regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Poppins';
    src: url('/fonts/poppins/poppins-v24-latin-600.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

/* Impostazioni di base */
html {
    font-size: 12px;
}

/* Body e layout generale */
html {
    position: relative;
    min-height: 100%;
}

body {
    margin-bottom: 1px; /* Distanza dal fondo della pagina per il footer */
    background-color: #ffffff; /* Grigio chiaro per lo sfondo */
    font-family: 'Inter', sans-serif; /* Font di base */
}

/* Alert box */
.alert {
    border-radius: 5px;
    font-size: 16px;
}
/* Titoli principali */
h2, h3 {
    font-family: 'Poppins', sans-serif; /* Font moderno per i titoli */
    font-weight: 600; /* Font più audace */
    color: #333; /* Grigio scuro per i titoli */
}

h2 {
    font-size: 2em;
    margin-bottom: 20px;
}

h3 {
    font-size: 1.5em;
    margin-bottom: 20px;
}

.small-text {
    font-size: 12px;
}

.my-hidden-block {
    display: none;
}

/* Tabella dei risultati INCI */
table {
    width: 100%;
    margin-top: 30px;
    border-collapse: collapse;
}

    table th, table td {
        padding: 12px 15px;
        border: 1px solid #ddd;
        text-align: left;
    }

    table th {
        background-color: #f1f1f1; /* Intestazione grigia chiara */
        font-weight: bold;
    }

    table td {
        background-color: #ffffff;
    }

    table tr:nth-child(even) td {
        background-color: #f9f9f9; /* Alterna il colore delle righe della tabella */
    }

    table tbody tr {
        font-size: 14px;
    }

/* Nasconde la colonna */
.col-funzione {
    display: none;
}

.col-bio,
td:nth-child(7),
td:nth-child(8) {
    width: 80px;
    text-align: center;
}

.tabella-intestazioni-centrate th {
    text-align: center;
}

/* Sezione risultati */
#ocrResult {
    margin-top: 30px;
}

    /* Lista ingredienti */
    #ocrResult ul {
        list-style-type: none;
        padding-left: 0;
        margin-top: 20px;
    }

.ingredient-item {
    background-color: #ffffff; /* Bianco per ogni ingrediente */
    padding: 10px;
    margin: 5px 0;
    border-radius: 5px;
    font-size: 12px !important;
    border: 1px solid #ddd;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: background-color 0.2s ease;
}

    .ingredient-item:hover {
        background-color: #f8f9fa; /* Sfondo grigio chiaro al passaggio del mouse */
    }


/* Input file per l'immagine */
input[type="file"] {
    font-size: 12px;
    margin-bottom: 20px;
}

/* Input field per la ricerca o la selezione */
input[type="text"], textarea {
    border-radius: 10px;
    border: 1px solid #ccc;
    /* padding: 10px 15px; */
    font-size: 12px !important;
    /* margin-bottom: 20px; */
    transition: border-color 0.3s ease;
}

    input[type="text"]:focus, textarea:focus {
        border-color: #007bff; /* Cambia colore bordo quando è selezionato */
    }

/* Completamento del caricamento immagine */
#imagePreview {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#fileNameDisplay {
    font-size: 12px;
    font-weight: bold;
    color: #555;
    margin-top: 15px;
}

/* Container flessibile per input file + pulsanti */
#imageUploadForm .form-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    max-width: 700px; /* massimo larghezza */
    margin-bottom: 20px;
}

/* Input file con crescita e dimensione minima */
#imageUploadForm input[type="file"] {
    flex: 1 1 250px;
    min-width: 250px;
    padding: 6px 12px;
    font-size: 1rem;
    border-radius: 4px;
    border: 1px solid #ccc;
    margin-bottom: 0; /* sovrascrive margine precedente */
}

/* Contenitore pulsanti affiancati */
#imageUploadForm .btn-group {
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
}

/* Pulsanti uniformi e ben leggibili */
#imageUploadForm button {
    white-space: nowrap;
    padding: 8px 16px;
    font-size: 1rem;
    border-radius: 4px;
    min-height: 38px;
}

/* ===========================
   NAVBAR PRINCIPALE
   =========================== */

header .navbar .nav-link {
    font-weight: bold;
    padding: 10px 10px;
    color: #6c757d !important;
    transition: background-color 0.3s ease, color 0.3s ease;
}

    /* Menu attivo */
    header .navbar .nav-link.active {
        background-color: #a18fff !important;
        color: white !important;
    }

    /* Hover */
    header .navbar .nav-link:hover {
        background-color: #a18fff !important;
        color: white !important;
    }

/* ===========================
   NAVBAR LAYER FIX
   (dropdown sopra al contenuto)
   =========================== */

header .navbar-collapse {
    position: relative;
    z-index: 1000;
}

header .navbar-nav .dropdown-menu {
    z-index: 1100;
}

/* Logo */

.navbar-logo {
    height: 50px;
    width: auto;
    object-fit: contain;
    transition: transform 0.2s ease;
}

    .navbar-logo:hover {
        transform: scale(1.03);
    }


/* ===========================
   MENU CENTRALE SOLO DESKTOP
   =========================== */

@media (min-width: 769px) {

    header .navbar-collapse {
        position: relative;
    }

        header .navbar-collapse .navbar-nav.mx-auto {
            position: absolute;
            left: 50%;
            transform: translateX(-50%);
            white-space: nowrap;
        }
}


/* Icona utente vicina al menu */

header .navbar .dropdown {
    margin-left: 10px;
}


/* Lingue a destra */

header .navbar .navbar-nav.ms-auto {
    margin-left: auto !important;
}

    /* AGGIUNTO PER CONTACT FORM MA DOVRA' ESSERE IMPLEMENTATO PER TUTTI I CAMPI DI INPUT*/

.contact-form .contact-input {
    border-radius: 0; /* Rimuovi il border-radius, rendendolo rettangolare */
}

/* AGGIUNTO PER ZOOM IMAGE */

.zoom-container {
    overflow: hidden;
    position: relative;
}

.zoom-img {
    transition: transform 0.15s ease;
    cursor: zoom-in;
}

#preloadScreen {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    cursor: pointer;
    background: #000;
    opacity: 0;
    transition: opacity 0.4s ease;
}

    #preloadScreen.ready {
        opacity: 1;
    }

#preloadImage {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block; /* IMPORTANTISSIMO */
}

.welcome-text {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: inherit; /* eredita il font globale, cioè Inter */
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 400;
    letter-spacing: 0.18em;
    color: #ffffff;
    text-transform: uppercase;
    text-align: center;
    pointer-events: none;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
    animation: fadeInUp 1.6s ease-out;
}

    .welcome-text span.brand-name {
        font-weight: 600;
        letter-spacing: 0.28em;
        text-shadow: 0 0 12px rgba(255, 255, 255, 0.25);
        margin-left: 0.2em;
    }

/* Colori per i vari temi */
.brand-orange {
    color: #ff6f00; /* arancione */
}

.brand-forest {
    color: #228B22; /* verde foresta */
}

/* Colori per i vari temi */
.brand-mare-celeste {
    color: #00bfff; /* Celeste (Cielo/Acqua chiara) */
}

.brand-acqua-turchese {
    color: #40e0d0; /* Turchese (mare tropicale) */
}

.brand-sabbia {
    color: #f4a261; /* Sabbia (colore caldo per contrastare il celeste) */
}

.brand-bianco {
    color: #ffffff; /* Bianco (come la schiuma delle onde) */
}

.brand-scuro {
    color: #2c3e50; /* Blu scuro (per contrasto, come il cielo al tramonto) */
}

/* Possibile utilizzo per sfondi */
.bg-mare-celeste {
    background-color: #00bfff; /* Sfondo celeste */
}

.bg-acqua-turchese {
    background-color: #40e0d0; /* Sfondo turchese */
}

.bg-sabbia {
    background-color: #f4a261; /* Sfondo sabbia */
}

.bg-bianco {
    background-color: #ffffff; /* Sfondo bianco */
}

.bg-scuro {
    background-color: #2c3e50; /* Sfondo blu scuro */
}

.bg-celeste {
    background-color: #e6f4ff;
}

.bg-grigetto {
    background-color: #f8f9fa;
}

/* animazione */
@keyframes fadeInUp {
    from {
            opacity: 0;
            transform: translateY(20px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    /* Card fonti */
    .source-icon {
    flex: 0 0 48px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

    .source-icon img {
        max-width: 36px;
        height: auto;
    }

.source-content {
    flex: 1 1 auto;
}

/* Hover effetto link */
.hover-primary:hover {
    color: #0d6efd !important; /* bootstrap primary */
    text-decoration: underline;
}

/* Tablet & desktop */
@media (min-width: 768px) {
    html {
        font-size: 16px;
    }

    footer h5 {
        font-size: 1.25rem;
    }

    footer p, footer a {
        font-size: 0.9rem;
    }
}

/* Mobile */
@media (max-width: 767px) {
    footer h5 {
        font-size: 1.1rem;
    }

    footer p, footer a {
        font-size: 0.875rem;
    }
}

/* Hover link */
footer a:hover {
    color: #0d6efd !important;
    text-decoration: underline;
}

.highlight-red {
    box-shadow: 0 0 10px 2px red;
    transition: box-shadow 0.5s ease-out;
}

/* Effetto evidenziazione soft */
.highlight-flash {
    animation: highlightFade 1.5s ease;
}

@keyframes highlightFade {
    0% {
        background-color: rgba(255, 230, 0, 0.7);
    }

    100% {
        background-color: transparent;
    }
}

.hidden-force {
    display: none !important;
}
/* Bottone solo icona - dimensioni e centratura */
.btn-icon-only {
    padding: 0.25rem;
    width: 60px;
    height: 60px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* Nuovi stili per il look tondeggiante */
    background-color: #F0F4F9; /* colore di background */
    border: none; /* nessun bordo */
    border-radius: 50%; /* rende il bottone perfettamente tondo */
    box-shadow: none; /* rimuove eventuali ombre di bootstrap */
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

    /* Dimensioni icona */
    .btn-icon-only .icon-img {
        width: 30px;
        height: 30px;
    }

    /* Hover: cambio colore background + leggera scala */
    .btn-icon-only:hover {
        background-color: #D3E3FD;
        transform: scale(1.05);
    }

    .btn-icon-only,
    .btn-icon-only:hover,
    .btn-icon-only:focus,
    .btn-icon-only:active,
    .btn-icon-only:focus-visible {
        border-radius: 50% !important;
    }

/* Rimuove qualsiasi bordo o effetto hover di Bootstrap */
.btn-outline-secondary.btn-icon-only {
    border: none !important;
    box-shadow: none !important;
}

/* Pulsanti personalizzati con colori specifici */
#submitBtn, #checkInciBtn1, #addRowBtn {
    background-color: #1F70B9; /* colore di sfondo */
    border-color: #0C4F8B; /* colore bordo */
    border-width: 1px; /* spessore bordo */
    color: white; /* colore testo bianco per contrasto */
    transition: background-color 0.3s ease, border-color 0.3s ease;
    padding-left: 15px;
    padding-right: 15px;
    padding-top: 5px;
    padding-bottom: 5px;
    border-radius: 50px;
}

    /* Hover (anche se disabilitati, per sicurezza) */
    #submitBtn:hover:not(:disabled),
    #checkInciBtn1:hover:not(:disabled) {
        background-color: #0C4F8B; /* colore sfondo hover */
        border-color: #0C4F8B; /* bordo hover */
        color: white;
        cursor: pointer;
    }

    /* Stato disabilitato */
    #submitBtn:disabled,
    #checkInciBtn1:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

/* Bottoni verifica, elimina, avvisa */
.save-inci, .delete-inci, .notfound-inci {
    /*width: 50px;
    height: 50px;
    padding: 0.25rem; 
    display: inline-flex;*/
    align-items: center;
    justify-content: center;
    background-color: transparent !important;
    border: none !important;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

    /* Dimensioni icona interna */
    .save-inci .icon-img, .delete-inci .icon-img, .notfound-inci .icon-img {
        width: 25px;
        height: 25px;
    }

    /* Hover: funziona anche sopra Bootstrap */
    .save-inci:hover,
    .delete-inci:hover,
    .notfound-inci:hover {
        /*background-color: #D3E3FD !important; /* forza il celestino */
        transform: scale(1.05);
        background-color: #dfdfdf !important;
        border-radius: 4px;
    }

.drag-handle {
    cursor: move;
    margin-right: 5px;
    color: #888;
    font-weight: bold;
}

    .drag-handle:hover {
        color: #333;
    }

/* Riga selezionata */
.dragging-chosen {
    background-color: #ffeeba; /* colore chiaro evidenziato */
}

/* Riga fantasma mentre viene trascinata */
.dragging-ghost {
    opacity: 0.6;
    background-color: #d4edda; /* verde chiaro trasparente */
}

.lang-flag {
    border-radius: 2px;
    opacity: 0.65;
    transition: all 0.15s ease-in-out;
}

@media (max-width: 768px) {
    .lang-flag {
        width: 16px !important;
        height: auto;
    }
}

/* hover */
.lang-item:hover .lang-flag {
    opacity: 1;
    transform: scale(1.08);
}

/* lingua attiva */
.active-lang .lang-flag {
    opacity: 1 !important;
    transform: scale(1.08);
}

/* sottolineatura */
.active-lang {
    position: relative;
}

    .active-lang::after {
        content: "";
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        bottom: -6px; /* più sotto della bandiera */
        width: 70%;
        height: 2px;
        background-color: #a18fff;
        border-radius: 2px;
    }
