/* ===== WCAG ACCESSIBILITY PANEL STYLES ===== */

/* WCAG Toggle Button - na środku ekranu z zieloną obwolutą */
.wcag-toggle-btn {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    border: 3px solid #10b981;
    border-radius: 50%;
    font-size: 2.5rem;
    cursor: pointer;
    z-index: 9999;
    box-shadow: 
        0 4px 20px rgba(37, 99, 235, 0.4),
        0 0 0 6px rgba(16, 185, 129, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wcag-toggle-btn::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    background: linear-gradient(45deg, #10b981, #059669);
    border-radius: 50%;
    z-index: -1;
    opacity: 0.8;
    animation: wcag-pulse 2s infinite;
}

@keyframes wcag-pulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.4;
    }
    100% {
        transform: scale(1);
        opacity: 0.8;
    }
}

.wcag-toggle-btn:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 
        0 6px 25px rgba(37, 99, 235, 0.6),
        0 0 0 8px rgba(16, 185, 129, 0.5);
    border-color: #059669;
}

.wcag-toggle-btn:hover::before {
    animation-duration: 1s;
}

.wcag-toggle-btn:focus {
    outline: 4px solid #10b981;
    outline-offset: 4px;
}

@media (max-width: 768px) {
    .wcag-toggle-btn {
        width: 50px;
        height: 50px;
        font-size: 2rem;
        right: 15px;
        border-width: 2px;
        box-shadow: 
            0 4px 15px rgba(37, 99, 235, 0.4),
            0 0 0 4px rgba(16, 185, 129, 0.3);
    }
    
    .wcag-toggle-btn::before {
        top: -6px;
        left: -6px;
        right: -6px;
        bottom: -6px;
    }
}

/* WCAG Panel - pokazuje się tam gdzie użytkownik aktualnie jest */
.wcag-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.wcag-panel[aria-hidden="false"] {
    display: flex;
}

.wcag-panel-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

@media (max-width: 640px) {
    .wcag-panel-content {
        max-width: calc(100vw - 2rem);
        border-radius: 8px;
    }
}

/* Panel Header */
.wcag-panel-header {
    padding: 1.5rem 2rem 1rem 2rem;
    border-bottom: 2px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px 12px 0 0;
}

@media (max-width: 640px) {
    .wcag-panel-header {
        padding: 1rem 1.5rem 0.75rem 1.5rem;
        border-radius: 8px 8px 0 0;
    }
}

.wcag-panel-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
}

@media (max-width: 640px) {
    .wcag-panel-header h2 {
        font-size: 1.25rem;
    }
}

.wcag-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    line-height: 1;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wcag-close:hover {
    background: #fee2e2;
    color: #dc2626;
}

.wcag-close:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Panel Body */
.wcag-panel-body {
    padding: 1.5rem 2rem 2rem 2rem;
}

@media (max-width: 640px) {
    .wcag-panel-body {
        padding: 1rem 1.5rem 1.5rem 1.5rem;
    }
}

/* WCAG Groups */
.wcag-group {
    border: none;
    margin: 0 0 1.5rem 0;
    padding: 0;
}

.wcag-group legend {
    font-weight: 600;
    font-size: 1rem;
    color: #1a1a1a;
    margin-bottom: 0.75rem;
    padding: 0;
}

.wcag-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Radio buttons and checkboxes */
.wcag-options label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #374151;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.wcag-options label:hover {
    background: #f3f4f6;
}

.wcag-options input[type="radio"],
.wcag-options input[type="checkbox"] {
    margin: 0;
}

