/* ============================================
   SYSTEM INFORMACJI MEDYCZNEJ
   Departament Cyfryzacji UM Toruń
   ============================================ */

/* ========== RESET & PODSTAWY ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Kolory główne - z logo eZdrowie */
    --primary-color: #5FA399;
    --primary-dark: #3D7A72;  /* WCAG AA: 6.1:1 - ciemniejszy dla tekstu */
    --primary-text: #2E5C55;  /* WCAG AA: 8.5:1 - bardzo ciemny dla ważnego tekstu */
    --primary-light: #7BC4B8;
    --primary-pale: #E8F5F3;

    /* Kolory pomocnicze */
    --accent-color: #D32F2F;  /* WCAG AA: 5.4:1 - ciemniejszy czerwony */
    --warning-color: #E65100;  /* WCAG AA: 5.8:1 - ciemniejszy pomarańczowy */
    --success-color: #2E7D32;  /* WCAG AA: 5.2:1 - ciemniejsza zieleń */
    --info-color: #1565C0;  /* WCAG AA: 6.3:1 - ciemniejszy niebieski */

    /* Odcienie szarości */
    --gray-50: #FAFAFA;
    --gray-100: #F5F5F5;
    --gray-200: #EEEEEE;
    --gray-300: #E0E0E0;
    --gray-400: #6B6B6B;  /* WCAG AA: 7.0:1 contrast ratio */
    --gray-500: #5F5F5F;  /* WCAG AA: 7.5:1 contrast ratio */
    --gray-600: #4A4A4A;  /* WCAG AAA: 10.0:1 contrast ratio - ciemniejszy */
    --gray-700: #3D3D3D;  /* WCAG AAA: 11.5:1 contrast ratio */
    --gray-800: #2E2E2E;  /* WCAG AAA: 13.5:1 contrast ratio */
    --gray-900: #1A1A1A;  /* WCAG AAA: 16.5:1 contrast ratio */

    /* Typografia */
    --font-primary: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-heading: 'Segoe UI Semibold', 'Segoe UI', sans-serif;

    /* Cienie */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 12px 24px rgba(0, 0, 0, 0.18);

    /* Zaokrąglenia */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 15px;
    --radius-xl: 20px;

    /* Odstępy */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;

    /* Przejścia */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

body {
    font-family: var(--font-primary);
    background:
        linear-gradient(180deg, var(--primary-color) 0px, var(--primary-color) 70px, transparent 70px),
        linear-gradient(135deg, #F5F7FA 0%, #E8F0F2 100%);
    min-height: 100vh;
    color: var(--gray-800);
    line-height: 1.6;
    padding-top: 70px; /* Odstęp na fixed navbar */
}

/* ========== NAWIGACJA ========== */
.navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    box-shadow: var(--shadow-md);
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    z-index: 1000;
}

.nav-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
    overflow: hidden; /* Zabezpieczenie przed wychodzeniem elementów poza kontener */
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 18px;
    transition: var(--transition-normal);
}

.nav-brand:hover {
    transform: translateY(-2px);
}

.nav-logo {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: var(--shadow-sm);
}

.nav-logo-img {
    height: 50px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.nav-logo-svg {
    height: 45px;
    width: 45px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
    transition: transform 0.3s ease;
}

.nav-brand:hover .nav-logo-svg {
    transform: scale(1.05);
}

.nav-menu {
    display: flex;
    gap: var(--spacing-sm);
    list-style: none;
    overflow: hidden; /* Zabezpieczenie przed ucinaniem */
    transition: gap 0.3s ease; /* Płynne przejście odstępów */
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease; /* Płynne przejście rozmiaru i paddingu */
    font-weight: 500;
    white-space: nowrap;
}

.nav-item a:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.nav-item a.active {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-sm);
}

/* ========== HAMBURGER MENU (UKRYTY NA DESKTOP) ========== */
.nav-toggle {
    display: none; /* Ukryj checkbox */
}

.nav-hamburger {
    display: none; /* Ukryj hamburger na desktop */
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.nav-hamburger span[aria-hidden="true"] {
    display: block;
    width: 28px;
    height: 3px;
    background: white;
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* ========== HEADER STRONY ========== */
.page-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: var(--spacing-2xl) var(--spacing-lg);
    text-align: center;
    box-shadow: var(--shadow-lg);
    margin-bottom: var(--spacing-xl);
}

.header-top {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: var(--spacing-md);
    opacity: 0.95;
}

.logo-container {
    margin: var(--spacing-lg) 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo {
    max-width: 400px;
    height: auto;
    filter: brightness(0) invert(1);
    transition: var(--transition-normal);
}

.logo:hover {
    transform: scale(1.05);
}

.page-header h1 {
    font-size: 32px;
    font-weight: 600;
    margin-top: var(--spacing-lg);
    line-height: 1.4;
}

.page-header p {
    font-size: 16px;
    margin-top: var(--spacing-md);
    opacity: 0.9;
}

/* ========== CONTAINER GŁÓWNY ========== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-lg);
}

.container-wide {
    max-width: 1400px;
}

/* ========== PANELE ========== */
.panel {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--spacing-xl);
    transition: var(--transition-normal);
}

.panel:hover {
    box-shadow: var(--shadow-lg);
}

.panel-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--gray-200);
}

