/* feed/static/feed/css/style.css */

/* ---------- Base ---------- */

body {
    background-color: #f0f2f5;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Contenitore principale ristretto */
.feed-container {
    max-width: 600px;
    margin: 0 auto;
    padding-top: 20px;
}

/* ---------- Card dei post ---------- */

.post-card {
    background: #ffffff;
    border: none;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    overflow: hidden;
}

/* Contenitore della foto nel feed: centra l'immagine */
.post-image-container {
    display: flex;
    justify-content: center;
    background-color: #f8f9fa;
    border-radius: 12px;
    padding: 8px;
    border: 1px solid #e9ecef;
}

/* Foto nel feed: dimensioni limitate, proporzioni preservate */
.post-image {
    max-width: 100%;
    max-height: 250px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
}

/* ---------- Avatar ---------- */

/* Avatar circolare con l'iniziale */
.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: #0d6efd;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    margin-right: 15px;
    flex-shrink: 0;
}

/* Variante piccola, per la navbar */
.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
    margin-right: 0;
}

/* Variante grande, per l'intestazione del profilo */
.avatar-lg {
    width: 96px;
    height: 96px;
    font-size: 2.4rem;
    margin-right: 0;
}

/* ---------- Form di creazione post ---------- */

/* Casella di testo del post */
.post-input {
    border-radius: 12px;
    background-color: #f0f2f5;
    border: none;
    resize: none;
    padding: 15px;
}

.post-input:focus {
    background-color: #ffffff;
    box-shadow: 0 0 0 2px #0d6efd;
    outline: none;
}

/* Pulsante di pubblicazione arrotondato */
.btn-publish {
    border-radius: 20px;
    padding: 8px 24px;
    font-weight: 600;
}

/* Pulsante + fisso in basso a sinistra dello schermo */
.fab {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    width: 3.5rem;
    height: 3.5rem;
    border: none;
    border-radius: 50%;
    background-color: var(--bs-primary);
    color: #fff;
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    z-index: 1030;
}

.fab:hover {
    filter: brightness(0.9);
}

/* ---------- Messaggi ---------- */

/* Contenitore: sospeso sotto la navbar, centrato */
.messaggi {
    position: fixed;
    top: 5rem;
    left: 50%;
    transform: translateX(-50%);
    width: min(90%, 600px);
    z-index: 1040;
}

/* Singolo messaggio */
.messaggio {
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 12px;
    background-color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    text-align: center;
    font-weight: 500;
}

/* Colori in base al tipo (message.tags) */
.messaggio-success {
    background-color: #d1e7dd;
    color: #0f5132;
}

.messaggio-error {
    background-color: #f8d7da;
    color: #842029;
}

.messaggio-warning {
    background-color: #fff3cd;
    color: #664d03;
}

.messaggio-info {
    background-color: #cff4fc;
    color: #055160;
}

/* ---------- Autenticazione (login e registrazione) ---------- */

/* Card: più stretta del feed e staccata dalla navbar */
.auth-card {
    max-width: 400px;
    margin: 3rem auto 0;
    padding: 2rem;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

/* Icona grande sopra il titolo, nel colore del logo */
.auth-icon {
    font-size: 3rem;
    color: var(--bs-primary);
}

/* Campi grigi e arrotondati, come la textarea dei post */
.auth-input {
    border-radius: 12px;
    background-color: #f0f2f5;
    border: none;
    padding: 0.7rem 1rem;
    transition: background-color 0.2s, box-shadow 0.2s;
}

.auth-input:focus {
    background-color: #ffffff;
    box-shadow: 0 0 0 2px var(--bs-primary);
}

/* Bordo rosso per i campi con errori */
.auth-input.is-invalid {
    box-shadow: 0 0 0 2px var(--bs-danger);
}

/* ---------- Profilo ---------- */

/* Riquadro quadrato della griglia; relative serve a posizionare il cestino */
.profile-grid-item {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 8px;
    background-color: #e9ecef;
}

/* L'immagine riempie il quadrato, ritagliando i bordi in eccesso */
.profile-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Cestino rotondo, in alto a destra sulla foto */
.btn-delete-post {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.55);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.btn-delete-post:hover {
    background-color: var(--bs-danger);
}

/* ---------- Slot ---------- */

/* Card + per uno slot libero */
.slot-vuoto {
    width: 100%;
    border: 2px dashed #ced4da;
    background-color: #f8f9fa;
    color: var(--bs-primary);
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.slot-vuoto:hover {
    background-color: #e7f1ff;
    border-color: var(--bs-primary);
}

/* Card per acquistare altro spazio */
.slot-acquista {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    text-align: center;
    background-color: var(--bs-primary);
    color: #fff;
}