/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #1f2937;
    background-color: #f9fafb;
    overflow-x: hidden;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Navigation */
.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    color: #374151;
}

.nav-link:hover {
    background-color: #e0e7ff;
    color: #4f46e5;
}

.nav-link.active {
    background-color: #4f46e5;
    color: white;
}

/* Sections */
.section {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.section.active {
    display: block;
}

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

/* Quick Action Buttons */
.quick-action-btn {
    text-align: center;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.quick-action-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.quick-action-btn i {
    display: block;
    margin-bottom: 0.75rem;
}

/* Forms */
.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: white;
}

.form-input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-input:hover {
    border-color: #9ca3af;
}

/* Checkbox and Radio Buttons */
.checkbox-label, .radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    color: #374151;
    user-select: none;
}

.checkbox-input, .radio-input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkbox-custom, .radio-custom {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.75rem;
    border: 2px solid #d1d5db;
    border-radius: 0.25rem;
    transition: all 0.3s ease;
    position: relative;
}

.radio-custom {
    border-radius: 50%;
}

.checkbox-input:checked ~ .checkbox-custom,
.radio-input:checked ~ .radio-custom {
    background-color: #4f46e5;
    border-color: #4f46e5;
}

.checkbox-custom::after {
    content: '';
    position: absolute;
    display: none;
    left: 0.4rem;
    top: 0.1rem;
    width: 0.4rem;
    height: 0.8rem;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.radio-custom::after {
    content: '';
    position: absolute;
    display: none;
    top: 0.25rem;
    left: 0.25rem;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: white;
}

.checkbox-input:checked ~ .checkbox-custom::after,
.radio-input:checked ~ .radio-custom::after {
    display: block;
}

/* Symptom Cards */
.symptom-card {
    background-color: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.symptom-card:hover {
    border-color: #4f46e5;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Rating Slider */
.rating-slider {
    margin-top: 1rem;
}

.slider {
    width: 100%;
    height: 0.5rem;
    border-radius: 0.25rem;
    background: #e5e7eb;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: #4f46e5;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.slider::-webkit-slider-thumb:hover {
    background: #4338ca;
    transform: scale(1.1);
}

.slider::-moz-range-thumb {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: #4f46e5;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.rating-value {
    font-weight: bold;
    color: #4f46e5;
    font-size: 1.1rem;
}

/* Cards */
.card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    transition: all 0.3s ease;
}

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

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background-color: #4f46e5;
    color: white;
}

.btn-primary:hover {
    background-color: #4338ca;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background-color: #4b5563;
}

.btn-success {
    background-color: #10b981;
    color: white;
}

.btn-success:hover {
    background-color: #059669;
}

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

.btn-warning:hover {
    background-color: #d97706;
}

.btn-danger {
    background-color: #ef4444;
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
        z-index: 40;
    }

    .nav-menu.active {
        display: block;
    }

    .nav-link {
        border-radius: 0;
        border-bottom: 1px solid #e5e7eb;
    }

    .nav-link:last-child {
        border-bottom: none;
    }

    .quick-action-btn {
        padding: 1.5rem 1rem;
    }

    .symptom-card {
        padding: 1rem;
    }

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

/* Tablet Styles */
@media (max-width: 1024px) {
    .container {
        padding: 0 0.75rem;
    }

    .card {
        padding: 1rem;
    }
}

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

/* Focus styles for keyboard navigation */
.form-input:focus,
.btn:focus,
.nav-link:focus,
.slider:focus {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .form-input {
        border-width: 3px;
    }
    
    .nav-link.active {
        background-color: #000;
        color: #fff;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #111827;
        color: #f9fafb;
    }
    
    .card {
        background-color: #1f2937;
        color: #f9fafb;
    }
    
    .symptom-card {
        background-color: #374151;
        border-color: #4b5563;
    }
    
    .form-input {
        background-color: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    .form-input:focus {
        border-color: #818cf8;
    }
}

/* Loading states */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1rem;
    height: 1rem;
    margin: -0.5rem 0 0 -0.5rem;
    border: 2px solid #e5e7eb;
    border-top-color: #4f46e5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.hidden { display: none; }
.block { display: block; }
.inline { display: inline; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }

.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

.space-x-2 > * + * { margin-left: 0.5rem; }
.space-x-3 > * + * { margin-left: 0.75rem; }
.space-x-8 > * + * { margin-left: 2rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-4 { margin-top: 1rem; }

.mr-2 { margin-right: 0.5rem; }
.mr-3 { margin-right: 0.75rem; }

.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }

.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }

.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }

