/* Base.css - Core layout and utility styles for Remote Life Health Platform */

/* CSS Variables for consistent theming */
:root {
    /* Primary Colors */
    --primary-color: #2c5aa0;
    --primary-dark: #1e3f6f;
    --primary-light: #4a90e2;
    --primary-bg-light: rgba(44, 90, 160, 0.1);
    
    /* Secondary Colors */
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    
    /* Healthcare-specific Colors */
    --medical-blue: #0074d9;
    --medical-green: #2ecc40;
    --medical-red: #ff4136;
    --medical-orange: #ff851b;
    
    /* Background Colors */
    --body-bg: #f8f9fa;
    --content-bg: #ffffff;
    --sidebar-bg: #343a40;
    --navbar-bg: var(--primary-color);
    
    /* Text Colors */
    --text-primary: #333333;
    --text-secondary: #6c757d;
    --text-muted: #868e96;
    --text-light: #adb5bd;
    
    /* Border and Shadow */
    --border-color: #dee2e6;
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    --box-shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.15);
    --box-shadow-hover: 0 6px 12px rgba(0, 0, 0, 0.15);
    
    /* Spacing */
    --header-height: 70px;
    --footer-height: 80px;
    
    /* Animations */
    --transition-fast: 0.15s ease-in-out;
    --transition-normal: 0.3s ease-in-out;
    --transition-slow: 0.5s ease-in-out;
}

/* Reset and base styles */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--body-bg);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 14px;
}

/* Layout Components */
.main-content {
    padding-top: var(--header-height);
    min-height: calc(100vh - var(--footer-height));
}

/* Navigation Enhancements */
.navbar {
    box-shadow: var(--box-shadow);
    height: var(--header-height);
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.3rem;
}

.navbar-nav .nav-link {
    padding: 0.75rem 1rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
}

/* Card Components */
.card {
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow);
    transition: box-shadow var(--transition-normal);
}

.card:hover {
    box-shadow: var(--box-shadow-hover);
}

.card-header {
    background-color: var(--content-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
}

.card-body {
    padding: 1.5rem;
}

/* Button Enhancements */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    transition: all var(--transition-fast);
}

.btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(44, 90, 160, 0.25);
}

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

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

/* Form Controls */
.form-control,
.form-select {
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 0.2rem rgba(44, 90, 160, 0.1);
}

/* Alert Enhancements */
.alert {
    border: none;
    border-radius: var(--border-radius);
    border-left: 4px solid;
    font-weight: 500;
}

.alert-primary {
    background-color: var(--primary-bg-light);
    color: var(--primary-dark);
    border-left-color: var(--primary-color);
}

.alert-success {
    border-left-color: var(--success-color);
}

.alert-warning {
    border-left-color: var(--warning-color);
}

.alert-danger {
    border-left-color: var(--danger-color);
}

.alert-info {
    border-left-color: var(--info-color);
}

/* Table Enhancements */
.table {
    border-radius: var(--border-radius);
    overflow: hidden;
}

.table thead th {
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    color: var(--text-primary);
    background-color: #f8f9fa;
}

.table-hover tbody tr:hover {
    background-color: rgba(44, 90, 160, 0.05);
}

/* Badge Enhancements */
.badge {
    font-weight: 500;
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
    border-radius: var(--border-radius);
}

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

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

.modal-body {
    padding: 1.5rem;
}

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

/* Dropdown Enhancements */
.dropdown-menu {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-lg);
    padding: 0.5rem 0;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: var(--primary-bg-light);
    color: var(--primary-color);
}

.dropdown-divider {
    margin: 0.5rem 0;
    border-color: var(--border-color);
}

/* Utility Classes */
.text-primary-custom {
    color: var(--primary-color) !important;
}

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

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

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

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

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

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

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* Responsive Design */
@media (max-width: 768px) {
    :root {
        --header-height: 60px;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .navbar-nav .nav-link {
        padding: 0.5rem 1rem;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .footer,
    .btn,
    .dropdown {
        display: none !important;
    }
    
    .main-content {
        padding-top: 0 !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid var(--border-color) !important;
    }
}

/* Accessibility Enhancements */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

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

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000000;
        --text-secondary: #000000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}