/* CareFuse Components CSS */

/* Enhanced Card Components */
.enhanced-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: var(--transition-normal);
    position: relative;
}

.enhanced-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--bg-teal-gradient);
}

.enhanced-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.card-header {
    padding: 2rem 2rem 0;
}

.card-body {
    padding: 0 2rem 2rem;
}

.card-footer {
    padding: 1rem 2rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-light);
}

/* Medical Icons */
.medical-icon {
    width: 50px;
    height: 50px;
    background: var(--bg-teal-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.medical-icon.large {
    width: 80px;
    height: 80px;
    font-size: 2rem;
}

.medical-icon.small {
    width: 40px;
    height: 40px;
    font-size: 1rem;
}

/* Progress Bars */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--gray-200);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin: 1rem 0;
}

.progress-fill {
    height: 100%;
    background: var(--bg-teal-gradient);
    border-radius: var(--radius-sm);
    transition: width 1s ease-in-out;
}

.progress-fill.animated {
    animation: progressAnimation 2s ease-in-out;
}

@keyframes progressAnimation {
    from { width: 0%; }
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    font-weight: 600;
}

.status-badge.success {
    background: rgba(5, 150, 105, 0.1);
    color: var(--secondary-green);
}

.status-badge.warning {
    background: rgba(245, 158, 11, 0.1);
    color: #D97706;
}

.status-badge.error {
    background: rgba(239, 68, 68, 0.1);
    color: #DC2626;
}

.status-badge.info {
    background: var(--primary-teal-alpha);
    color: var(--primary-teal);
}

/* Data Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.data-table th {
    background: var(--bg-secondary);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
}

.data-table tr:hover {
    background: var(--bg-tertiary);
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* Metric Cards */
.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.metric-card-enhanced {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: var(--transition-normal);
}

.metric-card-enhanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--bg-teal-gradient);
}

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

.metric-value-large {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary-teal);
    margin-bottom: 0.5rem;
    line-height: 1;
}

.metric-label-enhanced {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.metric-description-enhanced {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.metric-trend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.metric-trend.positive {
    color: var(--secondary-green);
}

.metric-trend.negative {
    color: #DC2626;
}

.metric-trend.neutral {
    color: var(--text-muted);
}

/* Alert Components */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    margin: 1rem 0;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.alert-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 0.125rem;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.alert-description {
    font-size: 0.875rem;
    line-height: 1.5;
}

.alert.info {
    background: rgba(59, 130, 246, 0.1);
    border-left: 4px solid #3B82F6;
    color: #1E40AF;
}

.alert.success {
    background: rgba(5, 150, 105, 0.1);
    border-left: 4px solid var(--secondary-green);
    color: #065F46;
}

.alert.warning {
    background: rgba(245, 158, 11, 0.1);
    border-left: 4px solid #F59E0B;
    color: #92400E;
}

.alert.error {
    background: rgba(239, 68, 68, 0.1);
    border-left: 4px solid #EF4444;
    color: #991B1B;
}

/* Loading States */
.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-md);
}

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

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-text.large {
    height: 1.5rem;
}

.skeleton-text.small {
    height: 0.75rem;
}

.skeleton-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

.skeleton-card {
    height: 200px;
    border-radius: var(--radius-lg);
}

/* Interactive Elements */
.interactive-card {
    cursor: pointer;
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.interactive-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: var(--transition-slow);
}

.interactive-card:hover::after {
    left: 100%;
}

.interactive-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

/* Form Components */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: var(--transition-fast);
    background: var(--white);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-teal);
    box-shadow: 0 0 0 3px var(--primary-teal-alpha);
}

.form-input.error {
    border-color: #EF4444;
}

