/* Health Encyclopedia - Custom Styles */
/* Complementing Tailwind CSS with health-focused design */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Base styles */
* {
    font-family: 'Inter', sans-serif;
}

/* Health color palette */
:root {
    --health-blue: #2563eb;
    --health-blue-light: #3b82f6;
    --health-green: #059669;
    --health-green-light: #10b981;
    --health-purple: #7c3aed;
    --health-purple-light: #8b5cf6;
    --health-red: #dc2626;
    --health-red-light: #ef4444;
    --health-yellow: #d97706;
    --health-yellow-light: #f59e0b;
    --health-gray: #6b7280;
    --health-gray-light: #9ca3af;
}

/* Custom gradient backgrounds */
.health-gradient-blue {
    background: linear-gradient(135deg, var(--health-blue) 0%, var(--health-blue-light) 100%);
}

.health-gradient-green {
    background: linear-gradient(135deg, var(--health-green) 0%, var(--health-green-light) 100%);
}

.health-gradient-purple {
    background: linear-gradient(135deg, var(--health-purple) 0%, var(--health-purple-light) 100%);
}

/* Card hover effects */
.health-card {
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

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

/* Medical icon styling */
.medical-icon {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    padding: 0.75rem;
    margin-right: 1rem;
    flex-shrink: 0;
}

/* Symptom and condition badges */
.symptom-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.symptom-badge svg {
    width: 1rem;
    height: 1rem;
    margin-right: 0.5rem;
}

/* Alert boxes */
.alert-info {
    background-color: #eff6ff;
    border-color: #3b82f6;
    border-left-width: 4px;
    color: #1e40af;
}

.alert-warning {
    background-color: #fffbeb;
    border-color: #f59e0b;
    border-left-width: 4px;
    color: #92400e;
}

.alert-danger {
    background-color: #fef2f2;
    border-color: #ef4444;
    border-left-width: 4px;
    color: #dc2626;
}

.alert-success {
    background-color: #f0fdf4;
    border-color: #10b981;
    border-left-width: 4px;
    color: #047857;
}

/* List styling */
.health-list li {
    display: flex;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.health-list li svg {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.75rem;
    margin-top: 0.125rem;
    flex-shrink: 0;
}

/* Responsive grid improvements */
@media (min-width: 768px) {
    .health-grid-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .health-grid-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Hero section styling */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    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 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.15)"/><circle cx="90" cy="40" r="0.5" fill="rgba(255,255,255,0.15)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

/* Content sections */
.content-section {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

/* Navigation improvements */
.nav-link {
    position: relative;
    transition: all 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: currentColor;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Footer styling */
.footer-section {
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
}

/* Search functionality */
.search-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--health-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
}

/* Loading states */
.loading-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 50%;
    border-top-color: var(--health-blue);
    animation: spin 1s ease-in-out infinite;
}

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

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

    body {
        font-size: 12pt;
        line-height: 1.4;
    }

    .content-section {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus states for accessibility */
button:focus,
a:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--health-blue);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --health-blue: #0066cc;
        --health-green: #008000;
        --health-purple: #800080;
        --health-red: #cc0000;
        --health-yellow: #ffcc00;
    }
}

/* Dark mode support (if needed in future) */
@media (prefers-color-scheme: dark) {
    .dark-mode-text {
        color: #f9fafb;
    }

    .dark-mode-bg {
        background-color: #1f2937;
    }
}

/* Mobile optimizations */
@media (max-width: 640px) {
    .hero-section h1 {
        font-size: 2rem;
    }

    .hero-section p {
        font-size: 1rem;
    }

    .content-section {
        margin: 1rem;
        padding: 1rem;
    }

    .health-grid-3,
    .health-grid-2 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Tablet optimizations */
@media (min-width: 641px) and (max-width: 1023px) {
    .health-grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Desktop optimizations */
@media (min-width: 1024px) {
    .container-custom {
        max-width: 1200px;
    }
}

/* Utility classes */
.text-balance {
    text-wrap: balance;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

/* Animation classes for future enhancements */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

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

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

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

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

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

/* Performance optimizations */
.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

/* End of custom styles */
