/* ==========================
📌 **LAYOUT GENERALE**
========================== */
body {
    font-family: Arial, sans-serif;
}

/* 📌 Titolo sottotitolo */
.gct-subtitle {
    font-size: 21px !important;
    margin-bottom: 20px !important;
}

/* ==========================
📌 **LAYOUT DEI TRACKER**
========================== */

/* 📌 Contenitore principale - Correzione spaziatura ai lati */
.gct-container {
    width: calc(100% - 60px); /* Sottrae 30px per lato */
    max-width: 1200px; /* Mantiene un limite massimo su desktop */
    margin: 0 auto; /* Centra il contenuto */
    padding: 0 30px; /* Aggiunge padding di 30px su entrambi i lati */
    box-sizing: border-box; /* Evita calcoli errati della larghezza */
}
/* 📌 Griglia dei tracker - Aggiunta margini corretti */
.gct-tracker-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(450px, 1fr)); /* Mantiene adattabilità */
    gap: 20px;
    margin: 0 auto; /* Centra la griglia senza margini extra */
    padding: 0; /* Evita spazi aggiuntivi */
    box-sizing: border-box;
}

/* 📌 Card del tracker */
/* 📌 Tracker - Spaziatura migliorata */
.gct-tracker {
    width: 100%;
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-left: 5px solid #c0c0c0; /* ✅ Ripristina il bordo a sinistra */
    box-sizing: border-box; /* Evita overflow */
    margin: 0; /* Elimina eventuali margini extra */
}

/* 📌 Titolo del tracker */
.gct-tracker-title {
    margin: 0;
    font-size: 1.5em;
    font-weight: bold;
    color: lightslategray;
}

/* 📌 Stato e scadenza */
.gct-tracker-status, .gct-tracker-deadline {
    margin: 5px 0;
    font-size: 0.9em;
    color: #555;
}

/* ==========================
📌 **BADGE DELLO STATO**
========================== */

.gct-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 14px;
    gap: 5px; /* Spazio tra icona e testo */
}

/* 📌 Stati con colori */
.status-in_attesa { background: orange; color: white; }
.status-in_corso { background: royalblue; color: white; }
.status-completato { background: green; color: white; }
.status-in_ritardo { background: hotpink; color: white; }
.status-in_forte_ritardo { background: red; color: white; }

/* ==========================
📌 **BARRA DI AVANZAMENTO**
========================== */

.gct-progress-container {
    width: 100%;
    height: 20px;
    background: #eaeaea;
    border-radius: 5px;
    overflow: hidden;
    margin: 8px 0;
}

.gct-progress-bar {
    height: 100%;
    color: white;
    text-align: center;
    font-size: 12px;
    line-height: 20px;
    transition: width 0.5s ease-in-out;
}

/* 📌 Colori dinamici della barra */
.gct-progress-bar[data-progress="0"] { background: #ccc; }
.gct-progress-bar[data-progress="1"],
.gct-progress-bar[data-progress="49"] { background: #f39c12; }
.gct-progress-bar[data-progress="50"],
.gct-progress-bar[data-progress="99"] { background: #2ecc71; }
.gct-progress-bar[data-progress="100"] { background: #27ae60; }

/* ==========================
📌 **FILTRI E ORDINAMENTO**
========================== */

/* 📌 Contenitore dei filtri e dell'ordinamento */
.gct-header-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    gap: 10px;
}

/* 📌 Contenitore dei filtri */
.gct-filter-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start; /* Allinea i filtri in orizzontale */
    gap: 10px;
}

/* 📌 Stile per i bottoni dei filtri */
.gct-filter-btn {
    background: #fff;
    border: 2px solid #ccc;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
}

/* 📌 Bottone attivo */
.gct-filter-btn.active {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

/* 📌 Contenitore del selettore */
.gct-sort-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 📌 Stile del select */
#gct-sort {
    appearance: none;
    background-color: white;
    border: 2px solid #0073aa;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    outline: none;
}

/* 📌 Aggiunta di un'icona dropdown */
#gct-sort {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="%230073aa"><path d="M7 10l5 5 5-5H7z"></path></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px;
    padding-right: 30px;
}

/* 📌 Bottone di inversione dell'ordinamento */
#gct-toggle-order {
    background: #0073aa;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease-in-out;
}

/* 📌 Cambia icona quando cambia l'ordinamento */
#gct-toggle-order.asc::after {
    content: " ⬆️";
}

#gct-toggle-order.desc::after {
    content: " ⬇️";
}

/* ==========================
📌 **STILE DEI TASK**
========================== */

/* 📌 Griglia dei task */
.gct-task-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* 4 colonne fisse */
    gap: 10px;
}

/* 📌 Task */
.gct-task {
    display: inline-block;
    padding: 6px 12px;
    margin: 5px;
    font-size: 14px;
    font-weight: bold;
    border-radius: 8px;
    background: #f3f3f3;
    color: #333;
    text-align: center;
    transition: all 0.3s ease-in-out;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.gct-task.completed {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* ==========================
📌 **RESPONSIVE DESIGN**
========================== */

/* 📌 Forza la larghezza della pagina a essere responsive */
html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden; /* Evita scroll orizzontali indesiderati */
}

/* 📌 Imposta il contenitore principale a tutta larghezza */
.gct-container, .site, .wrapper, .main-container { /* Sostituisci con il contenitore del tuo tema se ha un nome specifico */
    width: 100%;
    max-width: 100vw;
    margin: 0 auto;
    padding: 0;
}

/* 📌 I filtri e il selettore di ordinamento devono adattarsi */
@media (max-width: 768px) {
    .gct-header-container {
        width: 100vw;
        max-width: 100%;
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    .gct-filter-container, .gct-sort-container {
        width: 100%;
        max-width: 100%;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .gct-filter-btn, #gct-sort, #gct-toggle-order {
        width: 100%;
        max-width: 100%;
        text-align: center;
    }
}
/*ADATTAMENTI SCHERMO*/
/* 📌 Evita overflow e assicura che tutto stia dentro la pagina */
html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* 📌 Corregge eventuali padding/margin extra dei contenitori */
.gct-container, .site, .wrapper, .main-container {
    width: 100%;
    max-width: 100vw;
    margin: 0 auto;
    padding: 0;
}

/* 📌 Assicura che i tracker non escano fuori dallo schermo */
.gct-tracker-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 100%;
}

/* 📌 Adatta le card dei tracker */
.gct-tracker {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
#gct-client-filter {
    appearance: none;
    background-color: white;
    border: 2px solid #0073aa;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    outline: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="%230073aa"><path d="M7 10l5 5 5-5H7z"></path></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px;
    padding-right: 30px;
}