/* Monochrome Intelligence Design System */

:root {
    --bg-main: #131313;
    --bg-navbar: rgba(19, 19, 19, 0.85);
    --bg-card: #1c1b1b;
    --bg-card-inner: #0e0e0e;
    --border-color: #2a2a2a;
    --border-hover: #444748;
    
    --text-primary: #e5e2e1;
    --text-secondary: #c4c7c8;
    --text-muted: #8e9192;
    
    --primary-color: #ffffff;
    --on-primary: #131313;
    
    --success-color: #34d399;
    --warning-color: #fbbf24;
    --danger-color: #f87171;

    --font-geist: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

/* Light Theme (E-Ink Mode) */
body.light-theme {
    --bg-main: #f5f5f5;
    --bg-navbar: rgba(245, 245, 245, 0.88);
    --bg-card: #ffffff;
    --bg-card-inner: #fafafa;
    --border-color: #e5e5e5;
    --border-hover: #d4d4d4;
    
    --text-primary: #121212;
    --text-secondary: #474747;
    --text-muted: #656565;
    
    --primary-color: #000000;
    --on-primary: #ffffff;

    --success-color: #059669;
    --warning-color: #d97706;
    --danger-color: #dc2626;
}

body.light-theme,
body.light-theme.bg-grid-pattern {
    background-image: linear-gradient(to right, rgba(0, 0, 0, 0.05) 1px, transparent 1px),
                      linear-gradient(to bottom, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
    background-size: 24px 24px;
}

body.light-theme .brand h2,
body.light-theme .main-title,
body.light-theme .health-overview-header h2,
body.light-theme .report-section h3,
body.light-theme .news-title,
body.light-theme .status-card-count,
body.light-theme .metric-value,
body.light-theme .news-url-link,
body.light-theme .slider-badge {
    color: #121212;
}

body.light-theme .action-btn,
body.light-theme .search-submit-btn {
    background: #000000;
    color: #ffffff;
    border-color: #000000;
}

body.light-theme .action-btn:hover,
body.light-theme .search-submit-btn:hover {
    background: #2a2a2a;
    border-color: #2a2a2a;
}

body.light-theme .nav-btn.active {
    background-color: #e5e5e5;
    color: #121212;
    border-color: #d4d4d4;
}

body.light-theme .metric-icon-wrapper {
    background: #f5f5f5;
    color: #121212;
}

body.light-theme .search-input-wrapper:focus-within {
    border-color: #121212;
}

body.light-theme .search-input-wrapper input {
    color: #121212;
}

body.light-theme .search-input-wrapper input::placeholder {
    color: #656565;
}

body.light-theme .slider-control input[type="range"] {
    accent-color: #000000;
}

/* Reset & Global styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-geist);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Subtle grid background pattern */
.bg-grid-pattern {
    background-image: linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
                      linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 24px 24px;
}

/* Material Symbols sizing */
.material-symbols-outlined {
    font-size: 1.25rem;
    vertical-align: middle;
}

/* App Layout */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Top Navbar Styling */
.top-navbar {
    background-color: var(--bg-navbar);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    padding: 14px 24px;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand h2 {
    font-family: var(--font-geist);
    font-size: 1.35rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.01em;
}

.logo-emoji {
    font-size: 1.5rem;
}

.nav-menu {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: var(--font-geist);
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
}

.nav-btn.active {
    color: #ffffff;
    background-color: var(--bg-card);
    border-color: var(--border-hover);
    font-weight: 600;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-icon-btn {
    background: var(--bg-card-inner);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 14px;
    border-radius: 6px;
    font-family: var(--font-geist);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.nav-icon-btn:hover {
    background-color: var(--bg-card);
    border-color: var(--border-hover);
}

.floating-stats-popover {
    position: fixed;
    top: 70px;
    right: 24px;
    z-index: 200;
    width: 460px;
    max-width: calc(100vw - 32px);
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 16px 36px -6px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.floating-stats-popover.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.popover-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.popover-title {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.popover-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 4px;
}

.popover-close-btn:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.08);
}

.floating-stats-popover .platform-status-bar {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.floating-stats-popover .source-breakdown-card {
    grid-column: 1 / -1;
}

.popover-footer {
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.w-full {
    width: 100%;
}

.action-btn {
    background: #ffffff;
    color: #131313;
    border: 1px solid #ffffff;
    border-radius: 6px;
    padding: 8px 16px;
    font-weight: 600;
    font-size: 0.88rem;
    font-family: var(--font-geist);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: #e5e2e1;
    border-color: #e5e2e1;
    transform: translateY(-1px);
}

.action-btn:active {
    transform: translateY(0);
}

/* Platform Status Bar Cards */
.platform-status-bar {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(150px, 1fr) minmax(260px, 2fr);
    gap: 16px;
    margin-bottom: 30px;
}

.status-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: border-color 0.2s ease;
}

.status-card:hover {
    border-color: var(--border-hover);
}

.status-card-label {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.status-card-value {
    font-family: var(--font-geist);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-all;
}

.status-card-count {
    font-size: 2rem;
    font-weight: 700;
    font-family: var(--font-geist);
    color: #ffffff;
    line-height: 1.1;
    letter-spacing: -0.01em;
}

.source-breakdown-card {
    justify-content: flex-start;
}

.source-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.source-list li {
    background: var(--bg-card-inner);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 3px 10px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.source-list li span:first-child {
    color: var(--text-muted);
}

.source-list li span:last-child {
    font-weight: 600;
    color: var(--text-primary);
}

/* Main Content Area */
.main-content {
    flex: 1 0 auto;
    padding: 40px 50px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* App Footer */
.app-footer {
    border-top: 1px solid var(--border-color);
    padding: 24px 32px;
    background-color: var(--bg-card-inner);
    margin-top: auto;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-brand-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.footer-title {
    font-family: var(--font-geist);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.footer-meta {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-muted);
}

.footer-links-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.footer-link-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.footer-link-item:hover {
    color: #ffffff;
    border-color: var(--border-hover);
    background-color: var(--bg-main);
    transform: translateY(-1px);
}

.footer-link-item .icon-footer {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.app-header {
    margin-bottom: 30px;
}

.main-title {
    font-family: var(--font-geist);
    font-size: 2.2rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 800px;
}

/* Social Nav Buttons & Header Badges */
.social-nav-btn {
    padding: 8px;
    border-radius: 6px;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s ease;
}

.social-nav-btn:hover {
    color: #ffffff;
    background-color: var(--bg-card);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.social-svg {
    display: inline-block;
    vertical-align: middle;
}

.social-emoji-sm, .badge-emoji {
    font-size: 0.95rem;
    line-height: 1;
}

.header-social-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
}

.header-badge-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.header-badge-btn:hover {
    background: var(--bg-card-inner);
    border-color: var(--border-hover);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.header-badge-btn .icon-badge {
    font-size: 1rem;
    color: var(--text-muted);
}

/* Light Mode Overrides for Social Elements */
body.light-theme .social-nav-btn:hover {
    color: #000000;
    background-color: #e5e5e5;
}

body.light-theme .header-badge-btn {
    background: #ffffff;
    border-color: #e5e5e5;
    color: #121212;
}

body.light-theme .header-badge-btn:hover {
    background: #f0f0f0;
    border-color: #d4d4d4;
    color: #000000;
}

body.light-theme .footer-link-item {
    background: #ffffff;
    border-color: #e5e5e5;
    color: #474747;
}

body.light-theme .footer-link-item:hover {
    background: #f0f0f0;
    border-color: #d4d4d4;
    color: #000000;
}

/* Tabs */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.25s ease-in-out;
}

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

/* Tab 1: Search Panel styling */
.suggestions-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

.suggestion-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.suggestion-title {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip-btn {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 14px;
    border-radius: 4px;
    font-family: var(--font-geist);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chip-btn:hover {
    background-color: #2a2a2a;
    border-color: var(--border-hover);
    color: #ffffff;
    transform: translateY(-1px);
}

.chip-icon {
    font-size: 1rem;
    color: var(--text-muted);
}

.search-controls-container {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 30px;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: var(--bg-card-inner);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 4px 16px;
    margin-bottom: 20px;
    transition: border-color 0.2s ease;
}

.search-input-wrapper:focus-within {
    border-color: #ffffff;
}

.search-input-icon {
    color: var(--text-muted);
    font-size: 1.3rem;
}

.search-input-wrapper input {
    flex-grow: 1;
    background: transparent;
    border: none;
    color: #ffffff;
    padding: 10px 0;
    font-family: var(--font-geist);
    font-size: 0.98rem;
}

.search-input-wrapper input:focus {
    outline: none;
}

.search-submit-btn {
    background: #ffffff;
    color: #131313;
    border: none;
    border-radius: 4px;
    padding: 8px 20px;
    font-family: var(--font-geist);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.search-submit-btn:hover {
    background-color: #e5e2e1;
}

.sliders-row {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.slider-control {
    flex: 1;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    height: 22px;
}

.sort-header-icon {
    font-size: 1.1rem;
    color: var(--text-muted);
}

.slider-badge {
    background-color: var(--bg-card-inner);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 2px 8px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: #ffffff;
}

.slider-control input[type="range"] {
    width: 100%;
    accent-color: #ffffff;
    cursor: pointer;
    margin-top: 4px;
    height: 36px;
}

.sort-select-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.sort-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 100%;
    height: 36px;
    background-color: var(--bg-card-inner);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 6px;
    padding: 0 34px 0 12px;
    font-family: var(--font-geist);
    font-size: 0.88rem;
    font-weight: 500;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.sort-select:hover {
    border-color: var(--border-hover);
}

.sort-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

.select-chevron {
    position: absolute;
    right: 10px;
    pointer-events: none;
    color: var(--text-muted);
    font-size: 1.15rem;
    transition: transform 0.2s ease, color 0.2s ease;
}

.sort-select-wrapper:hover .select-chevron {
    color: var(--text-primary);
}

.sort-select:focus + .select-chevron {
    transform: rotate(180deg);
    color: var(--text-primary);
}

.sort-select option {
    background-color: var(--bg-card);
    color: var(--text-primary);
}

body.light-theme .sort-select {
    background-color: var(--bg-card-inner);
    border-color: var(--border-color);
    color: var(--text-primary);
}

body.light-theme .sort-select:hover {
    border-color: var(--border-hover);
    background-color: #f5f5f5;
}

body.light-theme .sort-select:focus {
    border-color: #000000;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.08);
}

body.light-theme .sort-select option {
    background-color: #ffffff;
    color: #121212;
}

.results-status {
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.results-status .match-count {
    font-weight: 600;
    color: var(--success-color);
    font-family: var(--font-mono);
}

.results-status .warning-box {
    background-color: rgba(251, 191, 36, 0.08);
    border-left: 3px solid var(--warning-color);
    color: var(--warning-color);
    padding: 12px 16px;
    border-radius: 4px;
    line-height: 1.6;
    font-size: 0.9rem;
}

/* Article Cards */
.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.news-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 22px;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.news-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
}

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

.news-source {
    background: var(--bg-card-inner);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 3px 10px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.news-date {
    font-family: var(--font-mono);
    color: var(--text-muted);
    font-size: 0.78rem;
}

.news-title {
    font-family: var(--font-geist);
    font-size: 1.25rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 10px;
    line-height: 1.4;
}

.summary-box {
    background-color: var(--bg-card-inner);
    border-left: 3px solid var(--border-hover);
    padding: 12px 16px;
    border-radius: 4px;
    margin: 14px 0;
    color: var(--text-primary);
}

.summary-box strong {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    display: block;
    margin-bottom: 6px;
}

.summary-text {
    font-size: 0.92rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.news-url-link {
    font-size: 0.85rem;
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-bottom: 1px dashed var(--border-hover);
}

.news-url-link:hover {
    border-bottom-style: solid;
}

/* Accordion details / summary */
details {
    margin-top: 10px;
    background-color: var(--bg-card-inner);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}

details[open] {
    border-color: var(--border-hover);
}

summary {
    list-style: none;
    padding: 10px 16px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: background-color 0.2s ease;
}

summary:hover {
    background-color: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

summary::-webkit-details-marker {
    display: none;
}

summary::after {
    content: "▼";
    font-size: 0.65rem;
    transition: transform 0.2s ease;
}

details[open] summary::after {
    transform: rotate(180deg);
}

.details-content {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-secondary);
    background-color: var(--bg-card-inner);
}

.tag-category-group {
    margin-bottom: 12px;
}

.tag-category-group:last-child {
    margin-bottom: 0;
}

.tag-category-title {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.badge {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.badge-per { border-color: rgba(96, 165, 250, 0.4); color: #93c5fd; }
.badge-loc { border-color: rgba(52, 211, 153, 0.4); color: #6ee7b7; }
.badge-org { border-color: rgba(167, 139, 250, 0.4); color: #c4b5fd; }

/* Placeholder and Loading styling */
.placeholder-state {
    text-align: center;
    padding: 60px 40px;
    color: var(--text-muted);
}

.placeholder-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 15px;
    color: var(--border-hover);
}

.loader {
    position: relative;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: 4px solid var(--border-color);
    background: transparent;
    display: block;
    margin: 32px auto;
    box-sizing: border-box;
    flex-shrink: 0;
}

.loader::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 4px solid transparent;
    border-top-color: var(--primary-color);
    animation: spin 1s linear infinite;
    box-sizing: border-box;
}

.loader::after {
    content: '';
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    border: 4px solid transparent;
    border-bottom-color: var(--text-muted);
    animation: spin-reverse 1.5s linear infinite;
    box-sizing: border-box;
}

/* Loader Size Variants */
.loader-lg {
    width: 64px;
    height: 64px;
    border-width: 4px;
}
.loader-lg::before {
    inset: -4px;
    border-width: 4px;
}
.loader-lg::after {
    inset: 8px;
    border-width: 4px;
}

.loader-md {
    width: 40px;
    height: 40px;
    border-width: 3px;
    margin: 16px auto;
}
.loader-md::before {
    inset: -3px;
    border-width: 3px;
}
.loader-md::after {
    inset: 5px;
    border-width: 3px;
}

.loader-sm,
.btn-icon.loader {
    width: 16px !important;
    height: 16px !important;
    border-width: 2px !important;
    margin: 0 !important;
    display: inline-block !important;
    vertical-align: middle;
}

.loader-sm::before,
.btn-icon.loader::before {
    inset: -2px !important;
    border-width: 2px !important;
}

.loader-sm::after,
.btn-icon.loader::after {
    inset: 2px !important;
    border-width: 2px !important;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes spin-reverse {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(-360deg); }
}

/* Loading Canvas Container */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
    gap: 12px;
}

.loading-container .loading-title {
    font-family: var(--font-geist);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 4px;
}

.loading-container .loading-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    max-width: 460px;
    line-height: 1.5;
}


/* Tab 2: Health Overview */
.health-overview-header {
    margin-bottom: 30px;
}

.health-overview-header h2 {
    font-family: var(--font-geist);
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.health-overview-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 25px;
}

.metric-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: border-color 0.2s ease;
}

.metric-card:hover {
    border-color: var(--border-hover);
}

.metric-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.metric-icon-wrapper {
    padding: 6px;
    border-radius: 6px;
    background: var(--bg-card-inner);
    border: 1px solid var(--border-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
}

.metric-label {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    margin: 4px 0 8px 0;
    font-family: var(--font-geist);
    color: #ffffff;
    letter-spacing: -0.01em;
}

.metric-value.status-normal { color: var(--success-color); }
.metric-value.status-moderate,
.metric-value.status-stale,
.metric-value.status-warning { color: var(--warning-color); }
.metric-value.status-drift { color: var(--danger-color); }
.metric-value.status-insufficient { color: var(--text-muted); }

.metric-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.timestamp-info {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 25px;
}

.divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 30px 0;
}

.report-section {
    position: relative;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.report-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.report-section h3 {
    font-family: var(--font-geist);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title-icon {
    font-size: 1.35rem;
    color: var(--text-primary);
}

.report-header-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.report-action-btn {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.report-action-btn:hover {
    background-color: var(--bg-card-inner);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.report-action-btn .material-symbols-outlined {
    font-size: 1.15rem;
}

/* Native Dashboard Components */
.native-dashboard-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.02);
}

.card-subtitle {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-subtitle .material-symbols-outlined {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.drift-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    text-align: left;
}

.drift-table th {
    background-color: var(--bg-card-inner);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.drift-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

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

.drift-table tr:hover td {
    background-color: var(--bg-card-inner);
}

.table-loading-text {
    text-align: center;
    color: var(--text-muted);
    padding: 32px 16px;
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Status Badges */
.drift-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.drift-badge.badge-stable {
    background: rgba(52, 211, 153, 0.15);
    color: var(--success-color);
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.drift-badge.badge-drifted {
    background: rgba(248, 113, 113, 0.15);
    color: var(--danger-color);
    border: 1px solid rgba(248, 113, 113, 0.3);
}

/* Feature Distribution Cards Grid */
.dist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
}

.dist-card {
    background-color: var(--bg-card-inner);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
}

.dist-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.dist-card-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.dist-legend {
    display: flex;
    gap: 12px;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
}

.legend-dot.dot-ref { background-color: #60a5fa; }
.legend-dot.dot-cur { background-color: #f472b6; }

.dist-bar-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dist-bar-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dist-bar-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
}

.dist-bar-tracks {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.dist-track {
    height: 6px;
    background-color: var(--bg-card);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.dist-fill-ref {
    height: 100%;
    background-color: #60a5fa;
    border-radius: 3px;
    transition: width 0.4s ease;
}

.dist-fill-cur {
    height: 100%;
    background-color: #f472b6;
    border-radius: 3px;
    transition: width 0.4s ease;
}

body.light-theme .legend-dot.dot-ref,
body.light-theme .dist-fill-ref { background-color: #2563eb; }

body.light-theme .legend-dot.dot-cur,
body.light-theme .dist-fill-cur { background-color: #db2777; }

/* Toast Message */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-color);
    color: var(--text-primary);
    padding: 14px 22px;
    border-radius: 6px;
    font-family: var(--font-geist);
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.toast.success { border-left-color: var(--success-color); }
.toast.error { border-left-color: var(--danger-color); }

/* Responsive Media Queries */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 12px;
    }

    .platform-status-bar {
        grid-template-columns: 1fr;
    }

    .sliders-row {
        flex-direction: column;
        gap: 16px;
    }

    .main-content {
        padding: 24px 16px;
    }
}
