/**
 * COMPONENTES MODERNOS - Mejoras para Modales, Formularios, Dropdowns, etc.
 */

/* ============================================
   MODALES ULTRA MODERNOS
   ============================================ */
.modal-modern .modal-content {
    border-radius: 24px;
    border: none;
    box-shadow: 0 24px 64px rgba(0,0,0,0.3), 0 12px 32px rgba(0,0,0,0.2);
    overflow: hidden;
    animation: scaleIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
}

.modal-modern .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom: none;
    padding: 24px 32px;
    position: relative;
    overflow: hidden;
}

.modal-modern .modal-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

.modal-modern .modal-header h5 {
    position: relative;
    z-index: 1;
    font-weight: 700;
    font-size: 1.5rem;
}

.modal-modern .modal-body {
    padding: 32px;
    background: white;
}

.modal-modern .modal-footer {
    border-top: 1px solid #e5e7eb;
    padding: 20px 32px;
    background: #f9fafb;
}

.modal-modern .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.9;
    transition: all 0.3s ease;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
}

.modal-modern .btn-close:hover {
    opacity: 1;
    background: rgba(255,255,255,0.3);
    transform: rotate(90deg);
}

/* Backdrop mejorado */
.modal-backdrop {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* ============================================
   DROPDOWNS ULTRA MODERNOS
   ============================================ */
.dropdown-menu-modern {
    border-radius: 16px;
    border: none;
    box-shadow: 0 12px 40px rgba(0,0,0,0.15), 0 4px 16px rgba(0,0,0,0.1);
    padding: 8px;
    margin-top: 8px;
    animation: fadeInDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.dropdown-menu-modern .dropdown-item {
    border-radius: 12px;
    padding: 12px 16px;
    margin: 2px 0;
    transition: all 0.2s ease;
    font-weight: 500;
    color: #374151;
}

.dropdown-menu-modern .dropdown-item:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateX(5px);
}

.dropdown-menu-modern .dropdown-item:active {
    background: linear-gradient(135deg, #5568d3 0%, #653a91 100%);
    color: white;
}

.dropdown-menu-modern .dropdown-divider {
    margin: 8px 0;
    border-color: #e5e7eb;
}

/* ============================================
   FORMULARIOS ULTRA MODERNOS
   ============================================ */
.form-group-modern {
    margin-bottom: 24px;
}

.form-label-modern {
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    font-size: 0.95rem;
    display: block;
}

.form-control-modern {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    color: #111827;
}

.form-control-modern:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102,126,234,0.1);
    transform: translateY(-2px);
}

.form-control-modern::placeholder {
    color: #9ca3af;
}

.form-control-modern:disabled {
    background: #f3f4f6;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Input con icono */
.input-icon-wrapper {
    position: relative;
}

.input-icon-wrapper .form-control-modern {
    padding-left: 48px;
}

.input-icon-wrapper .input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    transition: color 0.3s ease;
    z-index: 1;
}

.input-icon-wrapper .form-control-modern:focus + .input-icon {
    color: #667eea;
}

/* Checkbox y Radio modernos */
.form-check-modern {
    position: relative;
    padding-left: 36px;
    margin-bottom: 12px;
    cursor: pointer;
}

.form-check-modern input[type="checkbox"],
.form-check-modern input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.form-check-modern .checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 24px;
    width: 24px;
    background: white;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.form-check-modern:hover .checkmark {
    border-color: #667eea;
    background: rgba(102,126,234,0.05);
}

.form-check-modern input:checked ~ .checkmark {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
}

.form-check-modern .checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 7px;
    top: 3px;
    width: 6px;
    height: 12px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.form-check-modern input:checked ~ .checkmark:after {
    display: block;
}

/* Radio buttons */
.form-check-modern input[type="radio"] ~ .checkmark {
    border-radius: 50%;
}

.form-check-modern input[type="radio"] ~ .checkmark:after {
    border-radius: 50%;
    width: 12px;
    height: 12px;
    left: 4px;
    top: 4px;
    border: none;
    background: white;
    transform: none;
}

/* ============================================
   PAGINACIÓN MODERNA
   ============================================ */
.pagination-modern {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    margin: 32px 0;
}

.pagination-modern .page-item {
    margin: 0;
}

.pagination-modern .page-link {
    min-width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
    background: white;
    color: #374151;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    margin: 0;
}

.pagination-modern .page-link:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102,126,234,0.3);
}

