/* === Variables & Reset === */
:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --bg-hover: #30363d;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --border-color: #30363d;
    --accent-blue: #58a6ff;
    --accent-green: #3fb950;
    --accent-orange: #d29922;
    --accent-red: #f85149;
    --accent-purple: #a371f7;
    --sidebar-width: 240px;
    --header-height: 60px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

/* === Layout === */
.app-container {
    display: flex;
    height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* === Sidebar === */
.logo {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 600;
    color: var(--accent-blue);
    border-bottom: 1px solid var(--border-color);
}

.logo i {
    font-size: 24px;
}

.nav-menu {
    flex: 1;
    padding: 16px 0;
}

.nav-item {
    width: 100%;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    font-size: 14px;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--bg-tertiary);
    color: var(--accent-blue);
    border-left: 3px solid var(--accent-blue);
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

.api-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

.status-dot.online {
    background: var(--accent-green);
}

.status-dot.offline {
    background: var(--accent-red);
}

/* === Header === */
.header {
    height: var(--header-height);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

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

.header-actions {
    display: flex;
    gap: 12px;
}

/* === Buttons === */
.btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn:hover {
    background: var(--bg-hover);
}

.btn-primary {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: #fff;
}

.btn-primary:hover {
    background: #4c8ed9;
}

.btn-danger {
    background: var(--accent-red);
    border-color: var(--accent-red);
    color: #fff;
}

.btn-secondary {
    background: transparent;
}

/* === Tabs === */
.tab-content {
    display: none;
    flex: 1;
    padding: 24px;
    overflow: auto;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
}

/* === Panel Container === */
.panel-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    flex: 1;
    min-height: 0;
}

.panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.panel-header h3 {
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.panel-footer {
    padding: 12px 16px;
    display: flex;
    gap: 8px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

/* === JSON Editor === */
.editor-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.editor-toolbar {
    padding: 8px 12px;
    display: flex;
    gap: 8px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.tool-btn {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.json-editor {
    flex: 1;
    padding: 16px;
    background: var(--bg-primary);
    border: none;
    color: var(--text-primary);
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 13px;
    line-height: 1.5;
    resize: none;
    outline: none;
}

.json-error {
    padding: 8px 12px;
    background: rgba(248, 81, 73, 0.1);
    color: var(--accent-red);
    font-size: 12px;
    display: none;
}

.json-error.show {
    display: block;
}

/* === Response Viewer === */
.response-container {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.json-viewer {
    height: 100%;
    padding: 16px;
    margin: 0;
    background: var(--bg-primary);
    overflow: auto;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

/* === JSON Syntax Highlighting === */
.json-key {
    color: var(--accent-blue);
}

.json-string {
    color: var(--accent-green);
}

.json-number {
    color: var(--accent-orange);
}

.json-boolean {
    color: var(--accent-purple);
}

.json-null {
    color: var(--accent-red);
}

/* === Response Meta === */
.response-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.success {
    background: rgba(63, 185, 80, 0.2);
    color: var(--accent-green);
}

.status-badge.error {
    background: rgba(248, 81, 73, 0.2);
    color: var(--accent-red);
}

.response-time {
    font-size: 12px;
    color: var(--text-secondary);
}

/* === Loading === */
.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(13, 17, 23, 0.9);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 10;
}

.loading-overlay.show {
    display: flex;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-detail {
    font-size: 12px;
    color: var(--text-secondary);
}

/* === Select === */
.select-piece {
    padding: 6px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 13px;
}

/* === Endpoint Tester === */
.endpoint-tester {
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 100%;
}

.endpoint-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.method {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.method.post {
    background: rgba(63, 185, 80, 0.2);
    color: var(--accent-green);
}

.endpoint-path {
    font-family: monospace;
    color: var(--text-secondary);
}

.piece-quick-select {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 6px;
}

.piece-quick-select label {
    font-size: 13px;
    color: var(--text-secondary);
}

.piece-quick-select select {
    flex: 1;
    max-width: 300px;
}

/* === Logs Panel === */
.logs-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 16px;
}

.logs-panel.collapsed .logs-content {
    display: none;
}

.logs-panel.collapsed .toggle-icon {
    transform: rotate(180deg);
}

.logs-header {
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: var(--bg-tertiary);
    border-radius: 8px 8px 0 0;
}

.logs-header h4 {
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-icon {
    transition: transform 0.2s;
}

.logs-content {
    max-height: 200px;
    overflow: auto;
    padding: 12px;
    font-family: monospace;
    font-size: 12px;
    background: var(--bg-primary);
}

.log-entry {
    padding: 4px 0;
    border-bottom: 1px solid var(--border-color);
}

.log-time {
    color: var(--text-muted);
    margin-right: 8px;
}

.log-info {
    color: var(--accent-blue);
}

.log-success {
    color: var(--accent-green);
}

.log-warning {
    color: var(--accent-orange);
}

.log-error {
    color: var(--accent-red);
}




/* === History === */
.history-container {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.history-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
}

.history-actions {
    display: flex;
    gap: 8px;
}

.history-list {
    flex: 1;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.history-item:hover {
    border-color: var(--accent-blue);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.history-item-endpoint {
    font-family: monospace;
    font-size: 13px;
    color: var(--accent-blue);
}

.history-item-time {
    font-size: 12px;
    color: var(--text-muted);
}

.history-item-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-secondary);
}

.history-item-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.history-empty {
    text-align: center;
    padding: 48px;
    color: var(--text-muted);
}

/* === Modal === */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-large {
    width: 1200px;
}

.modal-header {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 20px;
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.compare-container {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding: 20px;
    overflow: auto;
}

/* === Scrollbar === */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-hover);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* === Responsive === */
@media (max-width: 1200px) {
    .panel-container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        width: 60px;
    }

    .sidebar .nav-item span,
    .sidebar .logo span {
        display: none;
    }

    .sidebar .logo {
        justify-content: center;
    }
}


/* === Results Visualization === */
.results-visualization {
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.results-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
}

.results-toggle {
    display: flex;
    gap: 8px;
}

/* Score Card */
.score-card {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 24px;
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-primary) 100%);
    border-radius: 12px;
    margin-bottom: 24px;
}

.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: conic-gradient(var(--accent-green) var(--score-percent, 0%), var(--bg-hover) 0%);
    position: relative;
}

.score-circle::before {
    content: '';
    position: absolute;
    width: 100px;
    height: 100px;
    background: var(--bg-secondary);
    border-radius: 50%;
}

.score-value {
    position: relative;
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
}

.score-label {
    position: relative;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 8px;
    border-radius: 4px;
    margin-top: 4px;
}

.score-label.excellent {
    background: rgba(63, 185, 80, 0.2);
    color: var(--accent-green);
}

.score-label.bon {
    background: rgba(88, 166, 255, 0.2);
    color: var(--accent-blue);
}

.score-label.attention {
    background: rgba(210, 153, 34, 0.2);
    color: var(--accent-orange);
}

.score-label.probleme {
    background: rgba(248, 81, 73, 0.2);
    color: var(--accent-red);
}

.score-info h4 {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.score-info p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Pieces Grid */
.pieces-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

.piece-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.piece-card-header {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}

.piece-card-header h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
}

.piece-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.piece-status.ok {
    background: rgba(63, 185, 80, 0.2);
    color: var(--accent-green);
}

.piece-status.attention {
    background: rgba(210, 153, 34, 0.2);
    color: var(--accent-orange);
}

.piece-status.probleme {
    background: rgba(248, 81, 73, 0.2);
    color: var(--accent-red);
}

.piece-card-body {
    padding: 20px;
}

.piece-score-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.piece-score {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.piece-score span {
    font-size: 14px;
    color: var(--text-muted);
}

.piece-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

.piece-comment {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
    padding: 12px;
    background: var(--bg-primary);
    border-radius: 8px;
    border-left: 3px solid var(--accent-blue);
}

/* Issues List */
.issues-section {
    margin-top: 16px;
}

.issues-section h5 {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.issue-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--bg-primary);
    border-radius: 8px;
    margin-bottom: 8px;
    border-left: 3px solid var(--border-color);
}

.issue-item.high {
    border-left-color: var(--accent-red);
}

.issue-item.medium {
    border-left-color: var(--accent-orange);
}

.issue-item.low {
    border-left-color: var(--accent-blue);
}

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

.issue-icon.high {
    background: rgba(248, 81, 73, 0.2);
    color: var(--accent-red);
}

.issue-icon.medium {
    background: rgba(210, 153, 34, 0.2);
    color: var(--accent-orange);
}

.issue-icon.low {
    background: rgba(88, 166, 255, 0.2);
    color: var(--accent-blue);
}

.issue-content {
    flex: 1;
}

.issue-desc {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.5;
}

.issue-meta {
    display: flex;
    gap: 12px;
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-muted);
}

.issue-category {
    padding: 2px 8px;
    background: var(--bg-hover);
    border-radius: 4px;
}

/* Recommendations */
.recommendations-section {
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: 12px;
}

.recommendations-section h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    color: var(--accent-green);
}

.recommendation-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.recommendation-number {
    width: 24px;
    height: 24px;
    background: var(--accent-green);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.recommendation-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}


/* === Image Compare Modal === */
.image-compare-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.image-modal-content {
    background: var(--bg-secondary);
    border-radius: 16px;
    max-width: 1400px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    z-index: 10;
}

.modal-header h3 {
    display: flex;
    align-items: center;
    gap: 12px;
}

.close-modal {
    background: var(--bg-hover);
    border: none;
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
}

.close-modal:hover {
    background: var(--accent-red);
    color: #fff;
}

/* Compare Grid */
.compare-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding: 24px;
}

.compare-column h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    font-size: 15px;
    color: var(--text-secondary);
}

