/* Reconciliation Audit page styles */

/* main-container already has flex:1, max-width:800px, centering from styles.css */

.section-header h2 {
    color: rgb(206, 186, 76);
    font-size: 1.6rem;
    margin-bottom: 0.25rem;
}

.section-header .section-description {
    color: rgba(242, 242, 242, 0.7);
    font-size: 0.9rem;
}

/* Info box */
.rec-info-box {
    background: rgba(206, 186, 76, 0.08);
    border: 1px solid rgba(206, 186, 76, 0.25);
    border-radius: 8px;
    padding: 0.8rem 1.2rem;
    margin-bottom: 1.2rem;
    font-size: 0.85rem;
    color: rgba(242, 242, 242, 0.75);
    line-height: 1.5;
}

/* What the audit checks */
/* Collapsible sections */
.rec-collapsible {
    margin-bottom: 0.75rem;
    background: rgba(13, 40, 73, 0.3);
    border: 1px solid rgba(206, 186, 76, 0.15);
    border-radius: 8px;
    overflow: hidden;
}
.rec-collapsible summary {
    padding: 0.65rem 1rem;
    color: #CEBA4C;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.rec-collapsible summary::-webkit-details-marker { display: none; }
.rec-collapsible summary::after {
    content: '+';
    font-size: 1.1rem;
    color: rgba(206, 186, 76, 0.6);
    transition: transform 0.2s;
}
.rec-collapsible[open] summary::after {
    content: '\2212';
}
.rec-collapsible > div {
    padding: 0 1rem 0.75rem;
}
body.theme-gold .rec-collapsible {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(13, 40, 73, 0.25);
}
body.theme-gold .rec-collapsible summary {
    color: #CEBA4C;
    font-weight: 700;
}
body.theme-gold .rec-collapsible summary::after {
    color: #CEBA4C;
}
body.theme-gold .rec-collapsible li,
body.theme-gold .rec-collapsible p {
    color: rgba(255, 255, 255, 0.85);
}

.rec-checks-preview {
    margin-bottom: 0;
}
.rec-checks-preview h3 {
    color: #CEBA4C;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}
.rec-checks-preview ul {
    padding-left: 1.4rem;
    margin: 0;
}
.rec-checks-preview li {
    color: rgba(242, 242, 242, 0.7);
    font-size: 0.82rem;
    line-height: 1.6;
    margin-bottom: 0.2rem;
}

/* How this differs section */
.rec-difference {
    margin-bottom: 0;
}
.rec-difference h3 {
    color: #CEBA4C;
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
}
.rec-difference p, .rec-difference li {
    color: rgba(242, 242, 242, 0.6);
    font-size: 0.8rem;
    line-height: 1.55;
    margin-bottom: 0.3rem;
}
.rec-difference ul {
    padding-left: 1.4rem;
    margin: 0.3rem 0 0.4rem;
}

/* Dropzone */
.dropzone {
    border: 2px dashed rgba(206, 186, 76, 0.3);
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    margin-bottom: 1rem;
}
.dropzone:hover, .dropzone.dragover {
    border-color: rgba(206, 186, 76, 0.6);
    background: rgba(206, 186, 76, 0.04);
}

/* File display */
.file-display {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1rem;
    background: rgba(206, 186, 76, 0.08);
    border: 1px solid rgba(206, 186, 76, 0.2);
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: #CEBA4C;
}
.remove-file {
    background: none;
    border: none;
    color: rgba(242, 242, 242, 0.5);
    font-size: 1.2rem;
    cursor: pointer;
    margin-left: auto;
}

/* Score badge */
.rec-score-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 1.2rem 2rem;
    border-radius: 12px;
    margin: 1.5rem auto;
    max-width: 300px;
    text-align: center;
}
.rec-score-number {
    font-size: 2.5rem;
    font-weight: 700;
}
.rec-score-label {
    font-size: 1.2rem;
    color: rgba(242, 242, 242, 0.5);
}
.rec-score-status {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    margin-left: 0.5rem;
}

.rec-score-pass {
    background: rgba(34, 139, 34, 0.1);
    border: 2px solid rgba(34, 139, 34, 0.4);
}
.rec-score-pass .rec-score-number,
.rec-score-pass .rec-score-status { color: #228B22; }
.rec-score-pass .rec-score-status { background: rgba(34, 139, 34, 0.15); }

.rec-score-warn {
    background: rgba(204, 136, 0, 0.1);
    border: 2px solid rgba(204, 136, 0, 0.4);
}
.rec-score-warn .rec-score-number,
.rec-score-warn .rec-score-status { color: #CC8800; }
.rec-score-warn .rec-score-status { background: rgba(204, 136, 0, 0.15); }

.rec-score-fail {
    background: rgba(204, 0, 0, 0.1);
    border: 2px solid rgba(204, 0, 0, 0.4);
}
.rec-score-fail .rec-score-number,
.rec-score-fail .rec-score-status { color: #CC0000; }
.rec-score-fail .rec-score-status { background: rgba(204, 0, 0, 0.15); }

/* Summary */
.rec-summary {
    text-align: center;
    color: rgba(242, 242, 242, 0.7);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* What to do next — action list built from failed/warned checks */
.rec-action-items {
    background: rgba(206, 186, 76, 0.08);
    border: 1px solid rgba(206, 186, 76, 0.3);
    border-left: 4px solid #CEBA4C;
    border-radius: 6px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}
.rec-action-title {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    color: #CEBA4C;
    font-weight: 600;
}
.rec-action-list {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 0.9rem;
    line-height: 1.5;
    color: rgba(242, 242, 242, 0.92);
}
.rec-action-list li { margin-bottom: 0.4rem; }
.rec-action-list li:last-child { margin-bottom: 0; }
.rec-action-list strong { color: #fff; }

/* Technical-details toggle wrapping the raw checks table */
.rec-details-toggle {
    margin-bottom: 1.5rem;
}
.rec-details-toggle > summary {
    cursor: pointer;
    font-size: 0.85rem;
    color: rgba(242, 242, 242, 0.6);
    padding: 0.5rem 0;
    user-select: none;
}
.rec-details-toggle > summary:hover { color: #CEBA4C; }
.rec-details-toggle[open] > summary { margin-bottom: 0.5rem; }

/* Checks table */
.rec-checks-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    font-size: 0.82rem;
}
.rec-checks-table th {
    text-align: left;
    padding: 0.5rem 0.6rem;
    color: #CEBA4C;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(206, 186, 76, 0.3);
}
.rec-checks-table td {
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: rgba(242, 242, 242, 0.75);
}
.rec-check-pass { color: #228B22 !important; font-weight: 600; }
.rec-check-warn { color: #CC8800 !important; font-weight: 600; }
.rec-check-fail { color: #CC0000 !important; font-weight: 600; }

/* Gold theme — ensure readability on reconcile page */
body.theme-gold .rec-results {
    background: rgba(13, 40, 73, 0.95);
    border-radius: 10px;
    padding: 1rem;
}
body.theme-gold .rec-checks-table th {
    background: rgba(13, 40, 73, 0.8);
    color: #CEBA4C;
}
body.theme-gold .rec-checks-table td {
    background: rgba(13, 40, 73, 0.6);
    color: #f2f2f2;
}
body.theme-gold .rec-summary {
    color: #f2f2f2;
}
body.theme-gold .ai-diagnostics-section {
    background: rgba(13, 40, 73, 0.95);
    border-radius: 10px;
    padding: 1rem;
}
body.theme-gold .ai-finding-card {
    background: rgba(13, 40, 73, 0.8);
}
body.theme-gold .rec-download-btn {
    background: #CEBA4C;
    color: #0D2849;
}

/* Responsive table */
@media (max-width: 600px) {
    .main-container {
        padding: 0.75rem;
        width: 100%;
        box-sizing: border-box;
    }
    .rec-checks-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        font-size: 0.75rem;
    }
    .rec-checks-table th,
    .rec-checks-table td {
        padding: 0.3rem;
        word-break: break-word;
        max-width: 120px;
    }
    .rec-results {
        padding: 0.75rem;
        width: 100%;
        box-sizing: border-box;
    }
    .rec-score-badge {
        padding: 0.75rem;
    }
    .ai-finding-card {
        padding: 0.75rem;
    }
}

/* Download button */
.rec-download-btn {
    display: inline-block;
    padding: 0.6rem 1.5rem;
    background: #CEBA4C;
    color: #0D2849;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s;
}
.rec-download-btn:hover { background: #d8ca6a; }
.rec-download-note {
    font-size: 0.75rem;
    color: rgba(242, 242, 242, 0.4);
    margin-top: 0.4rem;
}

/* Pipeline explainer */
.rec-pipeline {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(206, 186, 76, 0.15);
}
.rec-pipeline h3 {
    color: #CEBA4C;
    font-size: 1rem;
    margin-bottom: 1rem;
    text-align: center;
}
.rec-pipeline-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.rec-pipeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.6rem 1rem;
    background: rgba(206, 186, 76, 0.06);
    border: 1px solid rgba(206, 186, 76, 0.2);
    border-radius: 8px;
    min-width: 70px;
}
.rec-step-active {
    border-color: rgba(206, 186, 76, 0.5);
    background: rgba(206, 186, 76, 0.12);
    box-shadow: 0 0 12px rgba(206, 186, 76, 0.1);
}
.rec-step-num {
    width: 1.6rem;
    height: 1.6rem;
    background: rgba(206, 186, 76, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.75rem;
    color: #CEBA4C;
}
.rec-step-label {
    font-size: 0.75rem;
    color: rgba(242, 242, 242, 0.7);
}
.rec-pipeline-arrow {
    color: rgba(206, 186, 76, 0.4);
    font-size: 1.2rem;
}
.rec-pipeline-note {
    text-align: center;
    font-size: 0.8rem;
    color: rgba(242, 242, 242, 0.5);
}

/* Error */
.error-section {
    padding: 1rem;
    background: rgba(204, 0, 0, 0.1);
    border: 1px solid rgba(204, 0, 0, 0.3);
    border-radius: 6px;
    color: #CC0000;
    margin-top: 1rem;
}

/* Loading overlay — force dark even in gold theme */
.loading-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(13, 40, 73, 0.92) !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    color: #f2f2f2 !important;
}
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(206, 186, 76, 0.2);
    border-top-color: #CEBA4C;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Progress bar */
.loading-progress-wrap {
    width: 280px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    overflow: hidden;
    margin: 1rem 0;
    height: 8px;
}
.loading-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #CEBA4C, #e6d472);
    border-radius: 20px;
    transition: width 0.5s ease;
}
.loading-percent {
    color: #CEBA4C;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.loading-estimate {
    color: rgba(242, 242, 242, 0.4);
    font-size: 0.75rem;
    margin-top: 0.75rem;
}

/* Loading steps */
.loading-steps {
    text-align: center;
}
.loading-step {
    color: rgba(242, 242, 242, 0.6);
    font-size: 0.9rem;
    margin: 0.4rem 0;
    transition: all 0.3s;
}
.loading-step.step-done {
    color: #28c76f;
}

/* AI Executive Summary Banner */
.ai-summary-banner {
    background: rgba(206, 186, 76, 0.08);
    border: 1px solid rgba(206, 186, 76, 0.3);
    border-left: 4px solid #CEBA4C;
    border-radius: 0 8px 8px 0;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    color: #f2f2f2;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* AI Diagnostics Section */
.ai-diagnostics-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(206, 186, 76, 0.2);
}
.ai-diagnostics-title {
    color: #CEBA4C;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}
.ai-diagnostics-subtitle {
    color: rgba(242, 242, 242, 0.5);
    font-size: 0.8rem;
    margin-bottom: 1rem;
}

/* AI Finding Cards */
.ai-finding-card {
    background: rgba(13, 40, 73, 0.6);
    border: 1px solid rgba(206, 186, 76, 0.15);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
}
.ai-finding-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    cursor: pointer;
    padding-bottom: 0.5rem;
}
.ai-finding-body {
    display: none;
}
.ai-finding-card.expanded .ai-finding-body {
    display: block;
}
.ai-finding-card.expanded .ai-finding-expand {
    transform: rotate(180deg);
}
.ai-finding-rootcause {
    flex: 1;
    color: rgba(242, 242, 242, 0.7);
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.ai-finding-expand {
    color: #CEBA4C;
    font-size: 0.7rem;
    transition: transform 0.2s;
    margin-left: auto;
}
.ai-finding-check {
    color: #f2f2f2;
    font-weight: 600;
    font-size: 0.9rem;
}
.ai-finding-severity {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.ai-severity-fail {
    background: #B71C1C;
    color: #fff;
}
.ai-severity-warn {
    background: #E65100;
    color: #fff;
}
.ai-finding-confidence {
    font-size: 0.75rem;
    margin-left: auto;
}
.ai-conf-high { color: #28c76f; }
.ai-conf-med { color: #CEBA4C; }
.ai-conf-low { color: #ff6b6b; }

.ai-finding-body {
    color: rgba(242, 242, 242, 0.85);
    font-size: 0.85rem;
    line-height: 1.55;
}
.ai-finding-section {
    margin-bottom: 0.75rem;
}
.ai-finding-section strong {
    color: #CEBA4C;
    font-size: 0.8rem;
    display: block;
    margin-bottom: 0.25rem;
}
.ai-finding-section p {
    margin: 0;
}
.ai-finding-fix {
    background: rgba(206, 186, 76, 0.06);
    border-left: 3px solid #CEBA4C;
    padding: 0.6rem 0.8rem;
    border-radius: 0 6px 6px 0;
}
.ai-tx-list {
    list-style: none;
    padding: 0;
    margin: 0.25rem 0;
}
.ai-tx-list li {
    padding: 0.3rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.82rem;
}
.ai-tx-list li:last-child {
    border-bottom: none;
}
.ai-tx-location {
    color: rgba(242, 242, 242, 0.4);
    font-size: 0.75rem;
}
