/* =========================================
   1. VARIABILI E BASE
   ========================================= */
:root {
    --primary-color: #0d6efd;       /* Blu Bootstrap */
    --primary-hover: #0b5ed7;
    --bg-color: #f4f6f9;            /* Grigio chiarissimo per lo sfondo */
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    --card-hover-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
    --chat-me-bg: #dcf8c6;          /* Verde tipo WhatsApp (o usa blu) */
    --chat-partner-bg: #ffffff;
    --radius-standard: 12px;
}

body {
    background-color: var(--bg-color);
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #333;
}

/* Scrollbar personalizzata (più elegante per Chat e Materie) */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f1f1; 
    border-radius: 4px;
}
::-webkit-scrollbar-thumb {
    background: #c1c1c1; 
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8; 
}

/* =========================================
   2. NAVBAR E MENU
   ========================================= */
.navbar {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    background: linear-gradient(90deg, #212529 0%, #343a40 100%);
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* =========================================
   3. CARD (Percorsi, Bacheca, Profilo)
   ========================================= */
.card {
    border: none;
    border-radius: var(--radius-standard);
    box-shadow: var(--card-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background-color: #fff;
    overflow: hidden; /* Per contenere immagini o header colorati */
}

/* Effetto Hover solo sulle card che sono link o cliccabili */
.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-hover-shadow);
}

.card-header {
    border-bottom: 1px solid rgba(0,0,0,0.05);
    font-weight: 600;
}

/* =========================================
   4. HOME: SCROLL CONTAINER MATERIE
   ========================================= */
/* Questo è il codice specifico per ridurre la grandezza della lista materie */
.scroll-container-materie {
    max-height: 250px;       /* Altezza fissa */
    overflow-y: auto;        /* Abilita scroll verticale */
    border: 1px solid #dee2e6;
    padding: 15px;
    border-radius: var(--radius-standard);
    background-color: #fff;
    margin-bottom: 20px;
}

/* Griglia interna per le checkbox */
.grid-materie {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); /* Colonne responsive */
    gap: 10px;
}

.form-check-label {
    cursor: pointer;
    font-size: 0.95rem;
}

/* =========================================
   5. CHAT (Messaggistica)
   ========================================= */
/* Area messaggi scrollabile */
.chat-window {
    height: 450px;
    overflow-y: auto;
    background-color: #e5ddd5; /* Colore di sfondo stile chat */
    background-image: url("https://www.transparenttextures.com/patterns/subtle-white-feathers.png"); /* Pattern opzionale */
    padding: 20px;
    border-radius: 0 0 var(--radius-standard) var(--radius-standard);
    display: flex;
    flex-direction: column;
}

/* Bolla messaggio generica */
.msg-bubble {
    max-width: 75%;
    padding: 10px 15px;
    border-radius: 15px;
    margin-bottom: 10px;
    position: relative;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    word-wrap: break-word;
}

/* Messaggio MIO (destra, blu/verde) */
.msg-mine {
    align-self: flex-end;
    background-color: #d1e7dd; /* Verde chiaro Bootstrap */
    color: #0f5132;
    border-bottom-right-radius: 2px;
}

/* Messaggio PARTNER (sinistra, bianco) */
.msg-partner {
    align-self: flex-start;
    background-color: #fff;
    color: #333;
    border-bottom-left-radius: 2px;
}

.msg-time {
    font-size: 0.70rem;
    opacity: 0.7;
    text-align: right;
    display: block;
    margin-top: 4px;
}

/* =========================================
   6. BACHECA E COMMENTI
   ========================================= */
.post-actions {
    opacity: 0.8;
}
.post-actions:hover {
    opacity: 1;
}

.comment-box {
    background-color: #f8f9fa;
    border-left: 3px solid var(--primary-color);
    margin-top: 15px;
    padding: 10px 15px;
    border-radius: 4px;
}

/* =========================================
   7. PROFILO (Punteggio Affidabilità)
   ========================================= */
.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 2.5rem;
    font-weight: bold;
    color: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.score-high { background: linear-gradient(45deg, #198754, #20c997); } /* Verde */
.score-mid  { background: linear-gradient(45deg, #ffc107, #ffca2c); color: #333; } /* Giallo */
.score-low  { background: linear-gradient(45deg, #dc3545, #ff6b6b); } /* Rosso */

/* Avatar Placeholder (Emoji o Iniziali) */
.avatar-placeholder {
    font-size: 4rem;
    margin-bottom: 10px;
    display: inline-block;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}