.compare-column:first-child h4 {
    color: var(--accent-green);
}

.compare-column:last-child h4 {
    color: var(--accent-orange);
}

.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.gallery-item {
    position: relative;
    aspect-ratio: 4/3;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.gallery-item:hover {
    border-color: var(--accent-blue);
    transform: scale(1.02);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.img-number {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.no-images {
    color: var(--text-muted);
    font-style: italic;
    padding: 20px;
    text-align: center;
}

/* Slider Section */
.compare-slider-section {
    padding: 24px;
    border-top: 1px solid var(--border-color);
}

.compare-slider-section h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    color: var(--accent-blue);
}

.slider-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    justify-content: center;
}

.slider-controls select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
}

.slider-controls span {
    color: var(--text-muted);
    font-weight: 600;
}

.image-slider-container {
    display: flex;
    justify-content: center;
}

.slider-wrapper {
    position: relative;
    width: 100%;
    max-width: 800px;
    aspect-ratio: 4/3;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-primary);
}

.slider-img-back,
.slider-img-front {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.slider-img-front-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    overflow: hidden;
    border-right: 3px solid var(--accent-blue);
}

.slider-range {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: ew-resize;
    z-index: 10;
}

.slider-line {
    position: absolute;
    top: 0;
    left: 50%;
    width: 3px;
    height: 100%;
    background: var(--accent-blue);
    pointer-events: none;
    box-shadow: 0 0 10px rgba(88, 166, 255, 0.5);
}