.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }

.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); }

.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

.text-gray-400 { color: #9ca3af; }
.text-gray-600 { color: #4b5563; }
.text-gray-900 { color: #111827; }

.text-white { color: white; }

.bg-gray-50 { background-color: #f9fafb; }
.bg-gray-800 { background-color: #1f2937; }
.bg-white { background-color: white; }

.bg-blue-50 { background-color: #eff6ff; }
.bg-blue-500 { background-color: #3b82f6; }
.bg-blue-600 { background-color: #2563eb; }

.bg-green-50 { background-color: #ecfdf5; }
.bg-green-500 { background-color: #10b981; }
.bg-green-600 { background-color: #059669; }

.bg-purple-50 { background-color: #faf5ff; }
.bg-purple-500 { background-color: #a855f7; }
.bg-purple-600 { background-color: #9333ea; }

.bg-orange-50 { background-color: #fff7ed; }
.bg-orange-500 { background-color: #f97316; }
.bg-orange-600 { background-color: #ea580c; }

.bg-pink-50 { background-color: #fdf2f8; }
.bg-pink-500 { background-color: #ec4899; }
.bg-pink-600 { background-color: #db2777; }

.bg-red-50 { background-color: #fef2f2; }
.bg-red-500 { background-color: #ef4444; }
.bg-red-600 { background-color: #dc2626; }

.bg-indigo-600 { background-color: #4f46e5; }

.text-blue-600 { color: #2563eb; }
.text-green-600 { color: #059669; }
.text-purple-600 { color: #9333ea; }
.text-orange-600 { color: #ea580c; }
.text-pink-600 { color: #db2777; }
.text-red-600 { color: #dc2626; }
.text-indigo-600 { color: #4f46e5; }

/* Medical News Styles */
.news-card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
}

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

.news-card.featured {
    border: 2px solid #4f46e5;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
}

.news-header {
    padding: 1.25rem;
    border-bottom: 1px solid #e5e7eb;
}

.news-card.featured .news-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.news-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.category-research {
    background-color: #dbeafe;
    color: #1d4ed8;
}

.category-therapy {
    background-color: #fef3c7;
    color: #d97706;
}

.category-breakthrough {
    background-color: #d1fae5;
    color: #059669;
}

.category-treatment {
    background-color: #fce7f3;
    color: #be185d;
}

.category-clinical_trial {
    background-color: #e0e7ff;
    color: #4f46e5;
}

.category-medication {
    background-color: #ecfdf5;
    color: #047857;
}

.news-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.news-card.featured .news-title {
    color: white;
}

.news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: #6b7280;
}

.news-card.featured .news-meta {
    color: rgba(255, 255, 255, 0.8);
}

.news-content {
    padding: 1.25rem;
    font-size: 0.875rem;
    color: #4b5563;
    line-height: 1.6;
}

.news-card.featured .news-content {
    color: rgba(255, 255, 255, 0.9);
}

.news-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid #e5e7eb;
    background-color: #f9fafb;
}

.news-card.featured .news-footer {
    background-color: rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.news-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.news-tag {
    background-color: #e5e7eb;
    color: #374151;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
}

.news-card.featured .news-tag {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.news-source {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
}

.news-card.featured .news-source {
    color: rgba(255, 255, 255, 0.7);
}

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

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

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

.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

.transition-colors { transition-property: color, background-color, border-color; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }

.transition-all { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }

.hover\:scale-105:hover { transform: scale(1.05); }
.hover\:shadow-xl:hover { box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); }

/* Responsive Grid */
@media (min-width: 640px) {
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .md\:flex-row { flex-direction: row; }
    .md\:block { display: block; }
    .md\:hidden { display: none; }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}