:root {
    color-scheme: light;
    --surface: #ffffff;
    --surface-muted: #E8EAED;
    --surface-card: #f7f9fc;
    --border-color: rgba(11, 31, 60, 0.12);
    --shadow-soft: 0 16px 32px -28px rgba(11, 31, 60, 0.25);
    --text-primary: #0b1f3c;
    --text-secondary: #40526d;
    --text-subtle: #6b7a92;
    --accent: #1952ad;
    --accent-strong: #134183;
    --footer-bg: #343A40;
    --footer-text: #ADB5BD;
}

body {
    min-height: 100vh;
    background: var(--surface-muted);
    color: var(--text-primary);
    line-height: 1.65;
    font-family: 'Ubuntu', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
    color: var(--text-primary);
    letter-spacing: -0.01em;
    font-weight: 700;
}

p {
    color: var(--text-secondary);
    font-weight: 400;
}

.section-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    box-shadow: 0 8px 32px 0 rgba(11, 31, 60, 0.15), 
                0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

.section-card[data-tone="muted"] {
    background: rgba(247, 249, 252, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.subheading-tag {
    display: inline-flex;
    align-items: center;
    border-radius: 9999px;
    background: rgba(25, 82, 173, 0.12);
    color: var(--accent);
    padding: 0.4rem 0.9rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.32em;
}

.metric-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 1.75rem 1.5rem;
    box-shadow: var(--shadow-soft);
}

.metric-card p {
    margin: 0.15rem 0 0;
}

.feature-card {
    background: var(--surface-card);
    border: 1px solid rgba(11, 31, 60, 0.1);
    border-radius: 18px;
    padding: 1.75rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
    border-color: rgba(25, 82, 173, 0.4);
    box-shadow: 0 16px 28px -24px rgba(25, 82, 173, 0.35);
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border-radius: 9999px;
    border: 1px solid transparent;
    background: var(--accent);
    color: #ffffff;
    padding: 0.75rem 1.8rem;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 18px 32px -22px rgba(25, 82, 173, 0.45);
}

.btn-primary:hover {
    background: var(--accent-strong);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    border-radius: 9999px;
    border: 1px solid rgba(25, 82, 173, 0.4);
    background: transparent;
    color: var(--accent);
    padding: 0.75rem 1.8rem;
    font-size: 0.88rem;
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease;
}

.btn-secondary:hover {
    background: rgba(25, 82, 173, 0.1);
}

.tab-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.65rem 1.25rem;
    border-radius: 9999px;
    border: 1px solid rgba(11, 31, 60, 0.18);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--surface);
    transition: all 0.2s ease;
}

.tab-pill:hover {
    border-color: rgba(25, 82, 173, 0.45);
    color: var(--accent);
}

.tab-pill.is-active {
    border-color: transparent;
    background: var(--accent);
    color: #ffffff;
    box-shadow: 0 12px 24px -18px rgba(25, 82, 173, 0.6);
}

.table-matrix table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table-matrix thead tr {
    background: rgba(11, 31, 60, 0.05);
}

.table-matrix thead th {
    padding: 0.75rem 1.1rem;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--text-subtle);
}

.table-matrix tbody tr {
    border-bottom: 1px solid rgba(11, 31, 60, 0.08);
    transition: background 0.18s ease;
}

.table-matrix tbody tr:hover {
    background: rgba(25, 82, 173, 0.08);
}

.table-matrix tbody tr.details-row {
    background: #f3f4f6 !important;
}

.table-matrix tbody tr.details-row:hover {
    background: #f3f4f6 !important;
}

.table-matrix td {
    padding: 0.95rem 1.1rem;
    font-size: 0.92rem;
    color: var(--text-primary);
}

.badge-soft {
    display: inline-flex;
    align-items: center;
    border-radius: 9999px;
    background: rgba(25, 82, 173, 0.12);
    color: var(--accent);
    padding: 0.35rem 0.9rem;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3em;
}