.panel-header h2 {
    color: var(--primary-text);  /* WCAG AA: 8.5:1 contrast ratio */
    font-size: 24px;
    font-weight: 600;
}

.panel-header .icon {
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-header .icon svg {
    color: var(--primary-text);  /* WCAG AA: 8.5:1 - changed from var(--primary-color) */
    stroke: var(--primary-text);
}

/* ========== PRZYCISKI ========== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
}

.btn-secondary {
    background: white;
    color: var(--primary-text);  /* WCAG AA: 8.5:1 - changed from var(--primary-color) */
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-pale);
}

.btn-danger {
    background: var(--accent-color);
    color: white;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 16px;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* ========== KARTY ========== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
    margin: var(--spacing-lg) 0;
}

.card {
    background: white;
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
    border: 2px solid transparent;
    cursor: pointer;
}

/* Karty jako linki - dostępność z klawiatury */
a.card {
    display: block;
    text-decoration: none;
    color: inherit;
}

.card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.card-icon {
    font-size: 48px;
    margin-bottom: var(--spacing-md);
    color: var(--primary-text);  /* WCAG AA: 8.5:1 - changed from var(--primary-color) */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-normal);
}

.card-icon svg {
    color: var(--primary-text);  /* WCAG AA: 8.5:1 - changed from var(--primary-color) */
    stroke: var(--primary-text);
    transition: all var(--transition-normal);
}

.card:hover .card-icon {
    transform: scale(1.1);
}

.card:hover .card-icon svg {
    color: var(--primary-dark);
    stroke: var(--primary-dark);
}

.card-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: var(--spacing-sm);
}

.card-description {
    color: var(--gray-600);
    font-size: 14px;
    line-height: 1.6;
}

/* ========== STATYSTYKI ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
    margin: var(--spacing-xl) 0;
}

.stat-card {
    background: linear-gradient(135deg, white, var(--gray-50));
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    text-align: center;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--primary-color);
    transition: var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary-text);  /* WCAG AA: 8.5:1 - changed from var(--primary-color) */
    margin-bottom: var(--spacing-sm);
}

.stat-label {
    font-size: 14px;
    color: var(--gray-600);
    font-weight: 500;
}

/* ========== FORMULARZE ========== */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--gray-700);
    font-size: 15px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: var(--transition-normal);
    background: white;
}

.form-control:hover {
    border-color: var(--primary-light);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(95, 163, 153, 0.1);
}

select.form-control {
    cursor: pointer;
}

.form-control:disabled {
    background: var(--gray-100);
    cursor: not-allowed;
    opacity: 0.6;
}

/* ========== KAFELKI (TILES) ========== */
.tiles-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

.tile {
    background: white;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    padding-bottom: 50px; /* Poprawka: miejsce dla badge'a w prawym dolnym rogu */
    cursor: pointer;
    transition: var(--transition-normal);
    position: relative;
    min-height: 140px;
    display: flex;
    flex-direction: column;
}

.tile:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.tile.selected {
    border-color: var(--primary-color);
    background: var(--primary-pale);
    box-shadow: var(--shadow-md);
}

.tile h3 {
    color: var(--primary-text);
    font-size: 16px;
    margin-bottom: var(--spacing-md);
    font-weight: 600;
    padding-right: 60px;
}

.tile-info {
    font-size: 13px;
    color: var(--gray-600);
    margin: 5px 0;
}

.tile-info strong {
    color: var(--gray-800);
    font-weight: 600;
}

.tile-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--primary-dark);  /* WCAG AA: Changed from var(--primary-color) for better contrast with white text */
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.tile-badge-bottom-right {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: var(--accent-color);
    color: white;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 0 0 2px white, 0 4px 12px rgba(0,0,0,0.15); /* Poprawka: lepsze oddzielenie od tła */
}

/* ========== HYBRYDOWE FILTROWANIE ========== */
.top-spec-container {
    background: var(--gray-50);
    padding: var(--spacing-md);
    border-radius: var(--radius-sm);
    margin-top: var(--spacing-md);
    border: 1px solid var(--gray-300);
}

.top-spec-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: var(--spacing-md);
}

.top-spec-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.top-spec-btn {
    background: white;
    border: 2px solid var(--primary-color);
    color: var(--primary-text);  /* WCAG AA: 8.5:1 - changed from var(--primary-color) */
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-xl);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal);
    white-space: nowrap;
}

