/**
 * Estilos para el frontend del plugin de reservas con calendario
 */

.plugin-reserva-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.plugin-reserva-container h2 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
}

.plugin-reserva-container h3 {
    color: #2271b1;
    margin-bottom: 20px;
}

/* Pasos del formulario */
.reserva-step {
    display: none;
}

.reserva-step.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Navegación del calendario */
.calendario-navegacion {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 8px;
}

.btn-nav {
    padding: 10px 20px;
    background: #2271b1;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.btn-nav:hover {
    background: #135e96;
}

.semana-info {
    font-weight: 600;
    font-size: 16px;
    color: #333;
}

/* Grid del calendario */
.calendario-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.calendario-dia {
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.calendario-dia:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dia-cerrado {
    background: #f5f5f5;
    opacity: 0.6;
}

.dia-completo {
    background: #fff3e0;
    border-color: #ff9800;
}

.dia-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    padding: 12px;
    text-align: center;
}

.dia-cerrado .dia-header {
    background: #9e9e9e;
}

.dia-completo .dia-header {
    background: #ff9800;
}

.dia-nombre {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.dia-numero {
    display: block;
    font-size: 24px;
    font-weight: bold;
    margin-top: 5px;
}

.dia-horarios {
    padding: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.horario-btn {
    display: block;
    width: 100%;
    padding: 8px;
    margin-bottom: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #ffffff;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.horario-disponible {
    background: #e7f3ff;
    border-color: #2271b1;
    color: #2271b1;
}

.horario-disponible:hover {
    background: #2271b1;
    color: #ffffff;
    transform: scale(1.05);
}

.horario-ocupado {
    background: #ffebee;
    border-color: #e53935;
    color: #c62828;
    cursor: not-allowed;
    text-decoration: line-through;
}

.horario-seleccionado {
    background: #4caf50 !important;
    color: #ffffff !important;
    border-color: #4caf50 !important;
    font-weight: bold;
}

.cerrado-mensaje,
.completo-mensaje,
.sin-horarios {
    text-align: center;
    padding: 20px;
    color: #757575;
    font-size: 14px;
}

.calendario-loading {
    text-align: center;
    padding: 40px;
    color: #757575;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #2271b1;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Leyenda */
.leyenda-calendario {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin: 20px 0;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
}

.leyenda-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.leyenda-item .badge {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    display: inline-block;
}

.badge-disponible {
    background: #e7f3ff;
    border: 2px solid #2271b1;
}

.badge-ocupado {
    background: #ffebee;
    border: 2px solid #e53935;
}

.badge-cerrado {
    background: #f5f5f5;
    border: 2px solid #9e9e9e;
}

.badge-seleccionado {
    background: #4caf50;
    border: 2px solid #4caf50;
}

/* Información de selección */
.seleccion-info {
    background: #e8f5e9;
    border: 2px solid #4caf50;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    text-align: center;
}

.seleccion-info p {
    margin: 0 0 15px 0;
    font-size: 16px;
}

.btn-continuar {
    padding: 12px 30px;
    background: #4caf50;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background 0.3s;
}

.btn-continuar:hover {
    background: #45a049;
}

.formulario-reserva .form-group {
    margin-bottom: 20px;
}

.formulario-reserva label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.formulario-reserva .required {
    color: #e74c3c;
}

.formulario-reserva input[type="text"],
.formulario-reserva input[type="email"],
.formulario-reserva input[type="tel"],
.formulario-reserva input[type="date"],
.formulario-reserva input[type="time"],
.formulario-reserva input[type="number"],
.formulario-reserva textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.formulario-reserva input:focus,
.formulario-reserva textarea:focus {
    outline: none;
    border-color: #3498db;
}

.formulario-reserva .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.formulario-reserva textarea {
    resize: vertical;
    min-height: 100px;
}

.formulario-reserva .btn-reservar {
    width: 100%;
    padding: 15px;
    background: #3498db;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.formulario-reserva .btn-reservar:hover {
    background: #2980b9;
}

.formulario-reserva .btn-reservar:disabled {
    background: #95a5a6;
    cursor: not-allowed;
}

.reserva-mensaje {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    text-align: center;
}

.reserva-mensaje.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.reserva-mensaje.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Lista de reservas */
.plugin-reserva-lista {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.tabla-reservas {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tabla-reservas thead {
    background: #3498db;
    color: #ffffff;
}

.tabla-reservas th,
.tabla-reservas td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.tabla-reservas tbody tr:hover {
    background: #f8f9fa;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
}

.badge-pendiente {
    background: #ffeaa7;
    color: #d63031;
}

.badge-confirmada {
    background: #55efc4;
    color: #00b894;
}

.badge-cancelada {
    background: #fab1a0;
    color: #d63031;
}

.badge-completada {
    background: #a29bfe;
    color: #6c5ce7;
}

/* Botones de acciones del formulario */
.form-actions {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 20px;
}

.btn-back {
    flex: 0 0 auto;
    padding: 15px 30px;
    background: #757575;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-back:hover {
    background: #616161;
}

.btn-reservar {
    flex: 1;
    padding: 15px;
    background: #4caf50;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-reservar:hover {
    background: #45a049;
}

.btn-reservar:disabled {
    background: #95a5a6;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 1024px) {
    .calendario-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .calendario-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .calendario-navegacion {
        flex-direction: column;
        gap: 10px;
    }
    
    .formulario-reserva .form-row {
        grid-template-columns: 1fr;
    }
    
    .plugin-reserva-container {
        padding: 15px;
    }
    
    .tabla-reservas {
        font-size: 14px;
    }
    
    .tabla-reservas th,
    .tabla-reservas td {
        padding: 8px;
    }
    
    .leyenda-calendario {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn-back,
    .btn-reservar {
        width: 100%;
        flex: 1;
    }
}

@media (max-width: 480px) {
    .calendario-grid {
        grid-template-columns: 1fr;
    }
    
    .dia-horarios {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 5px;
        max-height: none;
    }
    
    .horario-btn {
        margin-bottom: 0;
        font-size: 12px;
        padding: 6px;
    }
}
