/* =============================================================================
   diario.css — Stili per la sezione Diario
   ============================================================================= */

/* Layout — la sidebar usa le regole di .sidebar in style.css (position:fixed).
   Il main usa .main-content in style.css. Qui aggiungiamo solo il padding. */
.diario-sidebar {
    border-right: 1px solid #dee2e6;
}

.diario-main {
    padding: 1.5rem;
}

/* -----------------------------------------------------------------------------
   Wizard — intestazione e step indicator
----------------------------------------------------------------------------- */
.diario-wizard-header {
    padding-bottom: .75rem;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 1rem;
}

.diario-step-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
}

.step-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #dee2e6;
    border: 2px solid #dee2e6;
    transition: background .2s, border-color .2s;
    cursor: default;
}

.step-dot.active {
    background: #0d6efd;
    border-color: #0d6efd;
}

.step-dot.done {
    background: #198754;
    border-color: #198754;
}

/* -----------------------------------------------------------------------------
   Wizard — card step
----------------------------------------------------------------------------- */
.wizard-step .card {
    border-radius: .75rem;
    max-width: 680px;
}

.wizard-step .card-header {
    background: #f8f9fa;
    border-radius: .75rem .75rem 0 0 !important;
    font-size: .95rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #0d6efd;
    color: #fff;
    font-size: .75rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* -----------------------------------------------------------------------------
   Step 1 — lista destinatari
----------------------------------------------------------------------------- */
.recipient-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: .5rem;
}

.recipient-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem .75rem;
    cursor: pointer;
    transition: background .15s;
    border-bottom: 1px solid #f0f0f0;
}

.recipient-item:last-child {
    border-bottom: none;
}

.recipient-item:hover {
    background: #f8f9fa;
}

.recipient-item.selected {
    background: #e7f1ff;
}

.recipient-item.selected .recipient-check {
    color: #0d6efd;
    opacity: 1;
}

.recipient-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.recipient-avatar-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    flex-shrink: 0;
    font-size: 1rem;
}

.sezione-avatar {
    background: #fff3cd;
    color: #856404;
}

.recipient-info {
    flex: 1;
    min-width: 0;
}

.recipient-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recipient-check {
    color: #dee2e6;
    opacity: .5;
    font-size: 1.1rem;
    transition: color .15s, opacity .15s;
}

/* Mode toggle */
.mode-btn.active {
    background: #0d6efd;
    color: #fff;
    border-color: #0d6efd;
}

/* -----------------------------------------------------------------------------
   Step 2 — chip attività rapide
----------------------------------------------------------------------------- */
.attivita-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.attivita-chip {
    border-radius: 2rem;
    font-size: .85rem;
    transition: background .15s, color .15s;
}

.attivita-chip.active {
    background: #0d6efd;
    color: #fff;
    border-color: #0d6efd;
}

/* -----------------------------------------------------------------------------
   Step 3 — textarea e upload foto
----------------------------------------------------------------------------- */
#diarioText {
    font-size: .95rem;
    resize: vertical;
    min-height: 120px;
}

.diario-upload-area {
    border: 2px dashed #dee2e6;
    border-radius: .5rem;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    min-height: 80px;
    padding: .5rem;
}

.diario-upload-area:hover,
.diario-upload-area.drag-over {
    border-color: #0d6efd;
    background: #f0f5ff;
}

.photo-previews {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.photo-preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: .4rem;
    overflow: hidden;
}

.photo-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-remove-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(0,0,0,.55);
    border: none;
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    cursor: pointer;
    padding: 0;
}

.photo-remove-btn:hover {
    background: rgba(220,53,69,.85);
}

/* -----------------------------------------------------------------------------
   Step 4 — anteprima
----------------------------------------------------------------------------- */
.diario-preview-card {
    border: 1px solid #dee2e6;
    border-radius: .75rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
}

.diario-preview-header {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .85rem 1rem;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.diario-preview-avatar {
    flex-shrink: 0;
}

.preview-avatar-img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}

.preview-avatar-placeholder {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #6c757d;
}

.diario-preview-title {
    font-weight: 600;
    font-size: 1rem;
}

.diario-preview-body {
    padding: 1rem;
    background: #fff;
}

.diario-preview-body p {
    color: #333;
    line-height: 1.6;
    margin-bottom: .5rem;
}

.preview-photo {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: .4rem;
    margin-right: .4rem;
    margin-bottom: .4rem;
}

/* -----------------------------------------------------------------------------
   Sidebar — lista bambini
----------------------------------------------------------------------------- */
.sidebar-bambino-item {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .55rem .75rem;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background .12s;
}

.sidebar-bambino-item:hover {
    background: #f0f5ff;
}

.sidebar-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.sidebar-avatar-placeholder {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    flex-shrink: 0;
}

.sidebar-bambino-nome {
    font-size: .875rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* -----------------------------------------------------------------------------
   Storico
----------------------------------------------------------------------------- */
.diario-storico-card {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: .65rem;
    padding: 1rem;
}

.diario-storico-date {
    margin-bottom: .35rem;
    font-size: .8rem;
    text-transform: capitalize;
}

.storico-photos {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-top: .5rem;
}

.storico-photo {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: .4rem;
    cursor: pointer;
}
