/* Enhanced Calendar Styling */
.sm-calendar-container {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-top: 20px;
}

.sm-loading-calendar {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #666;
    font-size: 16px;
}

.sm-loading-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    margin-right: 10px;
    border: 3px solid rgba(0, 115, 170, 0.2);
    border-radius: 50%;
    border-top-color: #0073aa;
    animation: sm-spin 1s linear infinite;
}

@keyframes sm-spin {
    to { transform: rotate(360deg); }
}

/* Calendar Header */
.sm-calendar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid #e9ecef;
    background-color: #f8f9fa;
}

.sm-calendar-header h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    color: #333;
}

/* Calendar Table */
.sm-calendar-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 0;
}

.sm-calendar-table th {
    padding: 15px 10px;
    font-weight: 600;
    text-align: center;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    color: #495057;
}

.sm-calendar-table td {
    height: 120px;
    vertical-align: top;
    padding: 10px;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.sm-calendar-table td:hover {
    background-color: #f8f9fa;
}

/* Calendar Day Styling */
.sm-calendar-day-number {
    font-weight: 500;
    font-size: 16px;
    margin-bottom: 8px;
    color: #495057;
}

.sm-today {
    background-color: #f2f9ff;
    position: relative;
}

.sm-today .sm-calendar-day-number {
    display: inline-block;
    width: 32px;
    height: 32px;
    line-height: 32px;
    text-align: center;
    background-color: #0073aa;
    color: white;
    border-radius: 50%;
}

.sm-other-month {
    background-color: #f8f9fa;
}

.sm-other-month .sm-calendar-day-number {
    opacity: 0.4;
}

.sm-weekend {
    background-color: #f9f9f9;
}

.sm-selected-day {
    background-color: #e6f7ff !important;
    box-shadow: inset 0 0 0 2px #0073aa;
}

/* Calendar Events */
.sm-calendar-events {
    margin-top: 8px;
}

.sm-calendar-event {
    height: 6px;
    margin-bottom: 6px;
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.sm-calendar-event:hover {
    transform: scaleY(1.5);
}

.sm-calendar-event.accettata {
    background-color: #28a745;
}

.sm-calendar-event.in-lavorazione {
    background-color: #f0ad4e;
}

.sm-calendar-event.rifiutata {
    background-color: #dc3545;
}

/* Event Tooltip */
.sm-event-tooltip {
    visibility: hidden;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    text-align: center;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    width: max-content;
    max-width: 200px;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sm-calendar-event:hover .sm-event-tooltip {
    visibility: visible;
    opacity: 1;
}

.sm-event-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

/* Calendar Navigation */
.sm-calendar-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.sm-filter-group {
    margin-right: 20px;
}

.sm-filter-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #555;
}

.sm-filter-group select {
    min-width: 250px;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
}

.sm-filter-group select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.sm-calendar-navigation {
    display: flex;
    align-items: center;
}

#sm-prev-month,
#sm-next-month {
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    color: #555;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#sm-prev-month:hover,
#sm-next-month:hover {
    background-color: #f5f5f5;
    border-color: #0073aa;
    color: #0073aa;
}

#sm-current-month {
    margin: 0 20px;
    font-weight: 600;
    font-size: 16px;
    color: #333;
    min-width: 120px;
    text-align: center;
}

/* Legend */
.sm-calendar-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 15px;
    border-top: 1px solid #e9ecef;
    background-color: #f8f9fa;
}

.sm-legend-item {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #555;
}

.sm-legend-color {
    display: inline-block;
    width: 20px;
    height: 6px;
    margin-right: 8px;
    border-radius: 3px;
}

.sm-legend-color.in-lavorazione {
    background-color: #f0ad4e;
}

.sm-legend-color.accettata {
    background-color: #28a745;
}

.sm-legend-color.rifiutata {
    background-color: #dc3545;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .sm-calendar-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .sm-filter-group {
        margin-right: 0;
        margin-bottom: 15px;
        width: 100%;
    }
    
    .sm-filter-group select {
        width: 100%;
    }
    
    .sm-calendar-navigation {
        margin-top: 10px;
        justify-content: center;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .sm-calendar-table td {
        height: 100px;
        padding: 8px;
    }
    
    .sm-calendar-day-number {
        font-size: 14px;
    }
    
    .sm-calendar-legend {
        flex-wrap: wrap;
        gap: 15px;
    }
}

@media (max-width: 576px) {
    .sm-calendar-table th {
        padding: 10px 5px;
        font-size: 12px;
    }
    
    .sm-calendar-day-number {
        font-size: 12px;
        width: 24px;
        height: 24px;
        line-height: 24px;
    }
    
    .sm-calendar-table td {
        height: 80px;
        padding: 5px;
    }
}

.calendar-view-selector {
    display: none !important;
}