/* Piero Frontend Calendar - Stile Minimal e Pulito */

.piero-calendar {
    max-width: 1200px;
    margin: 20px auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Header */
.calendar-header {
    padding: 30px;
    border-bottom: 1px solid #eee;
    text-align: center;
    background: white;
}

.calendar-header h2 {
    font-size: 2em;
    color: #2c3e50;
    margin: 0 0 10px 0;
    font-weight: 600;
}

.calendar-header p {
    margin: 0;
    color: #666;
    font-size: 16px;
}

/* Navigazione */
.cal-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 30px 15px 30px;
    border-bottom: 1px solid #eee;
}

.cal-nav a {
    background: #0073aa;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
}

.cal-nav a:hover {
    background: #005177;
    color: white;
}

.month-year {
    font-size: 1.5em;
    color: #2c3e50;
    font-weight: 600;
    margin: 0;
}

/* Tabella calendario */
.cal-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.cal-table th {
    background: #f8f9fa;
    color: #333;
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    border: 1px solid #eee;
    width: 14.28%;
}

.cal-table td {
    padding: 8px;
    text-align: center;
    border: 1px solid #eee;
    height: 80px;
    vertical-align: top;
    position: relative;
    background: white;
    width: 14.28%;
    cursor: pointer;
    transition: background 0.2s;
}

.cal-table td.empty {
    background: #f8f9fa;
    cursor: default;
}

.cal-table td:hover {
    background: #f0f0f0;
}

.cal-table td.has-bookings {
    background: #e8f5e8;
}

.cal-table td.has-bookings:hover {
    background: #d4edda;
}

.cal-table td.today {
    background: #fff3cd;
    font-weight: bold;
}

.cal-table td.selected {
    background: #bbdefb !important;
}

.day-number {
    font-weight: normal;
    color: #333;
    font-size: 14px;
    margin: 0;
}

.cal-table td.today .day-number {
    font-weight: bold;
}

.booking-count {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: #28a745;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
}

/* Sezione dettagli */
#day-details {
    background: white;
    border-top: 1px solid #eee;
}

.details-header {
    background: white;
    padding: 20px 30px;
    border-bottom: 1px solid #eee;
}

.details-header h4 {
    margin: 0;
    font-size: 1.3em;
    color: #2c3e50;
    font-weight: 600;
}

.details-content {
    padding: 30px;
}

/* Tabella prenotazioni */
.bookings-table {
    background: white;
    border: 1px solid #eee;
    border-radius: 4px;
}

.table-header {
    background: #f8f9fa;
    display: grid;
    grid-template-columns: 80px 140px 1fr 1fr 100px;
    gap: 16px;
    padding: 16px;
    border-bottom: 1px solid #eee;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.booking-row {
    display: grid;
    grid-template-columns: 80px 140px 1fr 1fr 100px;
    gap: 16px;
    padding: 16px;
    border-bottom: 1px solid #eee;
    align-items: start;
    transition: background 0.15s ease;
}

.booking-row:last-child {
    border-bottom: none;
}

.booking-row:hover {
    background: #f8f9fa;
}

.order-number {
    color: #0073aa;
    font-weight: 600;
    text-decoration: none;
    font-size: 14px;
}

.order-number:hover {
    text-decoration: underline;
    color: #005177;
}

.time-slot {
    font-weight: 500;
    color: #2c3e50;
    font-size: 14px;
}

.client-info {
    color: #2c3e50;
}

.client-name {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 14px;
    color: #2c3e50;
}

.client-contact {
    font-size: 12px;
    color: #666;
    margin-bottom: 2px;
    line-height: 1.4;
}

.client-contact a {
    color: #0073aa;
    text-decoration: none;
}

.client-contact a:hover {
    text-decoration: underline;
}

.product-name {
    color: #666;
    font-size: 14px;
    line-height: 1.4;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.status-prenotato {
    background: #fff3cd;
    color: #856404;
}

.status-badge.status-completed {
    background: #d4edda;
    color: #155724;
}

.status-badge.status-processing {
    background: #d1ecf1;
    color: #0c5460;
}

.no-bookings {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 15px;
}

/* Responsive */
@media (max-width: 768px) {
    .piero-calendar {
        margin: 10px;
        border-radius: 6px;
    }
    
    .calendar-header {
        padding: 20px;
    }
    
    .calendar-header h2 {
        font-size: 1.6em;
    }
    
    .cal-nav {
        padding: 0 20px 15px 20px;
    }
    
    .month-year {
        font-size: 1.3em;
    }
    
    .cal-table th,
    .cal-table td {
        padding: 8px 4px;
    }
    
    .cal-table td {
        height: 50px;
    }
    
    .day-number {
        font-size: 13px;
    }
    
    .booking-count {
        width: 16px;
        height: 16px;
        font-size: 9px;
        bottom: 1px;
        right: 1px;
    }
    
    .details-header,
    .details-content {
        padding: 15px 20px;
    }
    
    .details-header h4 {
        font-size: 1.2em;
    }
    
    /* Mobile: Layout a lista */
    .table-header {
        display: none;
    }
    
    .booking-row {
        display: block;
        padding: 15px;
        margin-bottom: 10px;
        border: 1px solid #eee;
        border-radius: 4px;
        background: white;
    }
    
    .booking-row .order-number {
        font-size: 16px;
        font-weight: 700;
        display: block;
        margin-bottom: 8px;
        color: #0073aa;
    }
    
    .booking-row .time-slot {
        font-size: 15px;
        font-weight: 600;
        display: block;
        margin-bottom: 8px;
        color: #2c3e50;
    }
    
    .booking-row .client-name {
        font-size: 15px;
        margin-bottom: 4px;
    }
    
    .booking-row .product-name {
        margin: 8px 0;
        font-size: 13px;
    }
    
    .booking-row .status-badge {
        margin-top: 8px;
    }
}

@media (max-width: 480px) {
    .calendar-header {
        padding: 15px;
    }
    
    .calendar-header h2 {
        font-size: 1.4em;
    }
    
    .cal-nav {
        padding: 0 15px 10px 15px;
    }
    
    .month-year {
        font-size: 1.2em;
    }
    
    .cal-nav a {
        padding: 6px 10px;
        font-size: 14px;
    }
    
    .cal-table td {
        height: 45px;
    }
    
    .day-number {
        font-size: 12px;
    }
    
    .booking-count {
        width: 14px;
        height: 14px;
        font-size: 8px;
    }
    
    .details-header,
    .details-content {
        padding: 12px 15px;
    }
}