/* =================================
   ARCHIVO: assets/frontend.css
   Estilos inspirados en Presscloud
   ================================= */

#msp-calendar-container {
    max-width: 800px;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.msp-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    color: #2c3e50;
    padding: 30px 40px 20px;
    border-bottom: 1px solid #f0f2f5;
}

.msp-calendar-header h3 {
    margin: 0;
    font-size: 28px;
    font-weight: 600;
    color: #2c3e50;
    text-transform: capitalize;
}

.msp-calendar-header button {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #e9ecef;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.msp-calendar-header button:hover {
    background: #e9ecef;
    border-color: #d6d9dc;
    color: #495057;
}

.msp-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: white;
}

.msp-day-header {
    background: white;
    color: #6c757d;
    text-align: center;
    padding: 20px 8px 15px;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #f0f2f5;
}

.msp-calendar-day {
    background: white;
    border-right: 1px solid #f0f2f5;
    border-bottom: 1px solid #f0f2f5;
    padding: 20px 8px;
    text-align: center;
    cursor: pointer;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 16px;
    color: #495057;
    position: relative;
}

.msp-calendar-day:nth-child(7n) {
    border-right: none;
}

.msp-calendar-day:hover {
    background: #f8f9fa;
}

.msp-calendar-day.available {
    color: #2c3e50;
    cursor: pointer;
}

.msp-calendar-day.available:hover {
    background: #e3f2fd;
    color: #1976d2;
    transform: scale(1.05);
}

.msp-calendar-day.available.selected {
    background: #1976d2;
    color: white;
    border-radius: 8px;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3);
}

.msp-calendar-day.other-month {
    color: #d6d9dc;
    cursor: not-allowed;
    background: #fafbfc;
}

.msp-calendar-day.past {
    color: #adb5bd;
    cursor: not-allowed;
    background: #f8f9fa;
}

.msp-calendar-day.today {
    background: #fff3e0;
    color: #f57c00;
    font-weight: 700;
}

.msp-calendar-day.today.available:hover {
    background: #ffcc02;
    color: white;
}

/* Panel de horarios */
#msp-time-slots {
    background: white;
    padding: 40px;
    border-top: 1px solid #f0f2f5;
}

#msp-time-slots h4 {
    color: #2c3e50;
    margin-bottom: 30px;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
}

#msp-times-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-bottom: 30px;
}

.time-period-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    border: 1px solid #e9ecef;
}

.period-title {
    color: #495057;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 20px 0;
    text-align: left;
    padding: 0;
    background: none;
    border-radius: 0;
}

.period-times {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.msp-time-slot {
    background: white;
    border: 2px solid #e9ecef;
    color: #495057;
    padding: 12px 16px;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
    position: relative;
}

.msp-time-slot:hover {
    border-color: #1976d2;
    color: #1976d2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.15);
}

.msp-time-slot.selected {
    background: #1976d2;
    border-color: #1976d2;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3);
}

.morning-slot {
    border-color: #ff9800;
    color: #f57c00;
}

.morning-slot:hover,
.morning-slot.selected {
    background: #ff9800;
    border-color: #ff9800;
    color: white;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

.afternoon-slot {
    border-color: #673ab7;
    color: #512da8;
}

.afternoon-slot:hover,
.afternoon-slot.selected {
    background: #673ab7;
    border-color: #673ab7;
    color: white;
    box-shadow: 0 4px 12px rgba(103, 58, 183, 0.3);
}

/* Formulario de agendamiento */
#msp-booking-form {
    background: white;
    padding: 40px;
    border-top: 1px solid #f0f2f5;
}

#msp-booking-form h4 {
    color: #2c3e50;
    margin-bottom: 30px;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
}

.msp-form-group {
    margin-bottom: 25px;
}

.msp-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.msp-form-group input,
.msp-form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s ease;
    box-sizing: border-box;
    font-family: inherit;
    color: #495057;
}