.pagination-modern .page-item.active .page-link {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 16px rgba(102,126,234,0.4);
}

.pagination-modern .page-item.disabled .page-link {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f3f4f6;
}

.pagination-modern .page-item.disabled .page-link:hover {
    transform: none;
    box-shadow: none;
}

/* ============================================
   ALERTAS Y NOTIFICACIONES MODERNAS
   ============================================ */
.alert-modern {
    border-radius: 16px;
    border: none;
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.alert-modern .alert-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.alert-modern-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
}

.alert-modern-danger {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
}

.alert-modern-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
}

.alert-modern-info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
}

/* ============================================
   TOASTS MODERNOS
   ============================================ */
.toast-modern {
    border-radius: 16px;
    border: none;
    box-shadow: 0 12px 40px rgba(0,0,0,0.2);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast-modern .toast-header {
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.1);
    color: white;
    border-radius: 16px 16px 0 0;
}

.toast-modern .toast-body {
    padding: 16px 20px;
}

/* ============================================
   BADGES Y CHIPS MODERNOS
   ============================================ */
.badge-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.875rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(102,126,234,0.3);
    transition: all 0.3s ease;
}

.badge-chip:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(102,126,234,0.4);
}

.badge-chip-close {
    cursor: pointer;
    margin-left: 4px;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.badge-chip-close:hover {
    opacity: 1;
}

/* ============================================
   LOADING STATES MODERNOS
   ============================================ */
.loader-modern {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 4px solid rgba(102,126,234,0.1);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loader-modern-sm {
    width: 24px;
    height: 24px;
    border-width: 2px;
}

.loader-modern-lg {
    width: 80px;
    height: 80px;
    border-width: 6px;
}

/* Skeleton loader mejorado */
.skeleton-modern {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 12px;
}

.skeleton-modern-text {
    height: 1em;
    margin-bottom: 0.5em;
}

.skeleton-modern-title {
    height: 1.5em;
    width: 60%;
    margin-bottom: 1em;
}

.skeleton-modern-image {
    height: 200px;
    width: 100%;
    border-radius: 12px;
}

/* ============================================
   TABS MODERNOS
   ============================================ */
.nav-tabs-modern {
    border-bottom: 2px solid #e5e7eb;
    gap: 8px;
}

.nav-tabs-modern .nav-link {
    border: none;
    border-radius: 12px 12px 0 0;
    padding: 12px 24px;
    color: #6b7280;
    font-weight: 600;
    transition: all 0.3s ease;
    background: transparent;
    position: relative;
}

.nav-tabs-modern .nav-link:hover {
    color: #667eea;
    background: rgba(102,126,234,0.05);
}

.nav-tabs-modern .nav-link.active {
    color: #667eea;
    background: white;
    border-bottom: 3px solid #667eea;
}

/* ============================================
   ACCORDION MODERNO
   ============================================ */
.accordion-modern .accordion-item {
    border: none;
    border-radius: 12px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}

.accordion-modern .accordion-header {
    background: white;
}

.accordion-modern .accordion-button {
    border-radius: 12px;
    padding: 16px 20px;
    font-weight: 600;
    color: #374151;
    background: white;
    box-shadow: none;
    transition: all 0.3s ease;
}

.accordion-modern .accordion-button:not(.collapsed) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102,126,234,0.3);
}

.accordion-modern .accordion-button:focus {
    box-shadow: 0 0 0 4px rgba(102,126,234,0.1);
}

.accordion-modern .accordion-body {
    padding: 20px;
    background: #f9fafb;
}

/* ============================================
   PROGRESS BARS MODERNOS
   ============================================ */
.progress-modern {
    height: 12px;
    border-radius: 50px;
    background: #e5e7eb;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.progress-modern .progress-bar {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 50px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(102,126,234,0.3);
    position: relative;
    overflow: hidden;
}

.progress-modern .progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

/* ============================================
   TOOLTIPS MODERNOS
   ============================================ */
.tooltip-modern .tooltip-inner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    padding: 8px 12px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(102,126,234,0.3);
}

.tooltip-modern .tooltip-arrow::before {
    border-top-color: #667eea;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .modal-modern .modal-body {
        padding: 24px;
    }
    
    .pagination-modern .page-link {
        min-width: 36px;
        height: 36px;
        font-size: 0.875rem;
    }
    
    .form-control-modern {
        padding: 12px 16px;
    }
}
