.form-input.success {
    border-color: var(--secondary-green);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

.form-checkbox {
    width: 1.25rem;
    height: 1.25rem;
    accent-color: var(--primary-teal);
}

.form-radio {
    width: 1.25rem;
    height: 1.25rem;
    accent-color: var(--primary-teal);
}

.form-error {
    color: #EF4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.form-help {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Modal Components */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: var(--transition-normal);
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid var(--border-light);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    padding: 1rem 2rem 2rem;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Tabs Component */
.tabs {
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.tab-list {
    display: flex;
    gap: 0;
    list-style: none;
    padding: 0;
    margin: 0;
}

.tab-button {
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition-fast);
}

.tab-button:hover {
    color: var(--text-primary);
}

.tab-button.active {
    color: var(--primary-teal);
    border-bottom-color: var(--primary-teal);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeInUp 0.3s ease-out;
}

/* Accordion Component */
.accordion {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.accordion-item {
    border-bottom: 1px solid var(--border-color);
}

.accordion-item:last-child {
    border-bottom: none;
}

.accordion-header {
    padding: 1.5rem;
    background: var(--bg-secondary);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition-fast);
}

.accordion-header:hover {
    background: var(--bg-tertiary);
}

.accordion-title {
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.accordion-icon {
    color: var(--primary-teal);
    transition: var(--transition-fast);
}

.accordion-item.active .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.accordion-item.active .accordion-content {
    max-height: 500px;
}

.accordion-body {
    padding: 1.5rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Dropdown Component */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
}

.dropdown-toggle:hover {
    border-color: var(--primary-teal);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition-fast);
}

.dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-fast);
}

.dropdown-item:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-light);
    margin: 0.5rem 0;
}

/* Breadcrumb Component */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0;
    font-size: 0.875rem;
}

.breadcrumb-item {
    color: var(--text-muted);
}

.breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 500;
}

.breadcrumb-separator {
    color: var(--text-light);
}

.breadcrumb-link {
    color: var(--primary-teal);
    text-decoration: none;
    transition: var(--transition-fast);
}

.breadcrumb-link:hover {
    text-decoration: underline;
}

/* Pagination Component */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0;
}

.pagination-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-fast);
}

.pagination-item:hover {
    border-color: var(--primary-teal);
    color: var(--primary-teal);
}

.pagination-item.active {
    background: var(--primary-teal);
    border-color: var(--primary-teal);
    color: var(--white);
}

.pagination-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-item.disabled:hover {
    border-color: var(--border-color);
    color: var(--text-secondary);
}

/* Search Component */
.search-box {
    position: relative;
    max-width: 400px;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    transition: var(--transition-fast);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-teal);
    box-shadow: 0 0 0 3px var(--primary-teal-alpha);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.125rem;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 0.25rem;
}

.search-result-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: var(--transition-fast);
}

.search-result-item:hover {
    background: var(--bg-secondary);
}

.search-result-item:last-child {
    border-bottom: none;
}

/* Tag Component */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    font-weight: 500;
}

.tag.primary {
    background: var(--primary-teal-alpha);
    color: var(--primary-teal);
}

.tag.success {
    background: rgba(5, 150, 105, 0.1);
    color: var(--secondary-green);
}

.tag.warning {
    background: rgba(245, 158, 11, 0.1);
    color: #D97706;
}

.tag.error {
    background: rgba(239, 68, 68, 0.1);
    color: #DC2626;
}

.tag-close {
    background: none;
    border: none;
    color: currentColor;
    cursor: pointer;
    padding: 0;
    font-size: 1rem;
    opacity: 0.7;
    transition: var(--transition-fast);
}

.tag-close:hover {
    opacity: 1;
}

/* Responsive Utilities */
@media (max-width: 768px) {
    .metric-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .tab-list {
        flex-wrap: wrap;
    }
    
    .dropdown-menu {
        position: fixed;
        top: auto;
        left: 1rem;
        right: 1rem;
        width: auto;
    }
    
    .pagination {
        flex-wrap: wrap;
    }
    
    .search-box {
        max-width: 100%;
    }
}



/* Patient Profile Table */
.patient-profile-table {
    margin-bottom: 2rem;
}

.profile-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.profile-table th,
.profile-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.profile-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #374151;
}

.profile-table tbody tr:hover {
    background: #f9fafb;
}

/* TKA Explanation */
.tka-explanation {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 1rem;
    margin: 1.5rem 0;
}

.tka-explanation h4 {
    color: #92400e;
    margin-bottom: 0.5rem;
}

.tka-explanation p {
    color: #92400e;
    margin: 0;
}

/* Prediction Sections */
.prediction-sections {
    display: grid;
    gap: 2rem;
    margin: 2rem 0;
}

.prediction-section {
    background: #f8fafc;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
}

