/* ========================================
   COMPONENTES ESPECÍFICOS - SEMANA 2
   Mejoras adicionales para componentes
======================================== */

/* ========================================
   ICONOS SVG MODERNOS
======================================== */
.icon-gradient-primary {
    fill: url(#gradient-primary);
}

.icon-gradient-success {
    fill: url(#gradient-success);
}

.icon-gradient-info {
    fill: url(#gradient-info);
}

/* Contenedor de iconos con efecto */
.icon-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: var(--radius-lg);
    background: var(--tertiary);
    transition: all var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.icon-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-smooth);
}

.card-menu:hover .icon-container::before {
    opacity: 0.1;
}

.icon-container svg {
    position: relative;
    z-index: 1;
    transition: all var(--transition-smooth);
}

.card-menu:hover .icon-container svg {
    transform: scale(1.1);
}

/* ========================================
   MODALES MEJORADOS
======================================== */
.modal-content {
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.modal-header {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 1.5rem;
    position: relative;
}

.modal-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.modal-title {
    font-weight: var(--font-weight-semibold);
    color: white !important;
    font-size: 1.25rem;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.8;
    transition: all var(--transition-base);
}

.modal-header .btn-close:hover {
    opacity: 1;
    transform: rotate(90deg);
}

.modal-body {
    padding: 2rem;
    background: var(--white);
}

.modal-footer {
    border-top: 1px solid var(--secondary);
    padding: 1.25rem 2rem;
    background: var(--tertiary);
}

/* Formularios dentro de modales */
.modal form .form-label {
    font-weight: var(--font-weight-medium);
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.modal form .form-control,
.modal form .form-select {
    border: 2px solid var(--secondary);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    transition: all var(--transition-base);
    font-size: 0.95rem;
}

.modal form .form-control:focus,
.modal form .form-select:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
    transform: translateY(-1px);
}

/* Grid de formularios en modales */
.modal form .row {
    margin-bottom: 0;
}

.modal form .row>[class*="col-"] {
    margin-bottom: 1rem;
}

/* ========================================
   BADGES Y PILLS MODERNOS
======================================== */
.badge {
    font-weight: var(--font-weight-medium);
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.badge-gradient-primary {
    background: var(--gradient-primary);
    color: white;
}

.badge-gradient-success {
    background: var(--gradient-success);
    color: white;
}

.badge-gradient-info {
    background: var(--gradient-info);
    color: white;
}

.badge-gradient-warning {
    background: var(--gradient-warm);
    color: white;
}

/* Badge con icono */
.badge i {
    font-size: 0.9em;
}

/* ========================================
   CARDS DE ESTADÍSTICAS
======================================== */
.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-smooth);
    border-left: 4px solid var(--accent-blue);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-card.stat-success {
    border-left-color: var(--accent-green);
}

.stat-card.stat-warning {
    border-left-color: var(--accent-orange);
}

.stat-card.stat-info {
    border-left-color: var(--accent-blue);
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: var(--font-weight-bold);
    color: var(--primary);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--primary);
    opacity: 0.7;
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .stat-change {
    font-size: 0.8rem;
    font-weight: var(--font-weight-medium);
    margin-top: 0.5rem;
}

.stat-card .stat-change.positive {
    color: var(--accent-green);
}

.stat-card .stat-change.negative {
    color: var(--accent-red);
}

/* ========================================
   TABLAS MEJORADAS
======================================== */
.table-modern {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    background: var(--white);
}

.table-modern thead {
    background: var(--gradient-primary);
}

.table-modern thead th {
    color: white;
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    padding: 1.25rem 1rem;
    border: none;
}

.table-modern tbody tr {
    transition: all var(--transition-base);
    border-bottom: 1px solid var(--secondary);
}

.table-modern tbody tr:last-child {
    border-bottom: none;
}

.table-modern tbody tr:hover {
    background: var(--tertiary);
    transform: scale(1.002);
}

.table-modern tbody td {
    padding: 1rem;
    vertical-align: middle;
    color: var(--primary);
}

/* Acciones en tabla */
.table-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.table-actions .btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
}

/* ========================================
   BREADCRUMBS MODERNOS
======================================== */
.breadcrumb {
    background: transparent;
    padding: 1rem 0;
    margin-bottom: 1.5rem;
}

.breadcrumb-item {
    font-size: 0.9rem;
    font-weight: var(--font-weight-medium);
}

.breadcrumb-item+.breadcrumb-item::before {
    content: "›";
    font-size: 1.2rem;
    color: var(--primary);
    opacity: 0.5;
}

.breadcrumb-item.active {
    color: var(--accent-blue);
}

.breadcrumb-item a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-base);
}