.top-spec-btn:hover {
    background: var(--primary-dark);  /* WCAG AAA: Changed from var(--primary-color) for better contrast with white text */
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.top-spec-btn.active {
    background: var(--primary-dark);  /* WCAG AAA: Changed from var(--primary-color) for better contrast with white text */
    color: white;
}

.top-spec-btn .count {
    color: var(--gray-700);  /* WCAG AAA: 11.5:1 - better than opacity for small text */
    font-size: 11px;
    margin-left: 4px;
}

.top-spec-btn:hover .count,
.top-spec-btn.active .count {
    color: white;  /* WCAG AAA: Full white text on dark background for maximum contrast */
}

/* ========== DROPDOWN SPECJALIZACJI ========== */
.spec-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: var(--radius-sm);
    margin-top: 4px;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    z-index: 1000;
    display: none;
}

.spec-dropdown.show {
    display: block;
    animation: slideDown 0.3s ease;
}

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

.spec-dropdown-header {
    padding: 12px 15px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-300);
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
    position: sticky;
    top: 0;
}

.spec-dropdown-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid var(--gray-200);
    transition: var(--transition-fast);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.spec-dropdown-item:hover {
    background: var(--primary-pale);
    padding-left: 20px;
}

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

.spec-name {
    font-size: 14px;
    color: var(--gray-800);
    flex: 1;
}

.spec-count {
    font-size: 12px;
    color: var(--gray-500);
    background: var(--gray-100);
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 10px;
}

.spec-dropdown-empty {
    padding: 30px;
    text-align: center;
    color: var(--gray-500);
    font-size: 14px;
}

/* ========== MODAL ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.4s ease;
}

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

.modal-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: var(--spacing-lg) var(--spacing-xl);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 28px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-normal);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-body {
    padding: var(--spacing-xl);
    max-height: calc(80vh - 100px);
    overflow-y: auto;
}

/* ========== STOPKA ========== */
.footer {
    background: var(--gray-800);
    color: white;
    padding: var(--spacing-xl);
    margin-top: var(--spacing-2xl);
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer h3 {
    margin-bottom: var(--spacing-md);
    color: #FFFFFF;
    font-size: 18px;
}

.footer p {
    margin: var(--spacing-sm) 0;
    line-height: 1.6;
    font-size: 14px;
    opacity: 0.9;
}

.footer-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: var(--spacing-lg) 0;
}

.footer-note {
    font-size: 13px;
    opacity: 0.8;
    font-style: italic;
}

.footer .footer-links {
    margin-top: var(--spacing-md);
}

.footer .footer-links a {
    color: rgba(255, 255, 255, 0.9);
}

.footer .footer-links a:hover {
    color: white;
}

.footer .footer-links-separator {
    color: rgba(255, 255, 255, 0.5);
}

/* ========== DEKLARACJA DOSTĘPNOŚCI ========== */
.deklaracja-content {
    line-height: 1.8;
}

.deklaracja-content h1 {
    color: var(--primary-text);
    font-size: 28px;
    margin-bottom: var(--spacing-lg);
    border-bottom: 3px solid var(--primary-dark);
    padding-bottom: var(--spacing-md);
}

.deklaracja-content h2 {
    color: var(--primary-text);
    font-size: 22px;
    margin-top: var(--spacing-xl);
    margin-bottom: var(--spacing-md);
    border-left: 4px solid var(--primary-dark);
    padding-left: var(--spacing-md);
}

.deklaracja-content h3 {
    color: var(--primary-text);
    font-size: 18px;
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
}

.deklaracja-content p,
.deklaracja-content section {
    margin-bottom: var(--spacing-md);
    color: var(--gray-800);
}

.deklaracja-content ul,
.deklaracja-content ol {
    margin: var(--spacing-md) 0;
    padding-left: var(--spacing-xl);
}

.deklaracja-content li {
    margin: var(--spacing-sm) 0;
    color: var(--gray-700);
}

.deklaracja-content a {
    color: var(--primary-text);
    text-decoration: underline;
    transition: var(--transition-normal);
}

.deklaracja-content a:hover {
    color: var(--primary-dark);
}

.deklaracja-content time {
    font-weight: 600;
    color: var(--primary-text);
}

.deklaracja-content #a11y-podmiot,
.deklaracja-content #a11y-zakres,
.deklaracja-content #a11y-kontakt {
    font-weight: 600;
}

.deklaracja-content strong {
    color: var(--gray-900);
}

.footer-logos-section {
    background: white;
    padding: var(--spacing-xl) var(--spacing-lg);
    margin: 0;
    width: 100%;
}

.footer-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-xl);
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-logo {
    height: 80px;
    width: auto;
    object-fit: contain;
}

.footer-funding-text {
    max-width: 1000px;
    margin: var(--spacing-lg) auto 0;
    text-align: center;
    font-size: 14px;
    line-height: 1.6;
    color: var(--gray-700);
    padding: 0 var(--spacing-lg);
}

.footer-contact-info {
    max-width: 1000px;
    margin: var(--spacing-xl) auto 0;
    text-align: center;
    padding: 0 var(--spacing-lg);
}

.footer-contact-info h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-text);
    margin-bottom: var(--spacing-md);
}

.footer-contact-info p {
    font-size: 14px;
    line-height: 1.8;
    color: var(--gray-700);
    margin: var(--spacing-xs) 0;
}

