/* Accessibility Styles - WCAG 2.1 Compliance */

/* Focus Management */
.entourance-plugin *:focus {
    outline: 3px solid #005fcc;
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(0, 95, 204, 0.3);
}

/* Skip Links */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #000;
    color: #fff;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 0 0 4px 4px;
    z-index: 10000;
    font-weight: bold;
}

.skip-link:focus {
    top: 0;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .entourance-plugin {
        --bs-primary: #0000ff;
        --bs-secondary: #000000;
    }
    
    .card {
        border: 2px solid #000;
    }
    
    .btn-primary {
        background-color: #0000ff;
        border-color: #0000ff;
        color: #ffffff;
    }
    
    .btn-outline-primary {
        border-color: #0000ff;
        color: #0000ff;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .entourance-plugin *,
    .entourance-plugin *::before,
    .entourance-plugin *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .carousel {
        scroll-behavior: auto;
    }
}

/* Screen Reader Only Content */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.sr-only-focusable:focus {
    position: static !important;
    width: auto !important;
    height: auto !important;
    padding: inherit !important;
    margin: inherit !important;
    overflow: visible !important;
    clip: auto !important;
    white-space: normal !important;
}

/* Enhanced Button Accessibility */
.btn {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Form Controls Accessibility */
.form-control,
.form-select {
    min-height: 44px;
    border: 2px solid #ccc;
    border-radius: 4px;
}

.form-control:focus,
.form-select:focus {
    border-color: #005fcc;
    box-shadow: 0 0 0 3px rgba(0, 95, 204, 0.3);
}

/* Card Accessibility */
.card {
    border: 1px solid #ddd;
    border-radius: 8px;
    transition: box-shadow 0.2s ease;
}

.card:hover,
.card:focus-within {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.card-link:focus {
    outline: 3px solid #005fcc;
    outline-offset: 2px;
}

/* Navigation Accessibility */
.nav-tabs {
    border-bottom: 2px solid #dee2e6;
}

.nav-tabs .nav-link {
    border: 1px solid transparent;
    border-radius: 4px 4px 0 0;
    padding: 12px 16px;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.nav-tabs .nav-link:focus {
    border-color: #005fcc;
    background-color: rgba(0, 95, 204, 0.1);
}

.nav-tabs .nav-link.active {
    border-color: #005fcc #005fcc #fff;
    background-color: #fff;
    color: #005fcc;
    font-weight: 600;
}

/* Tab Panel Accessibility */
.tab-pane {
    padding: 20px 0;
}

.tab-pane:focus {
    outline: none;
}

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #005fcc;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Error States */
.error-message {
    color: #d63384;
    font-weight: 600;
    margin-top: 8px;
}

.error-message::before {
    content: '⚠️ ';
    margin-right: 4px;
}

/* Success States */
.success-message {
    color: #198754;
    font-weight: 600;
    margin-top: 8px;
}

.success-message::before {
    content: '✅ ';
    margin-right: 4px;
}

/* Image Accessibility */
img {
    max-width: 100%;
    height: auto;
}

img:not([alt]) {
    border: 2px dashed #d63384;
}

/* Map Accessibility */
.entourance-map {
    position: relative;
}

.entourance-map::before {
    content: 'Mappa interattiva - Utilizzare i controlli per navigare';
    position: absolute;
    top: -1px;
    left: -1px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

/* Slider Accessibility */
.slider-container {
    position: relative;
}

.slider-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #005fcc;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.slider-control:hover,
.slider-control:focus {
    background: #005fcc;
    color: #fff;
}

.slider-control:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.slider-prev {
    left: 10px;
}

.slider-next {
    right: 10px;
}

/* Calendar Accessibility */
.calendar-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.calendar-navigation button {
    min-height: 44px;
    min-width: 44px;
    padding: 8px 16px;
}

/* Filter Accessibility */
.filter-group {
    margin-bottom: 20px;
}

.filter-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.filter-group select,
.filter-group input {
    width: 100%;
}

/* Search Accessibility */
.search-container {
    position: relative;
}

.search-results-count {
    margin-top: 8px;
    font-size: 0.9rem;
    color: #666;
}

/* Price Accessibility */
.price-container {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.price-currency {
    font-size: 0.8em;
    opacity: 0.8;
}

.price-amount {
    font-size: 1.2em;
    font-weight: 700;
}

/* Rating Accessibility */
.rating-container {
    display: flex;
    align-items: center;
    gap: 4px;
}

.rating-stars {
    display: flex;
    gap: 2px;
}

.rating-star {
    width: 16px;
    height: 16px;
    fill: #ffc107;
}

.rating-text {
    font-size: 0.9rem;
    margin-left: 8px;
}

/* Contact Information Accessibility */
.contact-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.contact-item a {
    color: #005fcc;
    text-decoration: underline;
}

.contact-item a:hover,
.contact-item a:focus {
    text-decoration: none;
    background-color: rgba(0, 95, 204, 0.1);
    padding: 2px 4px;
    border-radius: 2px;
}

/* Responsive Accessibility */
@media (max-width: 768px) {
    .btn {
        min-height: 48px;
        padding: 12px 16px;
    }
    
    .form-control,
    .form-select {
        min-height: 48px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .nav-tabs .nav-link {
        padding: 16px 12px;
        min-height: 48px;
    }
}

/* Typography Accessibility */
.entourance-plugin h1,
.entourance-plugin h2,
.entourance-plugin h3,
.entourance-plugin h4,
.entourance-plugin h5,
.entourance-plugin h6,
.entourance-plugin .h1,
.entourance-plugin .h2,
.entourance-plugin .h3,
.entourance-plugin .h4,
.entourance-plugin .h5,
.entourance-plugin .h6 {
    color: #212529 !important; /* Contrasto WCAG AA: 12.63:1 su bianco */
    font-weight: 600;
}

.entourance-plugin .card-title {
    color: #212529 !important;
    font-weight: 600;
}

.entourance-plugin .entourance-title {
    color: #212529 !important;
    font-weight: 700;
}

/* Link Accessibility */
.entourance-plugin a {
    color: #005fcc !important; /* Contrasto WCAG AA: 4.5:1 su bianco */
    text-decoration: underline;
}

.entourance-plugin a:hover,
.entourance-plugin a:focus {
    color: #004499 !important;
    text-decoration: none;
    background-color: rgba(0, 95, 204, 0.1);
    padding: 2px 4px;
    border-radius: 2px;
}

/* Text Content Accessibility */
.entourance-plugin p,
.entourance-plugin .card-text,
.entourance-plugin .description-content,
.entourance-plugin .info-content {
    color: #495057 !important; /* Contrasto WCAG AA: 7.43:1 su bianco */
    line-height: 1.6;
}

/* Small Text Accessibility */
.entourance-plugin small,
.entourance-plugin .small,
.entourance-plugin .text-muted {
    color: #6c757d !important; /* Contrasto WCAG AA: 4.54:1 su bianco */
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .entourance-plugin h1,
    .entourance-plugin h2,
    .entourance-plugin h3,
    .entourance-plugin h4,
    .entourance-plugin h5,
    .entourance-plugin h6,
    .entourance-plugin .h1,
    .entourance-plugin .h2,
    .entourance-plugin .h3,
    .entourance-plugin .h4,
    .entourance-plugin .h5,
    .entourance-plugin .h6,
    .entourance-plugin .card-title,
    .entourance-plugin .entourance-title {
        color: #000000 !important; /* Massimo contrasto */
        font-weight: 700;
    }
    
    .entourance-plugin a {
        color: #0000ff !important; /* Blu ad alto contrasto */
        font-weight: 600;
    }
    
    .entourance-plugin p,
    .entourance-plugin .card-text,
    .entourance-plugin .description-content,
    .entourance-plugin .info-content {
        color: #000000 !important;
        font-weight: 500;
    }
    
    .entourance-plugin small,
    .entourance-plugin .small,
    .entourance-plugin .text-muted {
        color: #000000 !important;
        font-weight: 500;
    }
}

/* Dark Mode Support - DISABILITATO per evitare problemi di contrasto */
/* Il dark mode è stato rimosso perché causava problemi di leggibilità */
/* quando applicato solo ai testi senza modificare gli sfondi */

/* Badge Accessibili - Pill Evento Passato */
.entourance-plugin .badge.bg-dark {
    background-color: #212529 !important;
    color: #ffffff !important;
    border: 1px solid #000000;
}

/* High Contrast Support per Badge Evento Passato */
@media (prefers-contrast: high) {
    .entourance-plugin .badge.bg-dark {
        background-color: #000000 !important;
        color: #ffffff !important;
        border: 2px solid #ffffff;
    }
}

/* Focus Support per Badge */
.entourance-plugin .badge.bg-dark:focus {
    outline: 3px solid #ffffff;
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.5);
}
