/* RGAA Auditor - Styles principaux */

/* Variables CSS pour la cohérence des couleurs RGAA */
:root {
    --rgaa-primary: #0066cc;
    --rgaa-success: #28a745;
    --rgaa-warning: #ffc107;
    --rgaa-danger: #dc3545;
    --rgaa-info: #17a2b8;
    --rgaa-secondary: #6c757d;
    --rgaa-light: #f8f9fa;
    --rgaa-dark: #343a40;
    --rgaa-border: #dee2e6;
    --rgaa-shadow: rgba(0, 0, 0, 0.1);
}

/* Styles généraux */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #ffffff 0%, #75b6ff 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Header personnalisé */
.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.navbar {
    box-shadow: 0 2px 10px var(--rgaa-shadow);
}

/* Container principal */
.main-container {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

/* Cards personnalisées */
.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.card-header {
    background: linear-gradient(45deg, var(--rgaa-primary), #0056b3);
    color: white;
    border: none;
    border-radius: 15px 15px 0 0 !important;
}

.card-header.bg-secondary {
    background: linear-gradient(45deg, #17c411, #0f790b) !important;
}

.card-header.bg-info {
    background: linear-gradient(45deg, var(--rgaa-info), #138496) !important;
}

/* Style spécifique pour les entêtes avec fond clair (scans complets) */
.card-header.bg-light {
    background: var(--rgaa-light) !important;
    color: var(--rgaa-dark) !important;
    border-bottom: 1px solid var(--rgaa-border);
}

.card-body {
    padding: 2rem;
}

/* Formulaires */
.form-label {
    font-weight: 600;
    color: var(--rgaa-dark);
    margin-bottom: 0.75rem;
}

.form-control {
    border-radius: 10px;
    border: 2px solid var(--rgaa-border);
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--rgaa-primary);
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.25);
}

/* Boutons */
.btn {
    border-radius: 10px;
    padding: 0.75rem 2rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(45deg, var(--rgaa-primary), #0056b3);
    box-shadow: 0 4px 15px rgba(0, 102, 204, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 102, 204, 0.4);
}

.btn-secondary {
    background: linear-gradient(45deg, #17c411, #0f790b);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 204, 10, 0.4);
}

.btn-success {
    background: linear-gradient(45deg, var(--rgaa-success), #1e7e34);
}

.btn-warning {
    background: linear-gradient(45deg, var(--rgaa-warning), #e0a800);
    color: var(--rgaa-dark);
}

.btn-danger {
    background: linear-gradient(45deg, var(--rgaa-danger), #c82333);
}

.btn-info {
    background: linear-gradient(45deg, var(--rgaa-info), #138496);
}

/* Loading spinner */
.loading {
    display: none;
    text-align: center;
    margin: 2rem 0;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3em;
}

/* Section Hero */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 0;
    margin-bottom: 3rem;
}

.hero-icon {
    font-size: 8rem;
    opacity: 0.8;
}

/* Section de chargement */
.loading-section {
    display: none;
    padding: 3rem 0;
    text-align: center;
}

.loading-section .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Section des résultats */
.results-section {
    display: none;
    margin-top: 3rem;
}

.result-container {
    display: none;
}

.summary-container {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.score-circle {
    text-align: center;
    padding: 1rem;
}

.score-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--rgaa-primary);
}

.score-label {
    font-size: 0.9rem;
    color: var(--rgaa-dark);
    margin-top: 0.5rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--rgaa-dark);
    text-transform: uppercase;
}

.success-count {
    color: var(--rgaa-success);
}

.na-count {
    color: var(--rgaa-secondary);
}

.error-count {
    color: var(--rgaa-danger);
}

.analyzed-url {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    margin-top: 1rem;
}

.analyzed-url a {
    color: var(--rgaa-primary);
    text-decoration: none;
}

.analyzed-url a:hover {
    text-decoration: underline;
}

/* Liste des pages */
.pages-list .page-item {
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.2s ease;
}

.pages-list .page-item:hover {
    transform: translateY(-2px);
}

/* Détails d'audit */
.details-container,
.details-content {
    max-width: 100%;
    overflow-wrap: break-word;
}

.detail-item {
    border-left: 4px solid var(--rgaa-border);
    padding: 1rem;
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 0 10px 10px 0;
}

.detail-item.detail-passed {
    border-left-color: var(--rgaa-success);
    background: rgba(40, 167, 69, 0.1);
}

.detail-item.detail-warning {
    border-left-color: var(--rgaa-warning);
    background: rgba(255, 193, 7, 0.1);
}

.detail-item.detail-failed {
    border-left-color: var(--rgaa-danger);
    background: rgba(220, 53, 69, 0.1);
}

.detail-icon {
    font-size: 1.2rem;
    margin-top: 0.25rem;
}

.detail-title {
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: var(--rgaa-dark);
}

.detail-message {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.detail-solution,
.detail-impact,
.detail-wcag {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 5px;
    font-size: 0.9rem;
}

/* Critères RGAA */
.criteria-item {
    text-align: center;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    transition: transform 0.2s ease;
}

.criteria-item:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.2);
}

.criteria-title {
    font-weight: bold;
    margin-bottom: 1rem;
    color: var(--rgaa-primary);
}

.criteria-title i {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

.criteria-description {
    font-size: 0.9rem;
    color: var(--rgaa-dark);
    margin-bottom: 0;
}

/* Classes pour remplacer les styles inline */

/* Icônes et éléments décoratifs */
.hero-icon {
    font-size: 8rem;
    opacity: 0.3;
}

.feature-icon {
    font-size: 3rem;
}

/* Spinner et chargement */
.audit-spinner {
    width: 3rem;
    height: 3rem;
}

.progress-container {
    max-width: 400px;
    margin: 0 auto;
}

.progress-full-width {
    width: 100%;
}

.progress-score {
    height: 20px;
}

/* Gestion des détails et overflow */
.details-collapse {
    max-width: 100%;
    overflow: hidden;
}

.details-container {
    max-width: 100%;
    overflow-wrap: break-word;
}

.issue-item {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.code-block {
    white-space: pre-wrap;
    word-break: break-all;
    max-width: 100%;
    overflow-x: auto;
}

.issue-solution {
    word-wrap: break-word;
}

.table-section-header {
    background-color: #f8f9fa;
}

/* Barres de progression */
.progress-standard {
    height: 1rem;
    border-radius: 10px;
}

.progress-bar {
    transition: width 0.6s ease;
}

/* Animation pour les accordéons */
.accordion-button:not(.collapsed) {
    background-color: var(--rgaa-primary);
    color: white;
}

.accordion-button:focus {
    z-index: 3;
    border-color: var(--rgaa-primary);
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Améliorations pour les détails */
.accordion-item {
    margin-bottom: 0.5rem;
    border-radius: 10px !important;
    overflow: hidden;
}

.accordion-button {
    padding: 1rem 1.25rem;
    font-weight: 500;
}

.accordion-body {
    padding: 1.5rem;
}

/* Correction des contrastes et couleurs */
.btn-link {
    color: var(--rgaa-dark) !important;
    text-decoration: none !important;
    font-weight: 500;
}

.btn-link:hover,
.btn-link:focus {
    color: var(--rgaa-primary) !important;
    text-decoration: underline;
}

.card-header .btn-link {
    color: var(--rgaa-dark) !important;
    font-size: 1.1rem;
    padding: 0.5rem 0;
}

.card-header .btn-link:hover {
    color: var(--rgaa-primary) !important;
}

/* Amélioration des accordéons pour les thèmes */
.themes-accordion .card {
    border: 1px solid var(--rgaa-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.themes-accordion .card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid var(--rgaa-border);
}

.themes-accordion .btn-link {
    width: 100%;
    text-align: left;
    color: var(--rgaa-dark) !important;
    font-weight: 600;
    padding: 1rem;
    border: none;
    background: none;
}

.themes-accordion .btn-link:hover {
    background-color: #e9ecef;
    color: var(--rgaa-primary) !important;
}

/* Amélioration de la visibilité des titres d'accordéons */
.themes-accordion .card-header .btn-link {
    color: var(--rgaa-dark) !important;
    font-weight: 700 !important;
    font-size: 1.1rem !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    padding: 1.25rem !important;
}

.themes-accordion .card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    border-bottom: 2px solid var(--rgaa-border) !important;
}

.themes-accordion .card-header .btn-link:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%) !important;
    color: var(--rgaa-primary) !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Amélioration des accordéons pour les critères */
.accordion-item.border-success {
    border-left: 4px solid var(--rgaa-success) !important;
}

.accordion-item.border-warning {
    border-left: 4px solid var(--rgaa-warning) !important;
}

.accordion-item.border-danger {
    border-left: 4px solid var(--rgaa-danger) !important;
}

.accordion-button.collapsed {
    background-color: #fff;
    color: var(--rgaa-dark);
}

.accordion-button:not(.collapsed) {
    background-color: var(--rgaa-light);
    color: var(--rgaa-dark);
    border-bottom: 1px solid var(--rgaa-border);
}

/* Styles pour les éléments de problèmes détaillés */
.issue-item {
    transition: all 0.3s ease;
    background-color: #fff;
}

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

.issue-item.border-success {
    border-left: 4px solid var(--rgaa-success) !important;
}

.issue-item.border-warning {
    border-left: 4px solid var(--rgaa-warning) !important;
}

.issue-item.border-danger {
    border-left: 4px solid var(--rgaa-danger) !important;
}

.issue-item code {
    word-break: break-all;
    white-space: pre-wrap;
}

.issue-item .alert {
    margin-bottom: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
}

.issue-item .badge {
    font-size: 0.75rem;
}

/* Styles pour l'affichage des éléments HTML dans les résultats d'audit */
.element-display-container {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #dee2e6;
}

.image-preview {
    background: white;
    border-radius: 8px;
    padding: 10px;
    border: 2px dashed #dee2e6;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-preview img {
    border-radius: 4px;
    transition: transform 0.2s ease;
}

.image-preview img:hover {
    transform: scale(1.05);
}

.image-details {
    font-size: 0.9rem;
}

.image-details .row {
    margin-bottom: 0.25rem;
}

.image-details strong {
    color: var(--rgaa-dark);
}

.element-display-container code {
    word-break: break-all;
    font-size: 0.8rem;
}

.element-display-container .alert {
    margin-bottom: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}

/* Styles pour les liens avec images */
.link-with-image-indicator {
    background: linear-gradient(90deg, #e3f2fd 0%, #bbdefb 100%);
    border-left: 4px solid var(--rgaa-info);
    padding: 8px 12px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.base64-indicator {
    background: linear-gradient(90deg, #fff3e0 0%, #ffcc02 100%);
    border-left: 4px solid var(--rgaa-warning);
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
}

/* Styles spécifiques pour les différents types d'images */
.placeholder-info {
    font-size: 0.9rem;
    border-left: 4px solid #6c757d;
}

.image-preview .img-thumbnail.border-success {
    border-color: #28a745 !important;
    border-width: 2px !important;
}

.image-preview .img-thumbnail.border-info {
    border-color: #17a2b8 !important;
    border-width: 2px !important;
}

.lazy-loading-indicator {
    background: linear-gradient(90deg, #fff3cd 0%, #ffeaa7 100%);
    border-left: 4px solid #ffc107;
}

/* Animation pour les images qui se chargent */
.image-preview img {
    transition: all 0.3s ease;
    opacity: 1;
}

.image-preview img[src*="base64"] {
    filter: contrast(1.1) brightness(1.05);
}

/* Style pour les badges de type d'image */
.badge.bg-warning {
    background-color: #ffc107 !important;
    color: #000 !important;
}

.badge.bg-secondary {
    background-color: #6c757d !important;
}

.badge.bg-info {
    background-color: #0dcaf0 !important;
    color: #000 !important;
}

/* Responsive */
@media (max-width: 768px) {
    .card-body {
        padding: 1rem;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .table {
        font-size: 0.9rem;
    }

    .table td, .table th {
        padding: 0.5rem;
        max-width: 150px;
    }

    .detail-content {
        max-height: 200px;
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    .main-container {
        margin-top: 1rem;
        margin-bottom: 1rem;
    }

    .card {
        margin-bottom: 1rem;
    }

    .table-responsive {
        font-size: 0.8rem;
    }

    .table td, .table th {
        max-width: 100px;
    }

    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

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

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

/* Accessibilité */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus visible pour l'accessibilité */
button:focus-visible,
.btn:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--rgaa-primary);
    outline-offset: 2px;
}

/* Contraste élevé pour l'accessibilité */
@media (prefers-contrast: high) {
    :root {
        --rgaa-primary: #0052cc;
        --rgaa-border: #000000;
        --rgaa-shadow: rgba(0, 0, 0, 0.3);
    }

    .card {
        border: 2px solid var(--rgaa-border);
    }

    .table {
        border: 2px solid var(--rgaa-border);
    }
}

/* Réduction des mouvements pour l'accessibilité */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Classes pour icônes de fonctionnalités */
.feature-icon-large {
    font-size: 4rem;
    margin-bottom: 1rem;
}
/* Navigation navbar styles */
.navbar-dark {
    background: linear-gradient(135deg, var(--rgaa-primary) 0%, #0056b3 100%);
}

.navbar-dark .navbar-brand {
    color: white !important;
    font-weight: bold;
}

.navbar-dark .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
}

.navbar-dark .nav-link:hover {
    color: white !important;
}

/* Footer styles */
.footer {
    background: linear-gradient(135deg, var(--rgaa-dark) 0%, #495057 100%);
    color: white;
    margin-top: auto;
}

.footer h5 {
    color: white;
}

.footer p {
    color: rgba(255, 255, 255, 0.8);
}

.hero-logo {
    width: 100px;
    height: auto;
}

.hero-logo2 {
    width: 32px;
    height: auto;
}

.hero-logo3 {
    width: 40px;
    height: auto;
}

.hero-logo4 {
    width: auto;
    height: 280px;
}

.logoNav {
    display: flex;
    align-items: center;
}

/* Compteur de pages pour l'audit complet */
#page-counter {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    display: inline-block;
    margin-top: 0.5rem;
    animation: counterPulse 2s ease-in-out infinite;
}

#page-counter .bi {
    color: var(--rgaa-primary);
}

@keyframes counterPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.9;
    }
    50% {
        transform: scale(1.02);
        opacity: 1;
    }
}

@keyframes counterSuccess {
    0% {
        transform: scale(1);
        background: rgba(255, 255, 255, 0.1);
    }
    50% {
        transform: scale(1.1);
        background: rgba(40, 167, 69, 0.2);
    }
    100% {
        transform: scale(1);
        background: rgba(40, 167, 69, 0.1);
    }
}

#current-page {
    font-weight: 600;
    color: var(--rgaa-primary);
}

#total-pages {
    font-weight: 500;
}