.footer-links {
    max-width: 1000px;
    margin: var(--spacing-lg) auto 0;
    text-align: center;
    padding: var(--spacing-md) var(--spacing-lg);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--primary-dark);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition-normal);
}

.footer-links a:hover {
    color: var(--primary-text);
    text-decoration: underline;
}

.footer .footer-links .link-button {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.footer .footer-links .link-button:hover {
    color: white;
    text-decoration: underline;
}

.footer-links-separator {
    color: var(--gray-400);
    font-size: 14px;
}

/* ========== RESPONSYWNOŚĆ ========== */

/* Progresywne zmniejszanie menu - stopniowe dostosowanie */

/* Poziom 1: Duże laptopy (1400px - 1300px) */
@media (max-width: 1400px) and (min-width: 1301px) {
    .nav-menu {
        gap: 10px;
    }

    .nav-item a {
        padding: var(--spacing-sm) 14px;
        font-size: 15px;
    }
}

/* Poziom 2: Średnie laptopy (1300px - 1200px) */
@media (max-width: 1300px) and (min-width: 1201px) {
    .nav-menu {
        gap: 8px;
    }

    .nav-item a {
        padding: var(--spacing-sm) 12px;
        font-size: 14px;
    }
}

/* Poziom 3: Małe laptopy (1200px - 1101px) */
@media (max-width: 1200px) and (min-width: 1101px) {
    .nav-menu {
        gap: 6px;
    }

    .nav-item a {
        padding: 10px 10px;
        font-size: 13px;
    }
}

/* Hamburger menu dla ekranów tablet i mniejszych */
@media (max-width: 1100px) {
    /* ===== HAMBURGER MENU - TABLET & MOBILE ===== */

    /* Pokaż hamburger */
    .nav-hamburger {
        display: flex;
    }

    /* Ukryj menu domyślnie */
    .nav-menu {
        position: absolute;
        top: 65px;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
        flex-direction: column;
        gap: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease;
        box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    }

    /* Gdy checkbox zaznaczony - pokaż menu */
    .nav-toggle:checked ~ .nav-menu {
        max-height: 500px;
        padding: var(--spacing-md) 0;
    }

    .nav-item {
        width: 100%;
    }

    .nav-item a {
        padding: var(--spacing-md);
        border-radius: 0;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

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

    /* Animacja hamburgera -> X */
    .nav-toggle:checked ~ .nav-hamburger span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }

    .nav-toggle:checked ~ .nav-hamburger span:nth-child(2) {
        opacity: 0;
        transform: scale(0);
    }

    .nav-toggle:checked ~ .nav-hamburger span:nth-child(3) {
        transform: rotate(-45deg) translate(8px, -8px);
    }

    /* Dostosuj brand na tablet/mobile */
    .nav-brand span {
        font-size: 16px;
    }

    .nav-brand svg {
        width: 35px;
        height: 35px;
    }
}

/* Dodatkowa responsywność dla małych mobile */
@media (max-width: 768px) {
    /* ===== RESZTA RESPONSYWNOŚCI ===== */

    .page-header h1 {
        font-size: 24px;
    }

    .logo {
        max-width: 250px;
    }

    .card-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .tiles-container {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        max-height: 85vh;
    }

    .panel {
        padding: var(--spacing-lg);
    }

    .footer-logos {
        gap: var(--spacing-md);
    }

    .footer-logo {
        height: 60px;
    }

    .footer-funding-text {
        font-size: 13px;
    }

    .footer-contact-info h4 {
        font-size: 15px;
    }

    .footer-contact-info p {
        font-size: 13px;
    }

    .footer-links {
        gap: var(--spacing-sm);
    }

    .footer-links a {
        font-size: 13px;
    }

    .footer-links-separator {
        font-size: 13px;
    }
}

/* ========== UTILITY CLASSES ========== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }
.mt-4 { margin-top: var(--spacing-xl); }

.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mb-3 { margin-bottom: var(--spacing-lg); }
.mb-4 { margin-bottom: var(--spacing-xl); }

.hidden { display: none; }
.visible { display: block; }

.fade-in {
    animation: fadeIn 0.5s ease;
}

/* ============================================
   PAGINACJA - Wyszukiwanie po specjalizacji
   Data dodania: 2025-10-20
   ============================================ */

/* Główny kontener kontrolek paginacji */
.pagination-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
    background: linear-gradient(135deg, #F8F9FA 0%, #E8EAED 100%);
    border-radius: 12px;
    border: 2px solid #E0E0E0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Selektor liczby wyników na stronę */
.per-page-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.per-page-selector span {
    font-size: 14px;
    color: var(--gray-700);  /* WCAG AAA: 11.5:1 contrast ratio */
}

/* Przyciski wyboru liczby wyników */
.per-page-btn {
    padding: 10px 18px;
    border: 2px solid #DDD;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);  /* WCAG AAA: 11.5:1 contrast ratio */
    transition: all 0.2s ease;
    min-width: 60px;
    text-align: center;
}

.per-page-btn:hover {
    border-color: #5FA399;
    background: #F0F8F7;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(95, 163, 153, 0.2);
}

.per-page-btn.active {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #2E5C55 100%);  /* WCAG AAA: Changed for better contrast */
    color: white;
    border-color: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(95, 163, 153, 0.3);
}

.per-page-btn.active:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(95, 163, 153, 0.4);
}

/* Kontener z numerami stron */
.pagination-numbers {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Przyciski stron */
.page-btn {
    padding: 10px 16px;
    border: 2px solid #DDD;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);  /* WCAG AAA: 11.5:1 contrast ratio */
    min-width: 44px;
    text-align: center;
    transition: all 0.2s ease;
}

.page-btn:hover:not(:disabled) {
    border-color: #5FA399;
    background: #F0F8F7;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(95, 163, 153, 0.2);
}

.page-btn.active {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #2E5C55 100%);  /* WCAG AAA: Changed for better contrast */
    color: white;
    border-color: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(95, 163, 153, 0.3);
    font-weight: bold;
}

.page-btn.active:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(95, 163, 153, 0.4);
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #F5F5F5;
    color: #AAA;
    border-color: #E0E0E0;
}

.page-btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Przyciski Poprzednia/Następna */
.page-btn:first-child,
.page-btn:last-child {
    font-weight: 600;
    min-width: auto;
    padding: 10px 20px;
}

/* Responsywność */
@media (max-width: 768px) {
    .pagination-controls {
        padding: 16px;
        gap: 12px;
    }

    .per-page-selector {
        flex-direction: column;
        align-items: stretch;
    }

    .per-page-selector span {
        text-align: center;
        margin-bottom: 4px;
    }

    .per-page-btn {
        flex: 1;
        min-width: auto;
    }

    .pagination-numbers {
        gap: 6px;
    }

    .page-btn {
        padding: 8px 12px;
        min-width: 38px;
        font-size: 13px;
    }

    .page-btn:first-child,
    .page-btn:last-child {
        padding: 8px 14px;
        font-size: 12px;
    }

    .pagination-numbers span {
        display: none;
    }
}

@media (max-width: 480px) {
    .per-page-selector {
        gap: 8px;
    }

    .per-page-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    .page-btn {
        padding: 6px 10px;
        min-width: 34px;
        font-size: 12px;
    }

    .pagination-numbers .page-btn:not(.active):not(:first-child):not(:last-child) {
        display: none;
    }
}

/* Animacje */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pagination-controls {
    animation: fadeIn 0.3s ease;
}

/* ========== RREDM MODAL - Ostrzeżenie o przekierowaniu ========== */

.rredm-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: rredmFadeIn 0.3s ease;
}