.section-header-with-prediction {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header-simple {
    margin-bottom: 1rem;
}

.prediction-result-box {
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}

.low-benefit-red {
    background: white;
    color: #dc2626;
    border: 2px solid #dc2626;
}

.prediction-details {
    space-y: 1rem;
}

.prediction-probability {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.probability-bar {
    width: 100%;
    height: 20px;
    background: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.probability-fill {
    height: 100%;
    background: #10b981;
    transition: width 0.3s ease;
}

.probability-fill.conservative {
    background: #059669;
}

.prediction-status {
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 500;
    margin-bottom: 1rem;
}

.prediction-status.success {
    background: #d1fae5;
    color: #065f46;
}

.prediction-summary {
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.top-influencers h5 {
    margin-bottom: 1rem;
    color: #374151;
}

.influencer-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e5e7eb;
}

.influencer-item:last-child {
    border-bottom: none;
}

.influencer-name {
    flex: 1;
    font-weight: 500;
}

.influencer-value {
    font-weight: 600;
    margin: 0 1rem;
}

.influencer-value.positive {
    color: #059669;
}

.influencer-value.negative {
    color: #dc2626;
}

.influencer-impact {
    font-size: 0.9rem;
    color: #6b7280;
}

.influencer-note {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 4px;
    font-style: italic;
}

/* Counterfactual Explanation */
.counterfactual-explanation {
    background: #eff6ff;
    border: 1px solid #3b82f6;
    border-radius: 8px;
    padding: 1rem;
    margin: 1.5rem 0;
}

.counterfactual-explanation h4 {
    color: #1e40af;
    margin-bottom: 0.5rem;
}

.counterfactual-explanation p {
    color: #1e40af;
    margin: 0;
    line-height: 1.6;
}

/* Contributing Factors */
.contributing-factors {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.contributing-factors p {
    color: #6b7280;
    font-size: 0.9rem;
    margin: 0;
}



/* Three Pillars Problem Cards Styling */
.accountability-stats,
.subjectivity-stats,
.transparency-stats {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
}

.accountability-item,
.subjectivity-item,
.transparency-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1rem;
    background: rgba(31, 122, 122, 0.05);
    border-radius: 8px;
    border-left: 4px solid var(--primary-teal);
}

.accountability-item .stat-number,
.subjectivity-item .stat-number,
.transparency-item .stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-teal);
    margin-bottom: 0.25rem;
}

.accountability-item .stat-label,
.subjectivity-item .stat-label,
.transparency-item .stat-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.accountability-item .stat-description,
.subjectivity-item .stat-description,
.transparency-item .stat-description {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Responsive adjustments for three pillars */
@media (max-width: 768px) {
    .accountability-stats,
    .subjectivity-stats,
    .transparency-stats {
        gap: 0.75rem;
    }
    
    .accountability-item,
    .subjectivity-item,
    .transparency-item {
        padding: 0.75rem;
    }
    
    .accountability-item .stat-number,
    .subjectivity-item .stat-number,
    .transparency-item .stat-number {
        font-size: 1.25rem;
    }
}


/* Conservative Care Opportunity Styling */
.conservative-stats {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
}

.conservative-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1rem;
    background: rgba(31, 122, 122, 0.05);
    border-radius: 8px;
    border-left: 4px solid var(--primary-teal);
}

.conservative-item .stat-number {
    /* match other columns' stat-number sizing to keep columns consistent */
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-teal);
    margin-bottom: 0.25rem;
}

.conservative-item .stat-number {
    white-space: pre-line; /* honor line breaks like <br> */
    line-height: 1.1;
}