.breadcrumb-item a:hover {
    color: var(--accent-blue);
}

/* ========================================
   TOOLTIPS MODERNOS
======================================== */
.tooltip-inner {
    background: var(--primary);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    font-weight: var(--font-weight-medium);
    box-shadow: var(--shadow-lg);
}

.tooltip.bs-tooltip-top .tooltip-arrow::before {
    border-top-color: var(--primary);
}

.tooltip.bs-tooltip-bottom .tooltip-arrow::before {
    border-bottom-color: var(--primary);
}

.tooltip.bs-tooltip-start .tooltip-arrow::before {
    border-left-color: var(--primary);
}

.tooltip.bs-tooltip-end .tooltip-arrow::before {
    border-right-color: var(--primary);
}

/* ========================================
   PROGRESS BARS MODERNOS
======================================== */
.progress {
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--secondary);
    overflow: visible;
}

.progress-bar {
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    position: relative;
    overflow: visible;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-full);
}

/* ========================================
   SPINNERS MODERNOS
======================================== */
.spinner-modern {
    width: 40px;
    height: 40px;
    border: 3px solid var(--secondary);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.spinner-gradient {
    width: 40px;
    height: 40px;
    border: 3px solid transparent;
    border-top: 3px solid var(--accent-blue);
    border-right: 3px solid var(--accent-purple);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ========================================
   EMPTY STATES
======================================== */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
}

.empty-state-icon {
    font-size: 4rem;
    color: var(--secondary);
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: var(--font-weight-semibold);
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.empty-state-text {
    color: var(--primary);
    opacity: 0.7;
    margin-bottom: 1.5rem;
}

/* ========================================
   DIVIDERS MODERNOS
======================================== */
.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--secondary), transparent);
    margin: 2rem 0;
}

.divider-text {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 2rem 0;
}

.divider-text::before,
.divider-text::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--secondary), transparent);
}

.divider-text span {
    padding: 0 1rem;
    color: var(--primary);
    opacity: 0.7;
    font-size: 0.85rem;
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
/* ========================================
   VALIDACIÓN DE FORMULARIOS
   Estilos para feedback visual de validaciones
======================================== */

/* Estados de validación en campos */
.form-control.field-valid,
.form-select.field-valid {
    border-color: var(--accent-green) !important;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2310B981' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.field-invalid,
.form-select.field-invalid {
    border-color: var(--accent-red) !important;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23EF4444'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23EF4444' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

/* Animación al cambiar estado */
.form-control,
.form-select {
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, background-image 0.15s ease-in-out;
}

/* Mensajes de feedback */
.field-feedback {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    font-weight: var(--font-weight-medium);
}

.field-feedback.valid-feedback,
.valid-feedback {
    color: var(--accent-green);
}

.field-feedback.invalid-feedback,
.invalid-feedback {
    color: var(--accent-red);
}

/* Icono en mensajes de feedback */
.field-feedback::before {
    font-family: "bootstrap-icons";
    margin-right: 0.25rem;
}

.field-feedback.valid-feedback::before {
    content: "\f26b"; /* bi-check-circle-fill */
}

.field-feedback.invalid-feedback::before {
    content: "\f623"; /* bi-exclamation-circle-fill */
}

/* Focus en campos válidos/inválidos */
.form-control.field-valid:focus,
.form-select.field-valid:focus {
    border-color: var(--accent-green);
    box-shadow: 0 0 0 0.25rem rgba(16, 185, 129, 0.25);
}

.form-control.field-invalid:focus,
.form-select.field-invalid:focus {
    border-color: var(--accent-red);
    box-shadow: 0 0 0 0.25rem rgba(239, 68, 68, 0.25);
}

/* Grupos de formulario con validación */
.form-group.has-validation {
    position: relative;
}

/* Animación de shake para errores */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.field-invalid.shake {
    animation: shake 0.5s;
}

/* Tooltip de validación (opcional) */
.validation-tooltip {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 5;
    display: none;
    max-width: 100%;
    padding: 0.5rem 0.75rem;
    margin-top: 0.1rem;
    font-size: 0.875rem;
    color: #fff;
    background-color: rgba(239, 68, 68, 0.9);
    border-radius: var(--radius-md);
}

.field-invalid ~ .validation-tooltip {
    display: block;
}
