/* Base styles for Motor de Campaña Inteligente */

/* Botones con gradiente para acciones especiales */
.btn-gradient-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: none;
    color: white;
    transition: all 0.3s ease;
}

.btn-gradient-success:hover {
    background: linear-gradient(135deg, #218838 0%, #1ba085 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.btn-gradient-info {
    background: linear-gradient(135deg, #17a2b8 0%, #6f42c1 100%);
    border: none;
    color: white;
    transition: all 0.3s ease;
}

.btn-gradient-info:hover {
    background: linear-gradient(135deg, #138496 0%, #5a2d91 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
}

/* Mejorar navegación activa */
.nav-link.active {
    background-color: rgba(255, 255, 255, 0.2) !important;
    font-weight: 600;
    border-radius: 4px;
}
:root {
    --primary-color: #9D2449;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --info-color: #17a2b8;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --white: #ffffff;
    
    --primary-rgb: 157, 36, 73;
    --secondary-rgb: 108, 117, 125;
    --success-rgb: 40, 167, 69;
    --info-rgb: 23, 162, 184;
    --warning-rgb: 255, 193, 7;
    --danger-rgb: 220, 53, 69;
    
    --font-family-sans-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-family-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    
    --border-radius: 0.375rem;
    --border-radius-sm: 0.25rem;
    --border-radius-lg: 0.5rem;
    --border-radius-xl: 1rem;
    --border-radius-xxl: 2rem;
    
    --box-shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --box-shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
    
    --transition-base: all 0.2s ease-in-out;
    --transition-fade: opacity 0.15s linear;
    --transition-collapse: height 0.35s ease;
    
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 3rem;
    --spacing-xxl: 4.5rem;
    
    --lighter-color: rgba(157, 36, 73, 0.05);
    --shadow-lg: 0 1rem 3rem rgba(157, 36, 73, 0.175);
}

/* Override Bootstrap primary color */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background-color: rgba(157, 36, 73, 0.9);
    border-color: rgba(157, 36, 73, 0.9);
}

.btn-primary:focus, .btn-primary.focus {
    box-shadow: 0 0 0 0.2rem rgba(157, 36, 73, 0.5);
}

.btn-primary:not(:disabled):not(.disabled):active,
.btn-primary:not(:disabled):not(.disabled).active {
    background-color: rgba(157, 36, 73, 0.8);
    border-color: rgba(157, 36, 73, 0.8);
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.text-primary {
    color: var(--primary-color) !important;
}

.border-primary {
    border-color: var(--primary-color) !important;
}

/* Custom card styles */
.card {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--border-radius-lg);
    transition: var(--transition-base);
}

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

.card-header {
    background-color: rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding: 1.25rem;
}

.card-body {
    padding: 1.5rem;
}

/* Custom form styles */
.form-control {
    border-radius: var(--border-radius);
    border: 1px solid #e2e8f0;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    transition: var(--transition-base);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(157, 36, 73, 0.25);
}

.form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.form-select {
    border-radius: var(--border-radius);
    border: 1px solid #e2e8f0;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    transition: var(--transition-base);
}

.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(157, 36, 73, 0.25);
}

/* Custom button styles */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: var(--transition-base);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.125rem;
}

.btn-outline-primary {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

/* Navigation styles */
.navbar {
    padding: 1rem 0;
    box-shadow: var(--box-shadow-sm);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--white) !important;
}

.navbar-nav .nav-link {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85) !important;
    transition: var(--transition-base);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
}

.navbar-nav .nav-link:hover {
    color: var(--white) !important;
    background-color: rgba(255, 255, 255, 0.1);
}

.navbar-nav .nav-link.active {
    color: var(--white) !important;
    background-color: rgba(255, 255, 255, 0.2);
}

/* Alert styles */
.alert {
    border: none;
    border-radius: var(--border-radius-lg);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.alert-success {
    background-color: rgba(40, 167, 69, 0.1);
    border-left-color: var(--success-color);
    color: #155724;
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    border-left-color: var(--danger-color);
    color: #721c24;
}

.alert-info {
    background-color: rgba(23, 162, 184, 0.1);
    border-left-color: var(--info-color);
    color: #0c5460;
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.1);
    border-left-color: var(--warning-color);
    color: #856404;
}

/* Table styles */
.table {
    border-collapse: separate;
    border-spacing: 0;
}

.table th {
    background-color: rgba(0, 0, 0, 0.03);
    border-bottom: 2px solid #e2e8f0;
    font-weight: 600;
    color: var(--dark-color);
    padding: 1rem 0.75rem;
}

.table td {
    padding: 0.75rem;
    vertical-align: middle;
    border-bottom: 1px solid #e2e8f0;
}

.table-hover tbody tr:hover {
    background-color: rgba(157, 36, 73, 0.03);
}

/* Badge styles */
.badge {
    border-radius: 50px;
    font-weight: 500;
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.badge.bg-primary {
    background-color: var(--primary-color) !important;
}

/* Modal styles */
.modal-content {
    border-radius: var(--border-radius-lg);
    border: none;
    box-shadow: var(--box-shadow-lg);
}

.modal-header {
    border-bottom: 1px solid #e2e8f0;
    padding: 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #e2e8f0;
    padding: 1rem 1.5rem;
}

/* Utility classes */
.shadow-sm {
    box-shadow: var(--box-shadow-sm) !important;
}

.shadow {
    box-shadow: var(--box-shadow) !important;
}

.shadow-lg {
    box-shadow: var(--box-shadow-lg) !important;
}

.rounded-lg {
    border-radius: var(--border-radius-lg) !important;
}

.rounded-xl {
    border-radius: var(--border-radius-xl) !important;
}

.text-muted {
    color: #6c757d !important;
}

.text-decoration-none {
    text-decoration: none !important;
}

.text-decoration-none:hover {
    text-decoration: none !important;
}

/* Loading states */
.loading-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--white);
    padding: 1rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow-lg);
    z-index: 1050;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--primary-color);
}

.spinner-border {
    width: 1.5rem;
    height: 1.5rem;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .card-body {
        padding: 1rem;
    }
    
    .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .table-responsive {
        border-radius: var(--border-radius);
    }
}

/* Print styles */
@media print {
    .navbar,
    .btn,
    .alert,
    .modal,
    .dropdown-menu {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000;
        page-break-inside: avoid;
    }
    
    .card-header {
        background-color: #f8f9fa;
        color: #000;
    }
    
    body.printing .card {
        margin-bottom: 1rem;
    }
}

/* Animation classes */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

.slide-in {
    animation: slideIn 0.3s ease-in-out;
}

/* Focus visible for accessibility */
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}
