/* 
 * ENDOAGE Medical SaaS Platform - Main Stylesheet
 * Bootstrap 5.3+ Based Design
 * Color Palette: Medical Trust Blues, Clean Neutrals, Premium Feel
 */

:root {
    /* Primary Brand Colors - Medical Trust */
    --primary-blue: #2563EB;
    --primary-dark: #1E40AF;
    --primary-light: #3B82F6;
    
    /* Secondary Colors */
    --secondary-teal: #0EA5E9;
    --secondary-cyan: #06B6D4;
    
    /* Accent Colors */
    --accent-green: #10B981;
    --accent-purple: #8B5CF6;
    --accent-orange: #F59E0B;
    
    /* Neutral Palette */
    --neutral-50: #F9FAFB;
    --neutral-100: #F3F4F6;
    --neutral-200: #E5E7EB;
    --neutral-300: #D1D5DB;
    --neutral-400: #9CA3AF;
    --neutral-500: #6B7280;
    --neutral-600: #4B5563;
    --neutral-700: #374151;
    --neutral-800: #1F2937;
    --neutral-900: #111827;
    
    /* Semantic Colors */
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #3B82F6;
    
    /* Typography */
    --font-primary: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-heading: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* Transitions */
    --transition-base: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
}

/* Base Typography */
body {
    font-family: var(--font-primary);
    color: var(--neutral-800);
    line-height: 1.6;
    font-size: 16px;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--neutral-900);
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

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

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

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

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

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

.slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

.slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

/* Custom Button Styles */
.btn {
    font-weight: 500;
    padding: 0.625rem 1.5rem;
    border-radius: 0.5rem;
    transition: var(--transition-base);
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-light));
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-blue));
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-outline-primary {
    border: 2px solid var(--primary-blue);
    color: var(--primary-blue);
}

.btn-outline-primary:hover {
    background: var(--primary-blue);
    color: white;
    transform: translateY(-2px);
}

.btn-lg {
    padding: 0.875rem 2rem;
    font-size: 1.125rem;
}

/* Card Styles */
.card {
    border: none;
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition-base);
    overflow: hidden;
}

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

.card-header {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-light));
    color: white;
    border: none;
    padding: 1.25rem 1.5rem;
    font-weight: 600;
}

.card-img-overlay-gradient {
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
}

/* Form Styles */
.form-control, .form-select {
    border: 2px solid var(--neutral-200);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    transition: var(--transition-fast);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-label {
    font-weight: 500;
    color: var(--neutral-700);
    margin-bottom: 0.5rem;
}

.form-check-input:checked {
    background-color: var(--primary-blue);
    border-color: var(--primary-blue);
}

/* Custom Radio/Checkbox with Icons */
.custom-radio-card {
    border: 2px solid var(--neutral-200);
    border-radius: 0.75rem;
    padding: 1.25rem;
    cursor: pointer;
    transition: var(--transition-base);
    position: relative;
}

.custom-radio-card:hover {
    border-color: var(--primary-blue);
    background: var(--neutral-50);
}

.custom-radio-card input[type="radio"]:checked ~ .card-content {
    border-color: var(--primary-blue);
    background: rgba(37, 99, 235, 0.05);
}

.custom-radio-card input[type="radio"]:checked ~ .card-content::after {
    content: '✓';
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--primary-blue);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
}

/* Navigation Styles */
.navbar {
    background: white;
    box-shadow: var(--shadow-sm);
    padding: 1rem 0;
    transition: var(--transition-base);
}

.navbar-scrolled {
    box-shadow: var(--shadow-md);
    padding: 0.5rem 0;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-blue);
}

.nav-link {
    color: var(--neutral-700);
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    transition: var(--transition-fast);
    position: relative;
}

.nav-link:hover {
    color: var(--primary-blue);
}

.nav-link.active {
    color: var(--primary-blue);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1rem;
    right: 1rem;
    height: 2px;
    background: var(--primary-blue);
}

/* Badge Styles */
.badge {
    padding: 0.375rem 0.75rem;
    font-weight: 600;
    border-radius: 0.375rem;
}

.badge-status {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Avatar Styles */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
    box-shadow: var(--shadow-sm);
}

.avatar-lg {
    width: 80px;
    height: 80px;
}

.avatar-xl {
    width: 120px;
    height: 120px;
}

.avatar-placeholder {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-teal));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Progress Bar Styles */
.progress {
    height: 0.5rem;
    border-radius: 0.5rem;
    background: var(--neutral-200);
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary-blue), var(--secondary-teal));
    border-radius: 0.5rem;
}

.progress-lg {
    height: 1rem;
}

/* Modal Styles */
.modal-content {
    border: none;
    border-radius: 1rem;
    box-shadow: var(--shadow-xl);
}

.modal-header {
    border-bottom: 1px solid var(--neutral-200);
    padding: 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--neutral-200);
    padding: 1.5rem;
}

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

.table thead th {
    background: var(--neutral-50);
    color: var(--neutral-700);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
    border: none;
    padding: 1rem;
}

.table tbody tr {
    transition: var(--transition-fast);
}

.table tbody tr:hover {
    background: var(--neutral-50);
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--neutral-200);
}

/* Alert Styles */
.alert {
    border: none;
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    border-left: 4px solid;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-left-color: var(--success);
    color: #065f46;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-left-color: var(--warning);
    color: #78350f;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border-left-color: var(--danger);
    color: #7f1d1d;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border-left-color: var(--info);
    color: #1e3a8a;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-blue), var(--secondary-teal));
    color: white;
    padding: 5rem 0;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="rgba(255,255,255,0.1)" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,122.7C672,117,768,139,864,154.7C960,171,1056,181,1152,165.3C1248,149,1344,107,1392,85.3L1440,64L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>');
    background-size: cover;
    opacity: 0.3;
}

/* Stats Section */
.stat-card {
    text-align: center;
    padding: 2rem;
    border-radius: 1rem;
    background: white;
    box-shadow: var(--shadow-md);
    transition: var(--transition-base);
}

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

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-blue);
    line-height: 1;
}

.stat-label {
    color: var(--neutral-600);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.5rem;
}

/* Timeline Styles */
.timeline {
    position: relative;
    padding: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 2rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--neutral-200);
}

.timeline-item {
    position: relative;
    padding-left: 4rem;
    padding-bottom: 2rem;
}

.timeline-marker {
    position: absolute;
    left: 1.25rem;
    top: 0;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: var(--primary-blue);
    border: 3px solid white;
    box-shadow: var(--shadow-md);
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--neutral-200);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Utility Classes */
.text-primary { color: var(--primary-blue) !important; }
.text-secondary { color: var(--secondary-teal) !important; }
.bg-primary-gradient { background: linear-gradient(135deg, var(--primary-blue), var(--primary-light)); }
.bg-light-gray { background: var(--neutral-50); }

.hover-lift {
    transition: var(--transition-base);
}

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

/* Responsive Adjustments */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    
    .hero-section {
        padding: 3rem 0;
    }
    
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
}

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