/* 
 * MedCensus Style Sheets
 * Premium glassmorphic design system using CSS Variables
 */

:root {
    --bg-color: hsl(222, 24%, 7%);
    --card-bg: hsla(222, 20%, 12%, 0.7);
    --card-border: hsla(222, 20%, 25%, 0.4);
    --card-border-active: hsla(230, 80%, 65%, 0.5);
    
    --text-primary: hsl(210, 40%, 96%);
    --text-secondary: hsl(215, 20%, 65%);
    --text-muted: hsl(215, 12%, 45%);
    
    --primary: hsl(230, 80%, 63%);
    --primary-glow: hsla(230, 80%, 63%, 0.35);
    
    /* Workload Status Colors */
    --status-green: hsl(150, 75%, 45%);
    --status-green-glow: hsla(150, 75%, 45%, 0.2);
    --status-orange: hsl(38, 92%, 50%);
    --status-orange-glow: hsla(38, 92%, 50%, 0.25);
    --status-red: hsl(5, 85%, 58%);
    --status-red-glow: hsla(5, 85%, 58%, 0.25);
    --status-gold: hsl(45, 95%, 50%);
    --status-gold-glow: hsla(45, 95%, 50%, 0.3);
    
    /* Alert cards background */
    --alert-bg-green: hsla(150, 60%, 15%, 0.4);
    --alert-border-green: hsla(150, 75%, 45%, 0.3);
    --alert-bg-orange: hsla(38, 60%, 15%, 0.4);
    --alert-border-orange: hsla(38, 92%, 50%, 0.3);
    
    --font-heading: 'Outfit', 'Plus Jakarta Sans', -apple-system, sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, sans-serif;
    
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --border-radius-lg: 16px;
    --border-radius-md: 12px;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* Background Glowing Orbs */
.glow-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.22;
}

.orb-1 {
    top: -10%;
    right: 15%;
    width: 45vw;
    height: 45vw;
    background: radial-gradient(circle, var(--primary) 0%, transparent 80%);
    animation: pulse-slow 12s infinite alternate;
}

.orb-2 {
    bottom: 5%;
    left: -5%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, hsl(180, 70%, 50%) 0%, transparent 80%);
    animation: pulse-slow 18s infinite alternate-reverse;
}

@keyframes pulse-slow {
    0% { transform: scale(1) translate(0, 0); opacity: 0.18; }
    50% { transform: scale(1.1) translate(2%, 3%); opacity: 0.25; }
    100% { transform: scale(0.9) translate(-2%, -3%); opacity: 0.18; }
}

/* Layout Utilities */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-lg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 24px;
    transition: var(--transition-smooth);
}

.card:hover {
    border-color: hsla(222, 20%, 35%, 0.6);
    box-shadow: 0 10px 30px -15px rgba(0,0,0,0.5);
}

/* Header Styles */
.main-header {
    border-bottom: 1px solid var(--card-border);
    backdrop-filter: blur(8px);
    background: hsla(222, 24%, 7%, 0.7);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    color: var(--primary);
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

.logo-title {
    display: block;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff 30%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-subtitle {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: hsla(222, 20%, 15%, 0.6);
    border: 1px solid var(--card-border);
    padding: 6px 12px;
    border-radius: 50px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.green {
    background-color: var(--status-green);
    box-shadow: 0 0 8px var(--status-green);
}

.status-dot.orange {
    background-color: var(--status-orange);
    box-shadow: 0 0 8px var(--status-orange);
}

.status-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Dashboard Layout */
.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 24px;
    flex-grow: 1;
    width: 100%;
}

.title-section {
    margin-bottom: 32px;
}

.title-section h1 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 2.25rem;
    letter-spacing: -1px;
    margin-bottom: 8px;
}

.section-desc {
    color: var(--text-secondary);
    font-size: 1rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 450px 1fr;
    gap: 28px;
    align-items: start;
}

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Config Panel Inputs */
.config-panel {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.card-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.25rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 12px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.control-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.control-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.census-badge-container {
    position: relative;
    display: flex;
    align-items: center;
}

.number-input {
    background: hsla(222, 20%, 6%, 0.6);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-md);
    color: #fff;
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    padding: 8px 64px 8px 16px;
    width: 140px;
    text-align: right;
    transition: var(--transition-smooth);
}

.number-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

.unit-label {
    position: absolute;
    right: 14px;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    pointer-events: none;
}

.slider-container {
    padding: 8px 0;
}

.range-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 5px;
    background: var(--card-border);
    outline: none;
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 0 10px var(--primary-glow);
    transition: transform 0.1s;
}

.range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.range-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 0 10px var(--primary-glow);
    transition: transform 0.1s;
}

.range-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
}

.range-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.preset-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 4px;
}

.preset-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.preset-btn {
    background: hsla(222, 20%, 15%, 0.5);
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.preset-btn:hover {
    background: var(--primary-glow);
    color: #fff;
    border-color: var(--primary);
}

/* Provider Selector Grid */
.provider-selector-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
}

