/* Estilos adicionales personalizados */

/* Animaciones suaves */
* {
    transition: all 0.3s ease;
}

/* Mejoras en las tarjetas de usuario */
.user-card {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.user-card.pinned {
    border: 2px solid #28a745 !important;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%) !important;
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.3) !important;
    transform: translateY(-2px);
}

.user-card.pinned .user-avatar {
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
}

.user-card.pinned::before {
    background: linear-gradient(90deg, transparent, rgba(40, 167, 69, 0.2), transparent);
}

.user-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.user-card:hover::before {
    left: 100%;
}

/* Efectos en las tarjetas de oportunidades */
.opportunity-card {
    position: relative;
    overflow: hidden;
}

.opportunity-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: var(--bs-primary);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.opportunity-card:hover::after {
    transform: scaleY(1);
}

/* Mejoras en los badges de prioridad */
.priority-badge {
    position: relative;
    overflow: hidden;
}

.priority-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.priority-badge:hover::before {
    left: 100%;
}

/* Efectos en los botones */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

/* Mejoras en el log */
.log-container {
    scrollbar-width: thin;
    scrollbar-color: #34495e #2c3e50;
}

.log-container::-webkit-scrollbar {
    width: 8px;
}

.log-container::-webkit-scrollbar-track {
    background: #2c3e50;
    border-radius: 4px;
}

.log-container::-webkit-scrollbar-thumb {
    background: #34495e;
    border-radius: 4px;
}

.log-container::-webkit-scrollbar-thumb:hover {
    background: #4a6741;
}

/* Efectos de hover en las estadísticas */
.stats-card {
    position: relative;
    overflow: hidden;
}

.stats-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    transform: scale(0);
    transition: transform 0.5s ease;
}

.stats-card:hover::before {
    transform: scale(1);
}

/* Mejoras en los avatares de usuario */
.user-avatar {
    position: relative;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.user-avatar::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    background: linear-gradient(45deg, #3498db, #2c3e50, #3498db);
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
    z-index: -1;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Efectos en los toasts */
.toast {
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border: none;
    border-radius: 15px;
}

.toast-header {
    background: linear-gradient(45deg, #f8f9fa, #e9ecef);
    border-bottom: 1px solid rgba(0,0,0,0.1);
    border-radius: 15px 15px 0 0;
}

.toast-body {
    background: white;
    border-radius: 0 0 15px 15px;
}

/* Responsive design mejoras */
@media (max-width: 768px) {
    .main-container {
        margin: 10px;
        padding: 20px;
    }
    
    .stats-card {
        margin-bottom: 15px;
    }
    
    .user-card {
        margin-bottom: 10px;
    }
    
    .opportunity-card {
        margin-bottom: 15px;
    }
}

/* Efectos de carga */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner-custom {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mejoras en el estado vacío */
.empty-state {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 20px;
    border: 2px dashed #dee2e6;
}

.empty-state i {
    background: linear-gradient(45deg, #bdc3c7, #95a5a6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Efectos de notificación */
.notification-bounce {
    animation: bounce 0.6s ease;
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0,0,0);
    }
    40%, 43% {
        transform: translate3d(0, -10px, 0);
    }
    70% {
        transform: translate3d(0, -5px, 0);
    }
    90% {
        transform: translate3d(0, -2px, 0);
    }
}

/* Mejoras en los formularios */
.form-check-input:checked {
    background-color: #3498db;
    border-color: #3498db;
}

.form-check-input:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

/* Efectos de texto */
.text-gradient {
    background: linear-gradient(45deg, #3498db, #2c3e50);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Mejoras en los badges */
.badge {
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Efectos de sombra dinámicos */
.shadow-dynamic {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease;
}

.shadow-dynamic:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

/* Mejoras en el header */
.header {
    position: relative;
}

.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(45deg, #3498db, #2c3e50);
    border-radius: 2px;
}

/* Efectos de scroll suave */
html {
    scroll-behavior: smooth;
}

/* Mejoras en la accesibilidad */
.btn:focus,
.form-check-input:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Efectos de hover mejorados */
.card:hover {
    transform: translateY(-2px);
}

.user-card:hover,
.opportunity-card:hover {
    transform: translateY(-3px) scale(1.02);
}

/* Efectos de animación para nuevas oportunidades */
.opportunity-card.new {
    animation: newOpportunityGlow 2s ease-in-out;
}

.opportunity-card.updated {
    animation: updateOpportunityGlow 2s ease-in-out;
}

@keyframes newOpportunityGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 20px 10px rgba(40, 167, 69, 0.3);
        transform: scale(1.02);
    }
    100% {
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
        transform: scale(1);
    }
}

@keyframes updateOpportunityGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.7);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 20px 10px rgba(255, 193, 7, 0.3);
        transform: scale(1.02);
    }
    100% {
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
        transform: scale(1);
    }
}

/* Estilos para botones de usuario */
.pin-user-btn {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.pin-user-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.pin-user-btn.btn-success {
    background: linear-gradient(45deg, #28a745, #20c997);
    border-color: #28a745;
}

.connect-user-btn {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    animation: pulse 2s infinite;
}

.connect-user-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(40, 167, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0); }
}

.user-actions {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* Estilos para el botón principal de conexión */
#connectBtn {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#connectBtn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

#connectBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Estilos para controles de notificación */
.form-check-input:checked {
    background-color: #28a745;
    border-color: #28a745;
}

.form-check-input:focus {
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

.form-check-label {
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    transition: color 0.3s ease;
}

.form-check-label:hover {
    color: #28a745;
}

.form-check-label i {
    margin-right: 5px;
    transition: transform 0.3s ease;
}

.form-check-input:checked + .form-check-label i {
    transform: scale(1.1);
}

/* Mejoras en el estado de conexión */
.connection-status {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Efectos de partículas de fondo */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="40" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="40" cy="80" r="1" fill="rgba(255,255,255,0.1)"/></svg>') repeat;
    pointer-events: none;
    z-index: -1;
}
