/* ============================================================
   PIANIFICAZIONE GIORNALIERA - Stili
   File: daily-plans.css
   Versione: 1.0
   ============================================================ */

/* ============================================================
   LAYOUT PRINCIPALE
   ============================================================ */

#daily-plans-view {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

#daily-plans-calendar {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

#daily-plans-list {
    margin-bottom: 30px;
}


/* ============================================================
   CALENDARIO HEADER
   ============================================================ */

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ecf0f1;
}

.calendar-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
}

.btn-calendar-nav {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s;
}

.btn-calendar-nav:hover {
    background: #2980b9;
    transform: scale(1.05);
}

/* ============================================================
   GRIGLIA CALENDARIO
   ============================================================ */

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.calendar-day-name {
    text-align: center;
    font-weight: 600;
    color: #7f8c8d;
    padding: 10px;
    font-size: 14px;
}

.calendar-day {
    aspect-ratio: 1;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    background: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.calendar-day:hover {
    border-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.calendar-day.empty {
    border: none;
    cursor: default;
    background: transparent;
}

.calendar-day.today {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    border-color: #2980b9;
}

.calendar-day.today .day-number {
    color: white;
    font-weight: 700;
}

.calendar-day.selected {
    background: #e8f5e9;
    border-color: #27ae60;
    border-width: 3px;
}

.day-number {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.day-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 4px;
    transition: all 0.3s;
}

.day-indicator.has-plans {
    background: #27ae60;
    box-shadow: 0 0 8px rgba(39, 174, 96, 0.6);
}

/* ============================================================
   LISTA PIANI GIORNO
   ============================================================ */

.day-plans-header {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.day-plans-header h3 {
    margin: 0;
    font-size: 22px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.empty-state p {
    font-size: 18px;
    color: #7f8c8d;
    margin-bottom: 20px;
}

/* ============================================================
   CARD PIANO
   ============================================================ */

.plan-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-left: 4px solid #3498db;
    transition: all 0.3s;
}

.plan-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.plan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ecf0f1;
}

.plan-user {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
}

.user-icon {
    font-size: 24px;
}

.plan-actions {
    display: flex;
    gap: 10px;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 6px;
    transition: all 0.3s;
}

.btn-icon:hover {
    background: #ecf0f1;
    transform: scale(1.1);
}

/* ============================================================
   DESTINAZIONI
   ============================================================ */

.plan-destinations {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.destination-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 3px solid #27ae60;
}

.destination-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 16px;
}

.destination-number {
    background: #27ae60;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.destination-detail {
    padding: 5px 0 5px 34px;
    color: #555;
    font-size: 14px;
}

.destination-notes {
    padding: 10px 0 5px 34px;
    color: #666;
    font-size: 14px;
    font-style: italic;
}

.no-destinations {
    text-align: center;
    color: #95a5a6;
    padding: 20px;
    font-style: italic;
}

/* ============================================================
   MODAL FORM
   ============================================================ */

#daily-plan-form {
    max-width: 600px;
}

#destinations-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 15px;
}

.destination-row {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 3px solid #3498db;
}

.destination-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-weight: 600;
    color: #2c3e50;
}

.btn-remove {
    background: #e74c3c;
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    transition: all 0.3s;
}

.btn-remove:hover {
    background: #c0392b;
    transform: rotate(90deg);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.form-row:has(input[type="time"]) {
    grid-template-columns: 1fr 1fr;
}

.destination-row input,
.destination-row textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.destination-row textarea {
    resize: vertical;
    font-family: inherit;
}

/* ============================================================
   RESPONSIVE MOBILE
   ============================================================ */

@media (max-width: 768px) {
    #daily-plans-view {
        padding: 10px;
    }
    
    #daily-plans-calendar {
        padding: 15px;
    }
    
    .calendar-header h3 {
        font-size: 18px;
    }
    
    .btn-calendar-nav {
        padding: 8px 15px;
        font-size: 16px;
    }
    
    .calendar-day-name {
        font-size: 12px;
        padding: 5px;
    }
    
    .calendar-grid {
        gap: 4px;
    }
    
    .calendar-day {
        padding: 4px;
    }
    
    .day-number {
        font-size: 14px;
    }
    
    .day-indicator {
        width: 6px;
        height: 6px;
    }
    
    .plan-card {
        padding: 15px;
    }
    
    .plan-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .destination-detail,
    .destination-notes {
        padding-left: 10px;
        font-size: 13px;
    }
    
    
    .form-row:has(input[type="time"]) {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .calendar-header h3 {
        font-size: 16px;
    }
    
    .btn-calendar-nav {
        padding: 6px 12px;
        font-size: 14px;
    }
    
    .day-number {
        font-size: 12px;
    }
    
    .day-indicator.has-plans {
        width: 4px;
        height: 4px;
    }
}

/* ============================================================
   PRINT STYLES
   ============================================================ */

@media print {
    
    .plan-actions,
    .btn-calendar-nav {
        display: none !important;
    }
    
    .plan-card {
        page-break-inside: avoid;
    }
}

/* ============================================================
   TECHNICIAN CARDS (Collassabili)
   ============================================================ */

.technicians-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.technician-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-left: 4px solid #3498db;
    overflow: hidden;
    transition: all 0.3s;
}

.technician-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.technician-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    cursor: pointer;
    user-select: none;
    transition: background 0.3s;
}

.technician-header:hover {
    background: #f8f9fa;
}

.technician-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.tech-icon {
    font-size: 32px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.tech-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.tech-details strong {
    font-size: 18px;
    color: #2c3e50;
}

.dest-count {
    font-size: 14px;
    color: #7f8c8d;
}

.tech-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-icon-small {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 5px 8px;
    border-radius: 6px;
    transition: all 0.3s;
}

.btn-icon-small:hover {
    background: #ecf0f1;
    transform: scale(1.1);
}

.expand-arrow {
    font-size: 16px;
    color: #3498db;
    transition: transform 0.3s;
    margin-left: 10px;
}

.technician-plan-content {
    padding: 0 20px 20px 20px;
    border-top: 1px solid #ecf0f1;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.destinations-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
}

/* ============================================================
   RESPONSIVE TECHNICIAN CARDS
   ============================================================ */

@media (max-width: 768px) {
    .technician-header {
        padding: 15px;
    }
    
    .tech-icon {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
    
    .tech-details strong {
        font-size: 16px;
    }
    
    .dest-count {
        font-size: 13px;
    }
    
    .btn-icon-small {
        font-size: 16px;
        padding: 4px 6px;
    }
}

@media (max-width: 480px) {
    .technician-info {
        gap: 10px;
    }
    
    .tech-icon {
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
    
    .tech-details strong {
        font-size: 14px;
    }
    
    .tech-actions {
        flex-wrap: wrap;
    }
}

/* ============================================================
   TECHNICIANS SUMMARY (Riepilogo tecnici)
   ============================================================ */

.technicians-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.tech-summary-item {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

@media (max-width: 768px) {
    .technicians-summary {
        gap: 8px;
    }
    
    .tech-summary-item {
        padding: 6px 12px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .technicians-summary {
        flex-direction: column;
        gap: 6px;
    }
    
    .tech-summary-item {
        font-size: 12px;
    }
}

/* ============================================================
   HEADER CON PULSANTE AGGIUNGI
   ============================================================ */

.day-plans-header .header-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.btn-add-plan {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.5);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-add-plan:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: white;
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .day-plans-header .header-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .btn-add-plan {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .btn-add-plan {
        padding: 8px 16px;
        font-size: 13px;
    }
}