.prov-select-btn {
    background: hsla(222, 20%, 15%, 0.5);
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    padding: 10px 0;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.prov-select-btn:hover {
    background: hsla(222, 20%, 25%, 0.8);
    color: #fff;
}

.prov-select-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.selection-display {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Strategy Toggle Container */
.strategy-toggle-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.strategy-btn {
    background: hsla(222, 20%, 15%, 0.5);
    border: 1px solid var(--card-border);
    padding: 10px 8px;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    transition: var(--transition-smooth);
}

.strategy-btn:hover {
    background: hsla(222, 20%, 25%, 0.8);
}

.strategy-btn.active {
    background: var(--card-bg);
    border-color: var(--primary);
    box-shadow: inset 0 0 10px rgba(99, 102, 241, 0.1), 0 4px 12px rgba(0, 0, 0, 0.2);
}

.strategy-btn .btn-title {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.strategy-btn.active .btn-title {
    color: #fff;
}

.strategy-btn .btn-desc {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-align: center;
}

/* Alert status block */
.mode-status-alert {
    display: flex;
    gap: 16px;
    padding: 16px;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--card-border);
    background: hsla(222, 20%, 10%, 0.5);
}

.mode-status-alert.alert-normal {
    background: var(--alert-bg-green);
    border-color: var(--alert-border-green);
}

.mode-status-alert.alert-inadequate {
    background: var(--alert-bg-orange);
    border-color: var(--alert-border-orange);
}

.alert-icon-container {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
}

.alert-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.alert-title {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.alert-normal .alert-title {
    color: var(--status-green);
}

.alert-inadequate .alert-title {
    color: var(--status-orange);
}

.alert-text {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Results panel styles */
.results-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.results-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
}

.source-badge {
    background: hsla(230, 80%, 65%, 0.1);
    border: 1px solid var(--card-border-active);
    color: hsl(230, 85%, 75%);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 50px;
}

/* Providers Cards Grid */
.providers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

/* Individual Provider Card */
.provider-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.provider-card.active {
    box-shadow: 0 4px 20px -10px rgba(0,0,0,0.5);
}

.provider-card.inactive {
    opacity: 0.35;
    border-style: dashed;
    border-color: var(--card-border);
}

/* Glowing border highlights for active cards based on workload */
.provider-card.active.load-normal {
    border-color: hsla(150, 75%, 45%, 0.3);
}

.provider-card.active.load-warning {
    border-color: hsla(38, 92%, 50%, 0.4);
}

.provider-card.active.load-extra-pay {
    border-color: hsla(45, 95%, 50%, 0.6);
    box-shadow: 0 8px 25px -10px var(--status-gold-glow), inset 0 0 12px rgba(245, 158, 11, 0.05);
}

/* Background gradient for extra pay card */
.provider-card.load-extra-pay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--status-orange), var(--status-gold));
}

.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.provider-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}

.provider-card.inactive .provider-name {
    color: var(--text-muted);
}

/* Load Badges */
.load-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 4px;
}

.provider-card.inactive .load-badge {
    background: hsla(222, 20%, 15%, 0.5);
    color: var(--text-muted);
}

.load-normal .load-badge {
    background: var(--status-green-glow);
    color: hsl(150, 80%, 75%);
}

.load-warning .load-badge {
    background: var(--status-orange-glow);
    color: hsl(38, 95%, 70%);
}

.load-extra-pay .load-badge {
    background: var(--status-gold-glow);
    color: hsl(45, 100%, 70%);
    border: 1px solid rgba(245, 158, 11, 0.3);
    animation: gold-shimmer 2s infinite alternate;
}

@keyframes gold-shimmer {
    0% { box-shadow: 0 0 5px rgba(245, 158, 11, 0.2); }
    100% { box-shadow: 0 0 12px rgba(245, 158, 11, 0.5); }
}

/* Patient Value Display */
.patients-count-container {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin: 8px 0 16px 0;
}

.patients-count {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 2.75rem;
    line-height: 1;
    letter-spacing: -1px;
}

.provider-card.inactive .patients-count {
    color: var(--text-muted);
}

.patients-unit {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Progress bar inside card */
.card-progress-bar {
    width: 100%;
    height: 6px;
    background: var(--card-border);
    border-radius: 10px;
    overflow: hidden;
    margin-top: auto;
}

.card-progress-fill {
    height: 100%;
    width: 0%;
    border-radius: 10px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.provider-card.inactive .card-progress-fill {
    width: 0% !important;
}

.load-normal .card-progress-fill {
    background: var(--status-green);
    box-shadow: 0 0 8px var(--status-green-glow);
}

.load-warning .card-progress-fill {
    background: var(--status-orange);
    box-shadow: 0 0 8px var(--status-orange-glow);
}

.load-extra-pay .card-progress-fill {
    background: linear-gradient(to right, var(--status-orange), var(--status-gold));
    box-shadow: 0 0 10px var(--status-gold-glow);
}

/* Summary analytics block */
.summary-card {
    margin-top: 8px;
}

.summary-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

@media (max-width: 600px) {
    .metrics-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.metric-item {
    display: flex;
    flex-direction: column;
    background: hsla(222, 20%, 6%, 0.3);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-md);
    padding: 14px;
    align-items: center;
    text-align: center;
}

.metric-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.metric-value {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 4px;
}

.metric-value.highlight-gold {
    color: var(--status-gold);
    text-shadow: 0 0 8px rgba(245, 158, 11, 0.2);
}

.metric-sub {
    font-size: 0.68rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.metric-sub.mismatch-alert {
    color: var(--status-red);
    font-weight: 700;
}

.metric-sub.success-check {
    color: var(--status-green);
    font-weight: 600;
}

/* Footer styles */
.main-footer {
    border-top: 1px solid var(--card-border);
    padding: 24px;
    text-align: center;
    margin-top: 40px;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
}

.code-filepath {
    background: hsla(222, 20%, 15%, 0.8);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--text-secondary);
    font-family: monospace;
}