.badge-soft--neutral {
    background: rgba(148, 163, 184, 0.2);
    color: var(--text-secondary);
}

.badge-soft--critical {
    background: rgba(255, 143, 63, 0.22);
    color: #bb4f12;
}

pre,
code {
    font-family: "JetBrains Mono", "Fira Code", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
    color: var(--text-primary);
}

pre {
    background: rgba(11, 31, 60, 0.06);
    border-radius: 12px;
    border: 1px solid rgba(11, 31, 60, 0.1);
    padding: 1rem;
    overflow-x: auto;
    font-size: 0.8rem;
    line-height: 1.6;
}

code {
    background: rgba(11, 31, 60, 0.06);
    padding: 0.2rem 0.5rem;
    border-radius: 8px;
    border: 1px solid rgba(11, 31, 60, 0.1);
    font-size: 0.75rem;
}

/* ============================================
   FORM DESIGN SYSTEM
   ============================================ */

/* Form Containers */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.form-row {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: 1fr;
}

.form-row.cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.form-row.cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 768px) {
    .form-row.cols-2,
    .form-row.cols-3 {
        grid-template-columns: 1fr;
    }
}

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

.form-label-required::after {
    content: " *";
    color: #ef4444;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-subtle);
    margin-top: 0.25rem;
}

/* Input Base Styles */
.form-input,
.form-select,
.form-textarea,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="url"],
select,
textarea {
    width: 100%;
    border-radius: 0.5rem;
    border: 1px solid rgba(11, 31, 60, 0.16);
    background: #ffffff;
    color: var(--text-primary);
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    line-height: 1.5;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(25, 82, 173, 0.6);
    box-shadow: 0 0 0 3px rgba(25, 82, 173, 0.1);
    background: #ffffff;
}

.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled,
input:disabled,
select:disabled,
textarea:disabled {
    background: rgba(11, 31, 60, 0.04);
    color: var(--text-subtle);
    cursor: not-allowed;
    opacity: 0.6;
}

.form-input::placeholder,
.form-textarea::placeholder,
input::placeholder,
textarea::placeholder {
    color: var(--text-subtle);
    opacity: 0.6;
}

/* Input Sizes */
.form-input-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
}

.form-input-lg {
    padding: 0.75rem 1rem;
    font-size: 1rem;
}

/* Input States */
.form-input-error,
.form-input.error {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.form-input-error:focus,
.form-input.error:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-input-success,
.form-input.success {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.05);
}

.form-error-message {
    font-size: 0.8rem;
    color: #ef4444;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Textarea */
.form-textarea,
textarea {
    min-height: 6rem;
    resize: vertical;
}

/* Select */
.form-select,
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='%236b7a92' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 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;
}

/* Checkboxes and Radio */
input[type="checkbox"],
input[type="radio"] {
    width: 1.125rem;
    height: 1.125rem;
    border-radius: 0.25rem;
    border: 1px solid rgba(11, 31, 60, 0.3);
    background: #ffffff;
    cursor: pointer;
    margin: 0;
}

input[type="radio"] {
    border-radius: 50%;
}

input[type="checkbox"]:checked,
input[type="radio"]:checked {
    background-color: var(--accent);
    border-color: var(--accent);
}

input[type="checkbox"]:focus,
input[type="radio"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(25, 82, 173, 0.1);
}

/* ============================================
   BUTTON DESIGN SYSTEM
   ============================================ */

/* Button Base */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.5;
    border-radius: 0.5rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Button Variants */
.btn-primary {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-strong);
    border-color: var(--accent-strong);
    box-shadow: 0 4px 6px -1px rgba(25, 82, 173, 0.2);
}

.btn-secondary {
    background: #ffffff;
    color: var(--text-primary);
    border-color: rgba(11, 31, 60, 0.16);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--surface-card);
    border-color: rgba(11, 31, 60, 0.24);
}