.msp-form-group input:focus,
.msp-form-group textarea:focus {
    border-color: #1976d2;
    outline: none;
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

.msp-form-group textarea {
    min-height: 100px;
    resize: vertical;
}

#msp-meeting-form button {
    background: #1976d2;
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    margin-right: 15px;
    margin-top: 15px;
    transition: all 0.2s ease;
    font-family: inherit;
}

#msp-meeting-form button:hover {
    background: #1565c0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3);
}

#msp-meeting-form button:disabled {
    background: #adb5bd;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#msp-meeting-form button[type='button'] {
    background: #6c757d;
}

#msp-meeting-form button[type='button']:hover {
    background: #5a6268;
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

#msp-back-to-calendar,
#msp-schedule-another {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: block;
    margin: 20px auto 0;
    font-family: inherit;
}

#msp-back-to-calendar:hover,
#msp-schedule-another:hover {
    background: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

/* Mensaje de éxito */
#msp-success-message {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 40px;
    text-align: center;
    border-top: 1px solid #f0f2f5;
}

#msp-success-message h4 {
    color: #1b5e20;
    margin-bottom: 20px;
    font-size: 28px;
    font-weight: 700;
}

#msp-success-message p {
    font-size: 18px;
    margin-bottom: 25px;
    color: #2e7d32;
}

/* Estados de carga y error */
.msp-loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
    font-size: 16px;
}

.msp-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e9ecef;
    border-radius: 50%;
    border-top-color: #1976d2;
    animation: spin 1s ease-in-out infinite;
    margin-left: 10px;
}

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

.msp-error {
    background: #ffebee;
    color: #c62828;
    padding: 20px;
    border-radius: 8px;
    margin: 15px 0;
    text-align: center;
    font-weight: 500;
    border: 1px solid #ffcdd2;
}

/* Animaciones sutiles */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#msp-time-slots,
#msp-booking-form,
#msp-success-message {
    animation: fadeInUp 0.3s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {
    #msp-calendar-container {
        margin: 10px;
        max-width: none;
        border-radius: 8px;
    }
    
    .msp-calendar-header {
        padding: 20px 20px 15px;
    }
    
    .msp-calendar-header h3 {
        font-size: 24px;
    }
    
    .msp-calendar-day {
        padding: 15px 4px;
        min-height: 50px;
        font-size: 14px;
    }
    
    .msp-day-header {
        padding: 15px 4px 10px;
        font-size: 12px;
    }
    
    .period-times {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .time-period-section {
        padding: 20px;
    }
    
    .msp-time-slot {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    #msp-time-slots,
    #msp-booking-form {
        padding: 25px 20px;
    }
    
    .msp-form-group input,
    .msp-form-group textarea {
        font-size: 16px; /* Prevenir zoom en iOS */
    }
    
    #msp-booking-form h4 {
        font-size: 20px;
    }
    
    #msp-success-message {
        padding: 30px 20px;
    }
    
    #msp-success-message h4 {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .msp-calendar-header {
        padding: 15px;
        flex-direction: column;
        gap: 15px;
    }
    
    .msp-calendar-header h3 {
        font-size: 20px;
        order: 2;
    }
    
    .msp-calendar-header button {
        padding: 6px 10px;
        font-size: 14px;
    }
    
    .period-times {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    #msp-booking-form,
    #msp-time-slots {
        padding: 20px 15px;
    }
    
    .msp-form-group {
        margin-bottom: 20px;
    }
    
    #msp-meeting-form button {
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
    }
}

/* Efectos especiales para días disponibles */
.msp-calendar-day.available {
    position: relative;
}

.msp-calendar-day.available::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: #1976d2;
    border-radius: 50%;
    opacity: 0.7;
}

.msp-calendar-day.available:hover::after {
    opacity: 1;
    transform: translateX(-50%) scale(1.2);
}

/* Mejoras en accesibilidad */
.msp-calendar-day:focus,
.msp-time-slot:focus,
button:focus {
    outline: 2px solid #1976d2;
    outline-offset: 2px;
}

/* Transiciones suaves para mejor UX */
* {
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}