.rredm-modal-dialog {
    background: white;
    padding: 32px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    text-align: center;
    animation: rredmSlideIn 0.3s ease;
}

.rredm-modal-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.rredm-modal-title {
    color: var(--primary-text);
    margin: 0 0 16px 0;
    font-size: 24px;
    font-weight: 600;
}

.rredm-modal-text {
    margin: 0 0 8px 0;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
}

.rredm-modal-url {
    margin: 0 0 16px 0;
    font-size: 18px;
}

.rredm-modal-url strong {
    color: var(--primary-dark);
}

.rredm-modal-description {
    margin: 0 0 24px 0;
    font-size: 14px;
    color: var(--gray-700);  /* WCAG AAA: 11.5:1 contrast ratio */
}

.rredm-modal-countdown {
    margin: 0 0 24px 0;
    font-size: 18px;
    font-weight: bold;
    color: var(--primary-text);
}

.rredm-countdown-number {
    display: inline-block;
    font-size: 24px;
    color: var(--primary-text);
    min-width: 30px;
    transition: transform 0.1s ease;
}

.rredm-modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.rredm-btn {
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
}

.rredm-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

.rredm-btn-cancel {
    padding: 12px 24px;
    border: 2px solid #ccc;
    background: white;
    color: var(--gray-700);  /* WCAG AAA: 11.5:1 contrast ratio */
}

.rredm-btn-cancel:hover {
    border-color: #6B6B6B;
    background: #f5f5f5;
}

.rredm-btn-confirm {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.rredm-btn-confirm:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
}

/* Animacje */
@keyframes rredmFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* Animacja zamykania */
.rredm-modal-fade-out {
    animation: rredmFadeOut 0.3s ease forwards;
}

@keyframes rredmFadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Responsywność */
@media (max-width: 768px) {
    .rredm-modal-dialog {
        padding: 24px;
        width: 95%;
    }

    .rredm-modal-title {
        font-size: 20px;
    }

    .rredm-modal-icon {
        font-size: 36px;
    }

    .rredm-modal-buttons {
        flex-direction: column;
    }

    .rredm-btn {
        width: 100%;
    }
}

/* Style dla linku external */
.external-link {
    position: relative;
}

