/* ============================================
   vis/css/obr.css (completo)
   ============================================ */
/**
 * =============================================
 * OBR.CSS ENTERPRISE v1.0.0
 * =============================================
 * Estilos específicos para el módulo de Pedidos de Obras
 * Design: Fluent Design + Material Design Fusion
 * Complementa a estilos.css sin duplicar
 * 
 * @version 1.0.0 Enterprise
 * @author Chief Enterprise Architect
 * =============================================
 */

/* =========================================================================
   VARIABLES Y TEMAS
   ========================================================================= */
:root {
    --obr-primary: #667eea;
    --obr-secondary: #764ba2;
    --obr-success: #48c774;
    --obr-warning: #ffd83d;
    --obr-danger: #f14668;
    --obr-info: #3e8ed0;
    --obr-light: #f5f7fa;
    --obr-dark: #363636;
    
    --obr-card-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --obr-hover-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --obr-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =========================================================================
   ANIMACIONES FLUIDAS
   ========================================================================= */
@keyframes obr-fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes obr-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(102, 126, 234, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0);
    }
}

@keyframes obr-shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* =========================================================================
   CARD COMPONENTS - FLUENT DESIGN
   ========================================================================= */
.obr-card {
    position: relative;
    background: white;
    border: none;
    transition: var(--obr-transition);
    animation: obr-fadeInUp 0.5s ease-out;
}

.obr-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--obr-hover-shadow) !important;
}

.obr-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--obr-primary), var(--obr-secondary));
    border-radius: 4px 4px 0 0;
    opacity: 0;
    transition: var(--obr-transition);
}

.obr-card:hover::before {
    opacity: 1;
}

/* =========================================================================
   FORMULARIOS - MATERIAL DESIGN
   ========================================================================= */
.obr-form-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.obr-input, 
.obr-select,
.obr-textarea {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: var(--obr-transition);
    background: white;
    width: 100%;
}

.obr-input:focus,
.obr-select:focus,
.obr-textarea:focus {
    border-color: var(--obr-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

.obr-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #4a5568;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Floating Label Effect */
.floating-label-group {
    position: relative;
}

.floating-label-group .obr-label {
    position: absolute;
    top: -0.5rem;
    left: 0.75rem;
    background: white;
    padding: 0 0.5rem;
    font-size: 0.75rem;
    color: var(--obr-primary);
    z-index: 1;
}

/* =========================================================================
   BOTONES CON EFECTOS FLUIDOS
   ========================================================================= */
.obr-btn-submit {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--obr-primary), var(--obr-secondary));
    border: none;
    color: white;
    font-weight: 600;
    letter-spacing: 0.05em;
    transition: var(--obr-transition);
}

.obr-btn-submit:hover {
    transform: scale(1.05);
    box-shadow: var(--obr-hover-shadow);
}

.obr-btn-submit::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(30deg);
    animation: obr-shimmer 3s infinite;
    pointer-events: none;
}

.obr-btn-cancel {
    background: #f8f9fa;
    color: #4a5568;
    border: 2px solid #e2e8f0;
    transition: var(--obr-transition);
}

.obr-btn-cancel:hover {
    background: #e2e8f0;
    border-color: #cbd5e0;
    transform: translateY(-2px);
}

/* =========================================================================
   TABLA DE DETALLE - MODERNA
   ========================================================================= */
.obr-detalle-table {
    border-collapse: separate;
    border-spacing: 0 0.5rem;
}

.obr-detalle-table thead th {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    color: #2d3748;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: none;
    padding: 1rem;
}

.obr-detalle-table tbody tr {
    background: white;
    border-radius: 8px;
    transition: var(--obr-transition);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.obr-detalle-table tbody tr:hover {
    transform: scale(1.01);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    background: #fafbff;
}

.obr-detalle-table tbody td {
    padding: 1rem;
    border: none;
    vertical-align: middle;
}

.obr-detalle-table tbody td.editable {
    cursor: pointer;
    position: relative;
}

.obr-detalle-table tbody td.editable:hover::after {
    content: '✎';
    position: absolute;
    right: 5px;
    top: 5px;
    color: var(--obr-primary);
    font-size: 14px;
}

/* =========================================================================
   CALENDARIO - EVENTOS PERSONALIZADOS
   ========================================================================= */
.obr-calendar-event {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 0.85rem;
}

.obr-calendar-cliente {
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.obr-calendar-producto {
    font-size: 0.75rem;
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.obr-calendar-resumen {
    font-size: 0.7rem;
    font-weight: 600;
    margin-top: 2px;
}

/* =========================================================================
   MODAL DE PRODUCTOS
   ========================================================================= */
#modalProducto .modal-content {
    animation: obr-fadeInUp 0.3s ease-out;
}

#modalProducto .bg-gradient-primary {
    background: linear-gradient(135deg, var(--obr-primary), var(--obr-secondary));
}

#modalProducto .bg-gradient-warning {
    background: linear-gradient(135deg, #f7971e, #ffd200);
}

/* =========================================================================
   BADGES Y ETIQUETAS
   ========================================================================= */
.obr-badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.obr-badge-pendiente {
    background: #fef3c7;
    color: #92400e;
}

.obr-badge-aprobado {
    background: #d1fae5;
    color: #065f46;
}

.obr-badge-cancelado {
    background: #fee2e2;
    color: #991b1b;
}

/* =========================================================================
   FILE UPLOAD PERSONALIZADO
   ========================================================================= */
.obr-file-upload {
    position: relative;
    display: inline-block;
    width: 100%;
}

.obr-file-upload .custom-file-label {
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    padding: 0.75rem;
    background: #f8fafc;
    transition: var(--obr-transition);
}

.obr-file-upload .custom-file-label::after {
    background: var(--obr-primary);
    color: white;
    border-radius: 6px;
    height: calc(100% - 4px);
    top: 2px;
    right: 2px;
}

.obr-file-upload:hover .custom-file-label {
    border-color: var(--obr-primary);
    background: #f0f5ff;
}

/* =========================================================================
   RESPONSIVE DESIGN
   ========================================================================= */
@media (max-width: 768px) {
    .obr-card {
        margin-bottom: 1rem;
    }
    
    .obr-detalle-table {
        font-size: 0.85rem;
    }
    
    .obr-detalle-table tbody td {
        padding: 0.5rem;
    }
    
    .obr-btn-submit,
    .obr-btn-cancel {
        width: 100%;
        margin: 0.5rem 0;
    }
}

/* =========================================================================
   LOADING STATES
   ========================================================================= */
.obr-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.obr-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin-top: -15px;
    margin-left: -15px;
    border: 3px solid #e2e8f0;
    border-top-color: var(--obr-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* =========================================================================
   PRINT STYLES
   ========================================================================= */
@media print {
    .obr-card {
        box-shadow: none !important;
        border: 1px solid #ddd;
    }
    
    .obr-btn-submit,
    .obr-btn-cancel,
    .btn-eliminar-producto {
        display: none !important;
    }
}