.slider-line::before,
.slider-line::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 30px;
    background: var(--accent-blue);
    border-radius: 50%;
}

.slider-line::before {
    top: 10px;
}

.slider-line::after {
    bottom: 10px;
}

/* Fullscreen Image */
.fullscreen-image {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.fullscreen-image img {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
}

.close-fullscreen {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
}

.close-fullscreen:hover {
    background: var(--accent-red);
}

/* Button Compare */
.btn-compare {
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-compare:hover {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: #fff;
}

.piece-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}


/* View Toggle Button */
.btn-visual {
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 6px 14px;
    border-radius: 6px;
    cursor: not-allowed;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s;
    margin-left: 12px;
}

.btn-visual.disabled {
    opacity: 0.5;
}

.btn-visual:not(.disabled) {
    cursor: pointer;
    background: var(--accent-green);
    border-color: var(--accent-green);
    color: #fff;
    opacity: 1;
    animation: pulse-green 2s infinite;
}

.btn-visual:not(.disabled):hover {
    background: #2ea043;
    transform: scale(1.05);
}

@keyframes pulse-green {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(63, 185, 80, 0.4);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(63, 185, 80, 0);
    }
}

/* Back to JSON button */
.btn-back-json {
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-back-json:hover {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: #fff;
}

/* ═══════════════════════════════════════════════════════════════
   DOUBLE-PASS BADGE STYLES
   ═══════════════════════════════════════════════════════════════ */

.issue-item.double-pass {
    border-left: 3px solid #9b59b6;
    background: linear-gradient(90deg, rgba(155, 89, 182, 0.1) 0%, transparent 100%);
}

.double-pass-badge {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: #fff;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* ═══════════════════════════════════════════════════════════════
   TEST ÉTAPES STYLES
   ═══════════════════════════════════════════════════════════════ */

.etapes-tester {
    padding: 24px;
}

.etapes-form-container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.form-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.form-card h3 {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.form-field input {
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s;
}

.form-field input:focus {
    outline: none;
    border-color: var(--accent-blue);
    background: var(--bg-primary);
}

.form-field small {
    font-size: 12px;
    color: var(--text-muted);
}

.form-actions {
    margin-top: 24px;
}

.btn-large {
    width: 100%;
    padding: 14px;
    font-size: 15px;
    font-weight: 600;
}

.etapes-results {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
}

.etapes-results h3 {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.etapes-results h4 {
    font-size: 15px;
    margin-bottom: 12px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.results-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-box {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat-icon {
    font-size: 24px;
    color: var(--accent-blue);
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.issues-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.issues-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.issue-card-etape {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-left: 4px solid;
    border-radius: 8px;
    padding: 16px;
}

.issue-card-etape.severity-low {
    border-left-color: var(--accent-orange);
    background: linear-gradient(90deg, rgba(210, 153, 34, 0.1) 0%, transparent 100%);
}

.issue-card-etape.severity-medium {
    border-left-color: #f97316;
    background: linear-gradient(90deg, rgba(249, 115, 22, 0.1) 0%, transparent 100%);
}

.issue-card-etape.severity-high {
    border-left-color: var(--accent-red);
    background: linear-gradient(90deg, rgba(248, 81, 73, 0.1) 0%, transparent 100%);
}

.issue-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.issue-category-badge {
    display: inline-block;
    padding: 4px 10px;
    background: var(--bg-primary);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent-blue);
}

.issue-confidence-badge {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.issue-description-text {
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 14px;
}

.no-issues-message {
    text-align: center;
    padding: 40px;
    color: var(--accent-green);
}

.no-issues-message i {
    font-size: 48px;
    display: block;
    margin-bottom: 16px;
}

.no-issues-message .message-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.no-issues-message .message-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

.json-section {
    margin-top: 24px;
}

.spinner-large {
    width: 60px;
    height: 60px;
    margin: 0 auto 16px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Définition déplacée vers le haut du fichier (ligne 382) pour éviter les conflits */

.loading-overlay p {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 500;
}

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