.conservative-item .stat-label {
    font-weight: 600; /* match other columns */
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.conservative-item .stat-description {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Four-column grid layout for problem cards */
@media (min-width: 1200px) {
    .problem-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 1199px) and (min-width: 768px) {
    .problem-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 767px) {
    .problem-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .conservative-stats {
        gap: 0.75rem;
    }
    
    .conservative-item {
        padding: 0.75rem;
    }
    
    .conservative-item .stat-number {
        font-size: 1.25rem;
    }
}



/* Navigation Dropdown Styles */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-trigger {
    position: relative;
}

/* Global box-sizing and responsive helpers */
*, *::before, *::after {
    box-sizing: border-box;
}

img, svg, video {
    max-width: 100%;
    height: auto;
}

/* Fluid container adjustments for small screens */
.nav-container, .section-container {
    padding-left: 1rem;
    padding-right: 1rem;
}

/* Mobile-first responsive tweaks */
@media (max-width: 767px) {
    body {
        -webkit-text-size-adjust: 100%; /* prevent automatic zoom */
    }

    .nav-container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        height: auto;
    }

    .hero-container, .section-container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    /* Stack hero stats and reduce sizes so page fits width without zooming */
    .hero-stats {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .stat-card .stat-number, .metric-value-large {
        font-size: 1.5rem !important;
    }

    /* Reduce large paddings that cause overflow */
    .card-header, .card-body, .card-footer, .metric-card-enhanced, .enhanced-card {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    /* Problem grid should be single column on small screens */
    .problem-grid {
        grid-template-columns: 1fr !important;
    }

    /* Ensure no content pushes beyond viewport */
    .main-content, .section-container {
        overflow-x: hidden;
    }
}

.dropdown-trigger::after {
    content: '\f107';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-left: 0.5rem;
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.nav-dropdown:hover .dropdown-trigger::after {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    min-width: 160px;
    z-index: 1000;
    border: 1px solid rgba(31, 122, 122, 0.1);
}

.nav-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(31, 122, 122, 0.05);
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: rgba(31, 122, 122, 0.05);
    color: var(--primary-teal);
}

.dropdown-item.active {
    background: rgba(31, 122, 122, 0.1);
    color: var(--primary-teal);
    font-weight: 600;
}

/* Page Styles */
.page-hero {
    background: linear-gradient(135deg, var(--primary-teal) 0%, #2A9999 100%);
    color: white;
    padding: 6rem 0 4rem;
    margin-top: 80px;
}

.page-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.page-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.page-subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    line-height: 1.6;
}

/* Careers Page Styles */
.careers-content {
    padding: 4rem 0;
}

.careers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.company-values {
    margin-top: 3rem;
}

.values-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.value-item {
    text-align: center;
    padding: 2rem;
    background: rgba(31, 122, 122, 0.05);
    border-radius: 12px;
    transition: transform 0.3s ease;
}

.value-item:hover {
    transform: translateY(-5px);
}

.value-icon {
    width: 60px;
    height: 60px;
    background: var(--primary-teal);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: white;
    font-size: 1.5rem;
}

.value-item h4 {
    color: var(--primary-teal);
    margin-bottom: 0.5rem;
}

.status-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
    background: rgba(31, 122, 122, 0.05);
    border-radius: 12px;
    border-left: 4px solid var(--primary-teal);
}

.status-icon {
    font-size: 2rem;
    color: var(--primary-teal);
}

.opportunities-list {
    list-style: none;
    padding: 0;
}

.opportunities-list li {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(31, 122, 122, 0.1);
}

.opportunities-list li:last-child {
    border-bottom: none;
}

.opportunities-list i {
    color: var(--primary-teal);
    width: 20px;
}

.contact-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

/* Contact Page Styles */
.contact-content {
    padding: 4rem 0;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.contact-methods {
    margin: 3rem 0;
}

.contact-method {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 2rem;
    background: rgba(31, 122, 122, 0.05);
    border-radius: 12px;
    margin-bottom: 2rem;
}

.method-icon {
    width: 50px;
    height: 50px;
    background: var(--primary-teal);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.method-content h3 {
    color: var(--primary-teal);
    margin-bottom: 0.5rem;
}

.method-note {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
}

.help-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

.help-item {
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    border: 1px solid rgba(31, 122, 122, 0.1);
    transition: transform 0.3s ease;
}

.help-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(31, 122, 122, 0.1);
}

.help-item i {
    color: var(--primary-teal);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.help-item h4 {
    color: var(--primary-teal);
    margin-bottom: 0.5rem;
}

/* Contact Form Styles */
.form-container {
    background: white;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.contact-form {
    margin-top: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid rgba(31, 122, 122, 0.2);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-teal);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-actions {
    text-align: center;
    margin-top: 2rem;
}

.form-note {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Footer Styles */
.main-footer {
    background: var(--text-primary);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.footer-logo-image {
    width: 30px;
    height: 30px;
}

.footer-logo-text {
    font-size: 1.25rem;
    font-weight: 700;
}

.footer-description {
    opacity: 0.8;
    line-height: 1.6;
}

.footer-section h4 {
    color: var(--primary-teal);
    margin-bottom: 1rem;
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: white;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.footer-links a:hover {
    opacity: 1;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
    text-align: center;
    opacity: 0.6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .careers-grid,
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .values-grid,
    .help-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .contact-actions {
        flex-direction: column;
    }
    
    .form-container {
        padding: 2rem;
    }
}

@media (max-width: 480px) {
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .dropdown-menu {
        left: -50px;
        min-width: 200px;
    }
}


/* Navigation Bar Fixes */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(31, 122, 122, 0.1);
    z-index: 1000;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 70px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
}

.logo-image {
    height: 32px;
    width: auto;
    object-fit: contain;
    display: block;
}

.nav-links {
    display: flex;
    gap: 24px;
    align-items: center;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-teal);
    cursor: pointer;
}

/* Data Inputs Callout */
.data-inputs-callout {
    margin: 3rem 0;
}

.callout-card {
    background: linear-gradient(135deg, #f8fffe 0%, #e6f7f7 100%);
    border: 2px solid var(--primary-teal);
    border-radius: 12px;
    padding: 2rem;
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    box-shadow: 0 4px 20px rgba(31, 122, 122, 0.1);
}

.callout-icon {
    background: var(--primary-teal);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.callout-content h3 {
    color: var(--primary-teal);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.callout-content p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-dark);
    margin: 0;
}

.info-tooltip {
    position: relative;
    color: var(--primary-teal);
    cursor: help;
    margin-left: 0.25rem;
}

.info-tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-teal);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Ensure conservative column stat boxes match height and layout of other columns */
.problem-card .conservative-stats .conservative-item {
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Validation Highlights */
.validation-highlights {
    margin: 3rem 0;
}

.validation-highlights h3 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 2rem;
    text-align: center;
}

.headline-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.headline-metrics .metric-card {
    background: white;
    border: 2px solid var(--primary-teal);
    border-radius: 12px;
    padding: 2rem 1.5rem;
    text-align: center;
    box-shadow: 0 4px 20px rgba(31, 122, 122, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.headline-metrics .metric-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(31, 122, 122, 0.2);
}

.metric-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-teal);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.metric-label {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-medium);
    line-height: 1.2;
}

.validation-footnote {
    text-align: center;
    padding: 1.5rem;
    background: rgba(31, 122, 122, 0.05);
    border-radius: 8px;
    border-left: 4px solid var(--primary-teal);
}

.validation-footnote p {
    font-size: 0.9rem;
    color: var(--text-medium);
    margin: 0 0 0.5rem 0;
    font-style: italic;
}

.see-methods-link {
    color: var(--primary-teal);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
}

.see-methods-link:hover {
    text-decoration: underline;
}

/* Methods Section */
.methods-section {
    margin: 3rem 0;
    padding: 2rem;
    background: rgba(31, 122, 122, 0.05);
    border-radius: 12px;
    border-left: 4px solid var(--primary-teal);
}

.methods-section h3 {
    color: var(--primary-teal);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.methods-content p {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.methods-content p:last-child {
    margin-bottom: 0;
}

/* Mobile Navigation Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 1rem;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
        gap: 1rem;
    }
    
    .nav-links.mobile-open {
        display: flex;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .headline-metrics {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .callout-card {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .metric-number {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .headline-metrics {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .nav-container {
        padding: 0 1rem;
    }
    
    .callout-card {
        padding: 1.5rem;
    }
}


/* Small-screen overflow and dropdown safety overrides
   - Ensure dropdowns don't use negative left offsets which can cause horizontal overflow
   - Constrain min/max widths so elements fit inside the viewport
   - As a last-resort guard, hide any accidental horizontal overflow on very small screens
*/
@media (max-width: 480px) {
    html, body {
        /* Prevent accidental horizontal scrolling caused by positioned children */
        overflow-x: hidden;
    }

    .dropdown-menu {
        /* occupy the available screen space with small side margins instead of negative offsets */
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        margin: 0 0.5rem !important;
        min-width: 0 !important;
        max-width: calc(100% - 1rem) !important;
        box-sizing: border-box !important;
    }

    /* Defensive override for any element that may set a large min-width on small screens */
    [style*="min-width"] {
        min-width: 0 !important;
        max-width: 100% !important;
    }

    /* Ensure any fixed paddings on large containers don't push content off-screen */
    .nav-container, .section-container, .page-hero, .main-footer, .footer-container {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
}

