/* Custom CSS for KOL Finder */

:root {
    --primary-color: #0066cc;
    --primary-light: #339fff;
    --primary-dark: #0052a3;
    --accent-color: #0ea5e9;
    --success-color: #22c55e;
    --warning-color: #f59e0b;
    --info-color: #0ea5e9;
    --light-bg: #e6f3ff;
}

body {
    background-color: var(--light-bg);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Navigation */
.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

/* Hero Section */
.display-4 {
    font-weight: 700;
    color: #001429;
}

.badge-container {
    margin-top: 1rem;
}

.badge {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
}

/* Cards */
.card {
    border: none;
    border-radius: 10px;
    transition: all 0.3s ease;
    border: 1px solid #99cfff;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 102, 204, 0.15) !important;
}

.card-header {
    border-radius: 10px 10px 0 0 !important;
    border: none;
    background: linear-gradient(135deg, #0066cc, #0052a3);
    color: white;
}

/* Form Elements */
.form-control {
    border-radius: 8px;
    border: 1px solid #99cfff;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.25);
    transform: translateY(-1px);
}

.form-label {
    font-weight: 600;
    color: #001429;
}

/* Compact Search Form */
.card-body.p-4 {
    padding: 1.5rem !important;
}

.card-body.p-4 .row {
    margin-bottom: 0.5rem;
}

.card-body.p-4 .col-12.mb-3 {
    margin-bottom: 1rem !important;
}

.card-body.p-4 .col-12.mb-3 h6 {
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
}

.card-body.p-4 .col-md-6.mb-3 {
    margin-bottom: 1rem !important;
}

.card-body.p-4 .form-label {
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.card-body.p-4 .form-control {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
}

.card-body.p-4 .form-check {
    margin-bottom: 0.5rem;
}

.card-body.p-4 .form-check-label {
    font-size: 0.9rem;
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.2);
}

.btn-lg {
    padding: 12px 30px;
    font-size: 1.1rem;
}

.btn-primary {
    background: linear-gradient(135deg, #0066cc, #0052a3);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0052a3, #003d7a);
}

/* Progress Bars */
.progress {
    border-radius: 10px;
    background-color: #e6f3ff;
}

.progress-bar {
    border-radius: 10px;
    background: linear-gradient(90deg, #0066cc, #339fff);
}

/* Accordions */
.accordion-button {
    border-radius: 8px;
    background-color: transparent;
    border: 1px solid #99cfff;
}

.accordion-button:not(.collapsed) {
    background: linear-gradient(135deg, #0066cc, #0052a3);
    color: white;
}

.accordion-body {
    background-color: #f0f9ff;
}

/* Data Source Cards */
.card.border-primary {
    border-left: 4px solid var(--primary-color) !important;
}

.card.border-success {
    border-left: 4px solid var(--success-color) !important;
}

.card.border-warning {
    border-left: 4px solid var(--warning-color) !important;
}

.card.border-info {
    border-left: 4px solid var(--accent-color) !important;
}

/* Loading Spinner */
.spinner-border {
    width: 3rem;
    height: 3rem;
    color: var(--primary-color);
}

/* Results */
.profile-card {
    transition: all 0.3s ease;
    border: 1px solid #99cfff;
}

.profile-card:hover {
    box-shadow: 0 8px 25px rgba(0, 102, 204, 0.15);
}

/* Badges */
.badge {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
}

.badge-primary {
    background-color: #0066cc !important;
    color: white !important;
}

.badge-success {
    background-color: #22c55e !important;
    color: white !important;
}

.badge-warning {
    background-color: #f59e0b !important;
    color: white !important;
}

.badge-info {
    background-color: #0ea5e9 !important;
    color: white !important;
}

/* Footer */
footer {
    margin-top: auto;
    background-color: white !important;
    border-top: 1px solid #99cfff;
}

/* Responsive Design */
@media (max-width: 768px) {
    .display-4 {
        font-size: 2.5rem;
    }
    
    .badge-container .badge {
        font-size: 0.75rem;
        margin-bottom: 0.5rem;
    }
    
    .card-body {
        padding: 1rem;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-up {
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

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

::-webkit-scrollbar-track {
    background: #e6f3ff;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #0066cc;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #0052a3;
}

/* Search Results */
.result-card {
    border-left: 4px solid transparent;
    transition: all 0.3s ease;
}

.result-card:hover {
    border-left-color: var(--primary-color);
    transform: translateX(5px);
}

/* Profile Completeness */
.completeness-indicator {
    display: inline-flex;
    align-items: center;
    font-size: 0.9rem;
}

/* Data Source Indicators */
.source-badge-pubmed { background-color: #e6f3ff !important; color: #0066cc !important; }
.source-badge-trials { background-color: #f0fdf4 !important; color: #22c55e !important; }
.source-badge-payments { background-color: #fef3c7 !important; color: #f59e0b !important; }
.source-badge-ai { background-color: #e0f2fe !important; color: #0ea5e9 !important; }

/* Loading States */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(230, 243, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Success States */
.success-highlight {
    background-color: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

/* Error States */
.error-highlight {
    background-color: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

/* Modern Enhancements for Tailwind Integration */

/* Enhanced Card Hover Effects */
.card-hover-modern {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover-modern:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 102, 204, 0.1), 0 10px 10px -5px rgba(0, 102, 204, 0.04);
}

/* Enhanced Focus States */
.focus-enhanced:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.15) !important;
    border-color: #0066cc !important;
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    box-shadow: 0 10px 15px -3px rgba(0, 102, 204, 0.1);
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.notification.success {
    background-color: #22c55e;
    color: white;
}

.notification.error {
    background-color: #ef4444;
    color: white;
}

.notification.warning {
    background-color: #f59e0b;
    color: white;
}

/* Tab Styles for Alpine.js */
.tab-button {
    position: relative;
    padding: 0.5rem 1rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: #6b7280;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

.tab-button:hover {
    color: #001429;
}

.tab-button.active {
    color: #0066cc;
    border-bottom-color: #0066cc;
}

/* Profile Stats Grid */
.stat-card {
    text-align: center;
    padding: 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    border: 1px solid #99cfff;
}

.stat-card:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.1);
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    color: #0066cc;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #0052a3;
}

/* Enhanced Progress Bars */
.progress-bar-modern {
    height: 0.5rem;
    border-radius: 0.25rem;
    background-color: #e6f3ff;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 0.25rem;
    transition: width 0.3s ease-in-out;
}

.progress-fill.green {
    background: linear-gradient(90deg, #22c55e, #16a34a);
}

.progress-fill.blue {
    background: linear-gradient(90deg, #0066cc, #0052a3);
}

.progress-fill.purple {
    background: linear-gradient(90deg, #8b5cf6, #7c3aed);
}

/* Badge Interactive */
.badge-interactive {
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.badge-interactive:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 4px rgba(0, 102, 204, 0.1);
}

/* Modern Loading Spinner */
.spinner-modern {
    border: 2px solid #e6f3ff;
    border-top: 2px solid #0066cc;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

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

/* Enhanced Search Input */
.search-input-modern {
    transition: all 0.3s ease;
    border: 2px solid #99cfff;
}

.search-input-modern:focus {
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
    transform: translateY(-1px);
}

/* Profile Card Modern */
.profile-card-modern {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #99cfff;
}

.profile-card-modern:hover {
    border-color: #0066cc;
    box-shadow: 0 10px 15px -3px rgba(0, 102, 204, 0.1);
}

/* Line clamp utility for text truncation */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Similar profiles card enhancements */
.similar-profile-card {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.similar-profile-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(0, 102, 204, 0.1), 0 4px 6px -2px rgba(0, 102, 204, 0.05);
}

/* Full window loader animations */
.loader-bounce-1 { animation-delay: 0ms; }
.loader-bounce-2 { animation-delay: 150ms; }
.loader-bounce-3 { animation-delay: 300ms; }

/* Enhanced focus states for accessibility */
.search-button:focus {
    outline: none;
    ring: 2px;
    ring-color: rgba(0, 102, 204, 0.5);
    ring-offset: 2px;
}

/* Responsive grid improvements */
@media (max-width: 768px) {
    .similar-profiles-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .similar-profile-card {
        padding: 1rem;
    }
}

@media (min-width: 1024px) {
    .similar-profiles-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Responsive Utilities */
@media (max-width: 640px) {
    .mobile-hide {
        display: none !important;
    }
    
    .mobile-stack {
        flex-direction: column !important;
    }
    
    .mobile-full {
        width: 100% !important;
    }
    
    .notification {
        right: 0.5rem;
        left: 0.5rem;
        width: auto;
    }
}

/* Enhanced Header and Navigation Styles */
.header-sticky {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.nav-item {
    position: relative;
    overflow: hidden;
}

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

.nav-item:hover::before {
    left: 100%;
}

/* Enhanced Sidebar Styles */
.sidebar-item {
    position: relative;
    overflow: hidden;
}

.sidebar-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(to bottom, #0066cc, #339fff);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.sidebar-item:hover::before {
    transform: scaleY(1);
}

/* Enhanced User Menu */
.user-avatar {
    background: linear-gradient(135deg, #0066cc, #339fff);
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.3);
}

.user-menu-dropdown {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Improved Mobile Responsiveness */
@media (max-width: 1024px) {
    .sidebar-width {
        width: 85vw;
        max-width: 384px;
    }
    
    .nav-center {
        display: none;
    }
}

@media (max-width: 768px) {
    .header-height {
        height: 72px;
    }
    
    .brand-text {
        display: none;
    }
    
    .user-info {
        display: none;
    }
    
    .sidebar-width {
        width: 90vw;
    }
    
    .sidebar-padding {
        padding: 1rem;
    }
}

@media (max-width: 640px) {
    .header-height {
        height: 64px;
    }
    
    .main-padding {
        padding: 1rem;
    }
    
    .sidebar-width {
        width: 100vw;
    }
}

/* Enhanced Loading States */
.loading-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Enhanced Focus States for Accessibility */
.focus-ring:focus {
    outline: none;
    ring: 2px;
    ring-color: rgba(0, 102, 204, 0.5);
    ring-offset: 2px;
    ring-offset-color: #ffffff;
}

/* Enhanced Hover Effects */
.hover-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 102, 204, 0.15);
}

/* Enhanced Button Styles */
.btn-primary-enhanced {
    background: linear-gradient(135deg, #0066cc, #0052a3);
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-primary-enhanced::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;
}

.btn-primary-enhanced:hover::before {
    left: 100%;
}

/* Enhanced Card Styles */
.card-modern {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .auto-dark {
        background-color: #001429 !important;
        color: #e6f3ff !important;
    }
    
    .auto-dark-border {
        border-color: #0052a3 !important;
    }
    
    .header-sticky {
        background-color: rgba(0, 20, 41, 0.9) !important;
    }
}

/* Scroll Animations */
@media (prefers-reduced-motion: no-preference) {
    .scroll-animate {
        opacity: 0;
        transform: translateY(30px);
        transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    }
    
    .scroll-animate.visible {
        opacity: 1;
        transform: translateY(0);
    }
    
    .stagger-animation {
        animation-delay: calc(var(--stagger) * 0.1s);
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-break {
        page-break-after: always;
    }
}