.external-link::after {
    content: ' ↗';
    font-size: 0.8em;
    opacity: 0.7;
}

/* ========== ACCESSIBILITY HELPERS ========== */
/* Screen reader only - ukrywa element wizualnie, ale pozostawia go dla czytników ekranu */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ========== INTERACTIVE MAP ========== */
.map-section {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    box-shadow: var(--shadow-md);
}

.map-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.map-header h2 {
    color: var(--primary-text);
    font-size: 26px;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
}

.map-header p {
    color: var(--gray-600);
    font-size: 15px;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

.map-container {
    width: 100%;
    height: 500px;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 2px solid var(--gray-200);
}

.map-legend {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--primary-pale);
    border-radius: var(--radius-md);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 14px;
    color: var(--gray-700);
}

.legend-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

/* Custom Leaflet marker styles */
.custom-marker {
    background: transparent;
    border: none;
}

.marker-pin {
    width: 40px;
    height: 40px;
    border-radius: 50% 50% 50% 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    position: relative;
    transform: rotate(-45deg);
    left: 50%;
    top: 50%;
    margin: -20px 0 0 -20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: bounce 2s ease-in-out infinite;
}

.marker-pin::after {
    content: '';
    width: 24px;
    height: 24px;
    margin: -8px 0 0 -8px;
    background: white;
    position: absolute;
    border-radius: 50%;
}

.marker-count {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-dark);
    font-weight: 700;
    font-size: 16px;
    transform: rotate(45deg);
    z-index: 2;
}

@keyframes bounce {
    0%, 100% {
        transform: rotate(-45deg) translateY(0);
    }
    50% {
        transform: rotate(-45deg) translateY(-10px);
    }
}

/* Custom popup styles */
.custom-popup .leaflet-popup-content-wrapper {
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 0;
}

.custom-popup .leaflet-popup-content {
    margin: 0;
    width: auto !important;
}

.custom-popup .leaflet-popup-tip {
    background: white;
}

.map-popup {
    padding: var(--spacing-md);
}

.popup-title {
    color: var(--primary-text);
    font-size: 20px;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--primary-dark);
}

.popup-count {
    color: var(--gray-700);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: var(--spacing-md);
}

.popup-list {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--spacing-md) 0;
    max-height: 200px;
    overflow-y: auto;
}

.popup-list li {
    padding: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--gray-800);
    line-height: 1.4;
}

.popup-list li:hover {
    background: var(--primary-pale);
}

.popup-actions {
    display: flex;
    gap: var(--spacing-sm);
}

.popup-btn {
    flex: 1;
    display: inline-block;
    padding: var(--spacing-sm) var(--spacing-md);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    transition: var(--transition-normal);
}

.popup-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Leaflet tooltip custom styling */
.leaflet-tooltip {
    background: var(--gray-900);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: var(--shadow-md);
}

.leaflet-tooltip-top:before {
    border-top-color: var(--gray-900);
}

/* Responsywność */
@media (max-width: 768px) {
    .map-section {
        padding: var(--spacing-md);
    }

    .map-header h2 {
        font-size: 20px;
    }

    .map-header p {
        font-size: 14px;
    }

    .map-container {
        height: 400px;
    }

    .marker-pin {
        width: 32px;
        height: 32px;
        margin: -16px 0 0 -16px;
    }

    .marker-pin::after {
        width: 20px;
        height: 20px;
        margin: -6px 0 0 -6px;
    }

    .marker-count {
        font-size: 14px;
    }

    .popup-list {
        max-height: 150px;
    }

    .map-legend {
        font-size: 13px;
    }
}

/* ========== DATA UPDATE BANNER ========== */
.data-update-banner {
    background: linear-gradient(135deg, #E8F5F3 0%, #F0F8F7 100%);
    border-left: 5px solid var(--primary-color);
    margin: var(--spacing-xl) auto;
    max-width: 1400px;
    box-shadow: var(--shadow-sm);
}

.banner-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-xl);
}

.banner-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.banner-text {
    flex: 1;
    color: var(--gray-800);
    line-height: 1.6;
}

.banner-text strong {
    color: var(--primary-text);
    font-size: 16px;
}

.banner-text #dataAktualizacji {
    color: var(--primary-text);
    font-weight: 600;
    font-size: 16px;
}

.banner-source {
    font-size: 13px;
    color: var(--gray-600);
    font-style: italic;
}

/* Responsywność bannera */
@media (max-width: 768px) {
    .data-update-banner {
        margin: var(--spacing-md);
    }

    .banner-content {
        padding: var(--spacing-md);
        gap: var(--spacing-sm);
    }

    .banner-icon {
        font-size: 24px;
    }

    .banner-text {
        font-size: 14px;
    }

    .banner-text strong,
    .banner-text #dataAktualizacji {
        font-size: 14px;
    }

    .banner-source {
        font-size: 12px;
    }
}

/* ============================================ */
/* RANKING TABLE - TOP 5 Podmiotów             */
/* ============================================ */