/* Font size buttons */
.wcag-options .btn-font-size {
    background: #f3f4f6;
    border: 2px solid #e5e7eb;
    color: #374151;
    font-weight: 600;
    min-width: 40px;
    min-height: 40px;
    margin-right: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.wcag-options .btn-font-size:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

.wcag-options .btn-font-size.active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

.wcag-options .btn-font-size:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Make font size buttons smaller font sizes */
.wcag-options .btn-font-size[data-size="small"] {
    font-size: 0.7rem;
}

.wcag-options .btn-font-size[data-size="normal"] {
    font-size: 0.9rem;
}

.wcag-options .btn-font-size[data-size="large"] {
    font-size: 1.1rem;
}

.wcag-options .btn-font-size[data-size="xlarge"] {
    font-size: 1.3rem;
}

/* Toggle switches */
.wcag-toggle {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.wcag-toggle input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: relative;
    width: 44px;
    height: 24px;
    background-color: #cbd5e1;
    border-radius: 24px;
    transition: background-color 0.2s ease;
}

.slider:before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    top: 3px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.wcag-toggle input:checked + .slider {
    background-color: #2563eb;
}

.wcag-toggle input:checked + .slider:before {
    transform: translateX(20px);
}

.wcag-toggle input:focus + .slider {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Actions */
.wcag-actions {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #e5e7eb;
    text-align: center;
}

/* ===== WCAG APPLIED STYLES ===== */

/* High contrast mode */
body.high-contrast {
    background: #000000 !important;
    color: #ffffff !important;
}

body.high-contrast .header,
body.high-contrast .navigation,
body.high-contrast .footer,
body.high-contrast .header *,
body.high-contrast .navigation *,
body.high-contrast .footer * {
    background: #000000 !important;
    color: #ffffff !important;
    border-color: #ffffff !important;
}

body.high-contrast .header-contact .contact-value,
body.high-contrast .header-contact .contact-label,
body.high-contrast .logo a,
body.high-contrast .nav-link,
body.high-contrast .nav-dropdown-link,
body.high-contrast .footer-address,
body.high-contrast .footer-contact a,
body.high-contrast .footer-hours-item,
body.high-contrast .footer-info,
body.high-contrast .footer-section h3,
body.high-contrast .footer-day,
body.high-contrast .footer-time {
    color: #ffffff !important;
    background: #000000 !important;
}

body.high-contrast .nav-dropdown-menu {
    background: #000000 !important;
    border: 2px solid #ffffff !important;
}

body.high-contrast .contact-card,
body.high-contrast .service-card,
body.high-contrast .info-card {
    background: #000000 !important;
    color: #ffffff !important;
    border: 2px solid #ffffff !important;
}

body.high-contrast a {
    color: #ffff00 !important;
}

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

body.high-contrast .mobile-menu-toggle {
    background: #ffffff !important;
    color: #000000 !important;
}

/* Inverted colors */
body.inverted-colors {
    filter: invert(1) hue-rotate(180deg);
}

body.inverted-colors img,
body.inverted-colors video,
body.inverted-colors iframe {
    filter: invert(1) hue-rotate(180deg);
}

/* Font sizes - teraz wpływa na wszystkie elementy */
body.font-size-small {
    font-size: 14px;
}

body.font-size-small *,
body.font-size-small .header,
body.font-size-small .navigation,
body.font-size-small .footer,
body.font-size-small .header *,
body.font-size-small .navigation *,
body.font-size-small .footer *,
body.font-size-small h1,
body.font-size-small h2, 
body.font-size-small h3,
body.font-size-small h4,
body.font-size-small h5,
body.font-size-small h6,
body.font-size-small p,
body.font-size-small a,
body.font-size-small span,
body.font-size-small div {
    font-size: 14px !important;
}

body.font-size-large {
    font-size: 18px;
}

body.font-size-large *,
body.font-size-large .header,
body.font-size-large .navigation,
body.font-size-large .footer,
body.font-size-large .header *,
body.font-size-large .navigation *,
body.font-size-large .footer *,
body.font-size-large h1,
body.font-size-large h2,
body.font-size-large h3,
body.font-size-large h4,
body.font-size-large h5,
body.font-size-large h6,
body.font-size-large p,
body.font-size-large a,
body.font-size-large span,
body.font-size-large div {
    font-size: 18px !important;
}

body.font-size-xlarge {
    font-size: 22px;
}

body.font-size-xlarge *,
body.font-size-xlarge .header,
body.font-size-xlarge .navigation,
body.font-size-xlarge .footer,
body.font-size-xlarge .header *,
body.font-size-xlarge .navigation *,
body.font-size-xlarge .footer *,
body.font-size-xlarge h1,
body.font-size-xlarge h2,
body.font-size-xlarge h3,
body.font-size-xlarge h4,
body.font-size-xlarge h5,
body.font-size-xlarge h6,
body.font-size-xlarge p,
body.font-size-xlarge a,
body.font-size-xlarge span,
body.font-size-xlarge div {
    font-size: 22px !important;
}

/* Reduced motion */
body.reduce-motion *,
body.reduce-motion *::before,
body.reduce-motion *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
}

body.reduce-motion .header,
body.reduce-motion .navigation,
body.reduce-motion .footer {
    transition: none !important;
    transform: none !important;
}

/* Screen reader mode */
body.screen-reader-mode {
    line-height: 1.8;
}

body.screen-reader-mode * {
    font-family: Arial, sans-serif !important;
}

body.screen-reader-mode .header,
body.screen-reader-mode .navigation,
body.screen-reader-mode .footer {
    line-height: 1.8;
    font-family: Arial, sans-serif !important;
}

body.screen-reader-mode h1,
body.screen-reader-mode h2,
body.screen-reader-mode h3,
body.screen-reader-mode h4,
body.screen-reader-mode h5,
body.screen-reader-mode h6 {
    font-weight: bold !important;
    margin-bottom: 1rem !important;
}

body.screen-reader-mode .header-contact .contact-label,
body.screen-reader-mode .nav-link,
body.screen-reader-mode .footer-section h3 {
    font-weight: bold !important;
    margin-bottom: 0.5rem !important;
}

/* Highlight links */
body.highlight-links a {
    background: #ffff00 !important;
    color: #000000 !important;
    padding: 0.125rem 0.25rem !important;
    border-radius: 3px !important;
    text-decoration: underline !important;
    font-weight: bold !important;
}

body.highlight-links a:hover {
    background: #ffd700 !important;
}

body.highlight-links .header a,
body.highlight-links .navigation a,
body.highlight-links .footer a {
    background: #ffff00 !important;
    color: #000000 !important;
    padding: 0.125rem 0.25rem !important;
    border-radius: 3px !important;
    text-decoration: underline !important;
    font-weight: bold !important;
}

body.highlight-links .nav-link,
body.highlight-links .nav-dropdown-link {
    background: #ffff00 !important;
    color: #000000 !important;
}

/* Enhanced focus indicators for accessibility */
body.screen-reader-mode *:focus,
body.highlight-links *:focus {
    outline: 4px solid #2563eb !important;
    outline-offset: 2px !important;
    background: rgba(37, 99, 235, 0.1) !important;
}

body.screen-reader-mode .header *:focus,
body.screen-reader-mode .navigation *:focus,
body.screen-reader-mode .footer *:focus,
body.highlight-links .header *:focus,
body.highlight-links .navigation *:focus,
body.highlight-links .footer *:focus {
    outline: 4px solid #2563eb !important;
    outline-offset: 2px !important;
    background: rgba(37, 99, 235, 0.1) !important;
}

/* ===== OCHRONA PRZYCISKU WCAG PRZED ZMIANAMI ROZMIARU CZCIONKI ===== */

/* Ochrona przycisku WCAG - stały rozmiar ikony niezależnie od ustawień */
body.font-size-small .wcag-toggle-btn,
body.font-size-large .wcag-toggle-btn,
body.font-size-xlarge .wcag-toggle-btn {
    font-size: 2.5rem !important;
    width: 60px !important;
    height: 60px !important;
}

@media (max-width: 768px) {
    body.font-size-small .wcag-toggle-btn,
    body.font-size-large .wcag-toggle-btn,
    body.font-size-xlarge .wcag-toggle-btn {
        font-size: 2rem !important;
        width: 50px !important;
        height: 50px !important;
    }
}

/* Ochrona panelu WCAG przed zmianami rozmiaru czcionki */
body.font-size-small .wcag-panel-header h2,
body.font-size-large .wcag-panel-header h2,
body.font-size-xlarge .wcag-panel-header h2 {
    font-size: 1.5rem !important;
}

body.font-size-small .wcag-close,
body.font-size-large .wcag-close,
body.font-size-xlarge .wcag-close {
    font-size: 1.5rem !important;
    width: 40px !important;
    height: 40px !important;
}

body.font-size-small .wcag-group legend,
body.font-size-large .wcag-group legend,
body.font-size-xlarge .wcag-group legend {
    font-size: 1rem !important;
}

body.font-size-small .wcag-options label,
body.font-size-large .wcag-options label,
body.font-size-xlarge .wcag-options label {
    font-size: 0.9rem !important;
}

@media (max-width: 640px) {
    body.font-size-small .wcag-panel-header h2,
    body.font-size-large .wcag-panel-header h2,
    body.font-size-xlarge .wcag-panel-header h2 {
        font-size: 1.25rem !important;
    }
}

/* ===== RESPONSIVE DESIGN FOR WCAG PANEL ===== */
@media (max-width: 480px) {
    .wcag-panel {
        padding: 0.5rem;
    }
    
    .wcag-panel-content {
        border-radius: 6px;
    }
    
    .wcag-panel-header {
        padding: 0.75rem 1rem;
        border-radius: 6px 6px 0 0;
    }
    
    .wcag-panel-header h2 {
        font-size: 1.125rem;
    }
    
    .wcag-panel-body {
        padding: 1rem;
    }
    
    .wcag-options {
        gap: 0.75rem;
    }
    
    .wcag-options .btn-font-size {
        min-width: 35px;
        min-height: 35px;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .wcag-panel,
    .wcag-toggle-btn {
        display: none !important;
    }
}