.btn-outline {
    background: transparent;
    color: var(--accent);
    border-color: var(--accent);
}

.btn-outline:hover:not(:disabled) {
    background: rgba(25, 82, 173, 0.08);
}

.btn-ghost {
    background: transparent;
    color: var(--text-primary);
    border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
    background: rgba(11, 31, 60, 0.06);
}

/* Button Colors */
.btn-success {
    background: #10b981;
    color: #ffffff;
    border-color: #10b981;
}

.btn-success:hover:not(:disabled) {
    background: #059669;
    border-color: #059669;
}

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

.btn-warning:hover:not(:disabled) {
    background: #d97706;
    border-color: #d97706;
}

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

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
    border-color: #dc2626;
}

/* Button Sizes */
.btn-sm {
    padding: 0.375rem 0.875rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.btn-icon {
    padding: 0.5rem;
    width: 2rem;
    height: 2rem;
}

.btn-icon-sm {
    padding: 0.375rem;
    width: 1.75rem;
    height: 1.75rem;
}

.btn-icon-lg {
    padding: 0.625rem;
    width: 2.5rem;
    height: 2.5rem;
}

/* Button Groups */
.btn-group {
    display: inline-flex;
    gap: 0.5rem;
}

.btn-group-attached {
    display: inline-flex;
    gap: 0;
}

.btn-group-attached .btn {
    border-radius: 0;
}

.btn-group-attached .btn:first-child {
    border-top-left-radius: 0.5rem;
    border-bottom-left-radius: 0.5rem;
}

.btn-group-attached .btn:last-child {
    border-top-right-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}

.btn-group-attached .btn:not(:last-child) {
    border-right: none;
}

/* ============================================
   CARD DESIGN SYSTEM
   ============================================ */

.card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.card-header {
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.card-body {
    padding: 0;
}

.card-footer {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Glass Card (existing) */
.glass-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    padding: 2rem;
    box-shadow: var(--shadow-soft);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-error {
    color: #ef4444;
}

.text-success {
    color: #10b981;
}

.text-warning {
    color: #f59e0b;
}

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

.bg-error {
    background-color: rgba(239, 68, 68, 0.1);
}

.bg-success {
    background-color: rgba(16, 185, 129, 0.1);
}

.bg-warning {
    background-color: rgba(245, 158, 11, 0.1);
}

@media (max-width: 768px) {
    .section-card,
    .metric-card,
    .feature-card {
        padding: 1.8rem;
        border-radius: 16px;
    }
    
    .btn {
        width: 100%;
    }
    
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
}

/* ============================================
   INTERACTIVE EUROPE MAP
   ============================================ */

#europe-map-container {
    min-height: 400px;
    position: relative;
}

#europe-svg-wrapper svg {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Map tooltip */
#map-tooltip {
    z-index: 1000;
    pointer-events: none;
    white-space: nowrap;
    animation: tooltipFadeIn 0.2s ease;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Provider country animations */
.provider-country {
    /* Color transitions handled by inline styles for dynamic colors */
    transition: fill 2s ease, stroke 2s ease, fill-opacity 0.3s ease;
}

@keyframes providerPulse {
    0%, 100% {
        filter: drop-shadow(0 0 2px rgba(16, 185, 129, 0.4));
    }
    50% {
        filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.8));
    }
}

/* Smooth color transitions for health status changes */
.provider-country path,
.provider-country polygon {
    transition: fill 2s ease-in-out, stroke 2s ease-in-out;
}

/* AI processing indicator */
@keyframes aiProcessing {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
    100% {
        opacity: 0;
        transform: scale(1.5);
    }
}

/* Data flow particles */
.data-particle {
    animation: particleFlow 3s linear infinite;
}

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

/* Responsive map */
@media (max-width: 768px) {
    #europe-map-container {
        min-height: 300px;
    }
}

/* ============================================
   DEBUG MODE ANIMATIONS
   ============================================ */

@keyframes amberGlow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}