.ranking-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.ranking-table thead {
    background: linear-gradient(135deg, #E8F5F3 0%, #F0F8F7 100%);
    border-bottom: 3px solid var(--primary-color);
}

.ranking-table thead th {
    padding: 16px 12px;
    font-weight: 700;
    font-size: 14px;
    color: var(--gray-900);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ranking-table tbody tr {
    border-bottom: 1px solid var(--gray-200);
    transition: all 0.2s ease;
}

.ranking-table tbody tr:hover {
    background: #F0F8F7;
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(95, 163, 153, 0.15);
}

.ranking-table tbody tr:last-child {
    border-bottom: none;
}

.ranking-table tbody td {
    padding: 16px 12px;
    font-size: 14px;
    color: var(--gray-700);
}

/* Kolumna z numerem/medalem */
.ranking-table tbody td:first-child {
    font-size: 24px;
    font-weight: 700;
}

/* Kolumna z nazwą podmiotu */
.ranking-table tbody td:nth-child(2) {
    font-size: 15px;
}

.ranking-table tbody td:nth-child(2) strong {
    color: var(--primary-dark);
    font-weight: 600;
}

/* Wyróżnienie liczb */
.ranking-table tbody td[style*="text-align: center"] {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-variant-numeric: tabular-nums;
}

/* Przyciski sortowania */
.sort-btn {
    padding: 8px 16px;
    background: white;
    border: 2px solid #E0E0E0;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #555;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.sort-btn:hover {
    background: #F0F8F7;
    border-color: #5FA399;
    color: #2E5C55;
}

.sort-btn.active {
    background: #2E5C55;
    border-color: #2E5C55;
    color: white;
    font-weight: 600;
}

.sort-btn .sort-icon {
    font-size: 16px;
    font-weight: bold;
    transition: transform 0.2s ease;
}

.sort-btn[data-order="asc"] .sort-icon {
    transform: rotate(180deg);
}

/* Button wyglądający jak link (semantyczny button zamiast <a href="#">) */
.link-button {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    font: inherit;
    cursor: pointer;
    text-decoration: none;
}

.link-button:hover {
    text-decoration: underline;
    opacity: 0.8;
}

.link-button:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Responsywność tabeli */
@media (max-width: 992px) {
    .ranking-table {
        font-size: 13px;
    }

    .ranking-table thead th {
        padding: 12px 8px;
        font-size: 12px;
    }

    .ranking-table tbody td {
        padding: 12px 8px;
        font-size: 13px;
    }

    .ranking-table tbody td:first-child {
        font-size: 20px;
    }

    .ranking-table tbody td:nth-child(2) {
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    /* Na małych ekranach: scroll horyzontalny */
    .ranking-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .ranking-table thead,
    .ranking-table tbody,
    .ranking-table tr {
        display: table;
        width: 100%;
        table-layout: fixed;
    }
}

@media (max-width: 576px) {
    .ranking-table thead th,
    .ranking-table tbody td {
        padding: 10px 6px;
        font-size: 12px;
    }

    .ranking-table tbody td:first-child {
        font-size: 18px;
    }

    .ranking-table tbody td:nth-child(2) {
        font-size: 13px;
        min-width: 200px;
    }
}

/* ============================================
   ACCESSIBILITY - WCAG 2.1 COMPLIANCE
   ============================================ */

/* Screen reader only - ukryj wizualnie, pozostaw dla czytników ekranu */
.sr-only {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

/* Skip link - przejdź do treści głównej */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #000;
    color: #fff;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 10001;
    border-radius: 0 0 4px 0;
    font-weight: 600;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid #FFFF00;
    outline-offset: 2px;
}

/* ========== ACCESSIBILITY TOOLBAR ========== */
.accessibility-toolbar {
    position: fixed;
    bottom: 90px;
    right: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: rgba(95, 163, 153, 0.95);
    border-radius: 12px;
    backdrop-filter: blur(15px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    z-index: 9998;
    transition: all 0.3s ease;
}

.a11y-btn {
    background: rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: white;
    width: 52px;
    height: 52px;
    padding: 8px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.a11y-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.a11y-btn:focus {
    outline: 3px solid #FFF;
    outline-offset: 2px;
}

.a11y-btn:active,
.a11y-btn.active {
    background: rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(0.95);
}

.a11y-icon {
    font-size: 16px;
    line-height: 1;
}

.a11y-icon-large {
    font-size: 24px;
}

.a11y-label {
    font-size: 13px;
}

.a11y-separator {
    width: 40px;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
    margin: 4px 0;
}

/* ========== FONT SIZE CLASSES ========== */
body.font-size-small {
    font-size: 14.4px; /* 90% of 16px */
}

body.font-size-normal {
    font-size: 16px; /* 100% - domyślne */
}

body.font-size-large {
    font-size: 19.2px; /* 120% of 16px */
}

/* Dostosowanie elementów przy większej czcionce */
body.font-size-large .card-title {
    font-size: 1.3rem;
}

body.font-size-large .stat-value {
    font-size: 2.6rem;
}

body.font-size-large h1 {
    font-size: 2.8rem;
}

body.font-size-large h2 {
    font-size: 2.2rem;
}

body.font-size-large .nav-item a {
    font-size: 1.05rem;
}

/* Dostosowanie przy mniejszej czcionce */
body.font-size-small .card-title {
    font-size: 1rem;
}

body.font-size-small .stat-value {
    font-size: 2rem;
}

body.font-size-small h1 {
    font-size: 2rem;
}

body.font-size-small h2 {
    font-size: 1.6rem;
}

/* ========== HIGH CONTRAST MODE ========== */
body.high-contrast {
    --primary-color: #000000;
    --primary-dark: #000000;
    --primary-light: #333333;
    --primary-pale: #FFFFFF;

    --accent-color: #FFFF00;
    --success-color: #00FF00;
    --warning-color: #FFAA00;
    --info-color: #00AAFF;

    --gray-50: #FFFFFF;
    --gray-100: #FFFFFF;
    --gray-200: #EEEEEE;
    --gray-300: #DDDDDD;
    --gray-400: #000000;
    --gray-500: #000000;
    --gray-600: #000000;
    --gray-700: #000000;
    --gray-800: #000000;
    --gray-900: #000000;

    background: #FFFFFF !important;
    color: #000000 !important;
}

body.high-contrast .navbar {
    background: #000000 !important;
    color: #FFFFFF !important;
    border-bottom: 3px solid #FFFF00;
}

body.high-contrast .nav-item a {
    color: #FFFFFF !important;
    border: 2px solid transparent;
}

body.high-contrast .nav-item a:hover,
body.high-contrast .nav-item a.active {
    background: #FFFF00 !important;
    color: #000000 !important;
    border-color: #FFFF00;
}

body.high-contrast .nav-brand {
    color: #FFFFFF !important;
}

body.high-contrast .card {
    background: #FFFFFF !important;
    border: 3px solid #000000 !important;
    color: #000000 !important;
}

body.high-contrast .card:hover {
    background: #FFFF00 !important;
    border-color: #000000 !important;
}

body.high-contrast .panel {
    background: #FFFFFF !important;
    border: 3px solid #000000 !important;
    color: #000000 !important;
}

body.high-contrast button,
body.high-contrast .btn {
    background: #000000 !important;
    color: #FFFFFF !important;
    border: 2px solid #000000 !important;
}

body.high-contrast button:hover,
body.high-contrast .btn:hover {
    background: #FFFF00 !important;
    color: #000000 !important;
    border-color: #000000 !important;
}

body.high-contrast a {
    color: #0000EE !important;
    text-decoration: underline;
}

body.high-contrast a:visited {
    color: #551A8B !important;
}

body.high-contrast .page-header {
    background: #FFFFFF !important;
    color: #000000 !important;
    border-bottom: 3px solid #000000;
}

body.high-contrast .stat-card {
    background: #FFFFFF !important;
    border: 3px solid #000000 !important;
    color: #000000 !important;
}

body.high-contrast .filter-group label {
    color: #000000 !important;
}

body.high-contrast input,
body.high-contrast select,
body.high-contrast textarea {
    background: #FFFFFF !important;
    color: #000000 !important;
    border: 2px solid #000000 !important;
}

body.high-contrast .map-container {
    border: 3px solid #000000 !important;
}

body.high-contrast .footer {
    background: #000000 !important;
    color: #FFFFFF !important;
    border-top: 3px solid #FFFF00;
}

body.high-contrast .accessibility-toolbar {
    background: rgba(255, 255, 0, 0.2);
    border: 2px solid #FFFF00;
}

body.high-contrast .a11y-btn {
    background: #000000;
    border-color: #FFFF00;
    color: #FFFFFF;
}

body.high-contrast .a11y-btn:hover,
body.high-contrast .a11y-btn.active {
    background: #FFFF00;
    color: #000000;
}

/* Fokus w trybie wysokiego kontrastu */
body.high-contrast *:focus {
    outline: 4px solid #FFFF00 !important;
    outline-offset: 2px;
}

/* ========== IMPROVED FOCUS STYLES ========== */
*:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

button:focus,
.btn:focus {
    outline: 3px solid #FFA500;
    outline-offset: 3px;
}

a:focus {
    outline: 3px solid #2196F3;
    outline-offset: 2px;
    text-decoration: underline;
}

input:focus,
select:focus,
textarea:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
    border-color: var(--primary-color);
}

/* ========== RESPONSIVE - ACCESSIBILITY TOOLBAR ========== */
/* Toolbar jest teraz zawsze pływający w prawym dolnym rogu */
/* Tylko drobne dostosowania dla mniejszych ekranów */

@media (max-width: 576px) {
    .accessibility-toolbar {
        bottom: 70px;
        right: 12px;
        padding: 8px;
        gap: 6px;
    }

    .a11y-btn {
        width: 48px;
        height: 48px;
    }

    .a11y-separator {
        width: 36px;
    }
}
