/* Chapter 23 Reports Styles */

/* Enable scrolling for this page */
body.reports-page {
    overflow-y: auto !important;
    overflow-x: hidden;
    height: auto;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #0f0f1a 100%);
}

body.reports-page #app {
    height: auto;
    min-height: 100vh;
}

:root {
    --report-primary: #4A90D9;
    --report-secondary: #7B68EE;
    --report-accent: #50C878;
    --report-warning: #FFB347;
    --report-danger: #FF6B6B;
    --report-dark: #1a1a2e;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    padding-top: 80px;
    background: linear-gradient(135deg, #1a1a2e 0%, #0f0f1a 100%);
    min-height: 100vh;
    color: var(--text-primary);
}

.header {
    text-align: center;
    padding: 20px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 25px;
}

.header h1 {
    font-size: 2rem;
    margin: 10px 0;
    background: linear-gradient(90deg, var(--report-primary), var(--report-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.back-btn {
    position: absolute;
    left: 20px;
    top: 20px;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(255,255,255,0.1);
}

/* Integration Banner */
.integration-banner {
    background: linear-gradient(135deg, rgba(74,144,217,0.2), rgba(123,104,238,0.2));
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.score-display {
    display: flex;
    align-items: center;
    gap: 20px;
}

.score-ring {
    position: relative;
    width: 100px;
    height: 100px;
}

.score-ring svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.ring-bg {
    fill: none;
    stroke: rgba(255,255,255,0.1);
    stroke-width: 8;
}

.ring-progress {
    fill: none;
    stroke: var(--report-accent);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 141;
    transition: stroke-dashoffset 0.5s ease;
}

.score-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.score-info {
    display: flex;
    flex-direction: column;
}

.score-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.system-status {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--report-accent);
    text-transform: uppercase;
}

.system-status.warning { color: var(--report-warning); }
.system-status.critical { color: var(--report-danger); }

.quick-stats {
    display: flex;
    gap: 25px;
}

.quick-stat {
    text-align: center;
}

.qs-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--report-primary);
}

.qs-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Report Navigation */
.report-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.report-tab {
    padding: 10px 18px;
    border: none;
    background: rgba(255,255,255,0.1);
    color: var(--text-secondary);
    border-radius: 20px;
    cursor: pointer;
    white-space: nowrap;
    font-size: 0.9rem;
}

.report-tab.active, .report-tab:hover {
    background: var(--report-primary);
    color: var(--text-primary);
}

/* Report Sections */
.report-section {
    display: none;
    background: rgba(255,255,255,0.03);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 20px;
}

.report-section.active {
    display: block;
}

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

.section-header h2 {
    font-size: 1.3rem;
}

.report-code {
    padding: 5px 12px;
    background: rgba(74,144,217,0.2);
    border-radius: 15px;
    font-size: 0.8rem;
    color: var(--report-primary);
}

/* Domain Reports */
.domains-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.domain-card {
    background: rgba(255,255,255,0.05);
    border-radius: 15px;
    padding: 20px;
    border-left: 3px solid var(--report-primary);
}

.domain-card.low { border-left-color: var(--report-accent); }
.domain-card.moderate { border-left-color: var(--report-primary); }
.domain-card.high { border-left-color: var(--report-warning); }
.domain-card.critical { border-left-color: var(--report-danger); }

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

.domain-name {
    font-weight: 600;
}

.domain-score {
    font-size: 1.2rem;
    font-weight: 700;
}

.domain-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.activation-badge {
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 0.75rem;
}

.activation-badge.low { background: rgba(80,200,120,0.2); color: var(--report-accent); }
.activation-badge.moderate { background: rgba(74,144,217,0.2); color: var(--report-primary); }
.activation-badge.high { background: rgba(255,179,71,0.2); color: var(--report-warning); }
.activation-badge.critical { background: rgba(255,107,107,0.2); color: var(--report-danger); }

/* Safety Report */
.safety-display {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 25px;
}

.ctc-indicator {
    text-align: center;
    padding: 25px;
    background: rgba(80,200,120,0.1);
    border-radius: 20px;
    min-width: 150px;
}

.ctc-indicator.level-1 { background: rgba(255,179,71,0.1); }
.ctc-indicator.level-2 { background: rgba(255,179,71,0.2); }
.ctc-indicator.level-3 { background: rgba(255,107,107,0.1); }
.ctc-indicator.level-4 { background: rgba(255,107,107,0.2); }
.ctc-indicator.level-5 { background: rgba(255,107,107,0.3); }

.ctc-level {
    font-size: 2rem;
    font-weight: 700;
}

.ctc-mode {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.safety-companion {
    text-align: center;
}

.safety-companion .label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.companion-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--report-secondary);
}

.safety-modes {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-bottom: 25px;
}

.mode-card {
    text-align: center;
    padding: 15px 10px;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    opacity: 0.5;
}

.mode-card.active {
    opacity: 1;
    background: rgba(74,144,217,0.2);
    border: 1px solid var(--report-primary);
}

.mode-level {
    display: block;
    font-weight: 700;
    font-size: 0.9rem;
}

.mode-name {
    display: block;
    font-size: 0.75rem;
    margin: 5px 0;
}

.mode-desc {
    font-size: 0.65rem;
    color: var(--text-muted);
}

/* Twin Evolution */
.twin-evolution {
    text-align: center;
}

.tei-display {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 30px;
}

.tei-score {
    background: linear-gradient(135deg, var(--report-primary), var(--report-secondary));
    padding: 25px 35px;
    border-radius: 20px;
}

.tei-value {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
}

.tei-label {
    font-size: 0.8rem;
    opacity: 0.8;
}

.stage-display {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stage-number {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--report-secondary);
}

.stage-name {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.vectors-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.vector-card {
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 15px;
    text-align: left;
}

.vector-name {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 10px;
}

.vector-bar {
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 5px;
}

.vector-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--report-primary), var(--report-secondary));
    border-radius: 4px;
    transition: width 0.5s ease;
}

.vector-value {
    font-size: 0.9rem;
    font-weight: 600;
}

.stage-progression {
    margin-top: 20px;
}

.stages-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    padding: 0 20px;
    margin-bottom: 10px;
}

.stages-line::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 3px;
    background: rgba(255,255,255,0.1);
    z-index: 0;
}

.stage-dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    z-index: 1;
    position: relative;
}

.stage-dot.active {
    background: var(--report-secondary);
}

.stage-dot.completed {
    background: var(--report-accent);
}

.stage-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Ritual Report */
.ritual-summary {
    text-align: center;
}

.ritual-stat.large {
    margin-bottom: 20px;
}

.ritual-stat.large .ritual-value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--report-primary);
}

.ritual-stat.large .ritual-label {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.completion-bar {
    height: 12px;
    background: rgba(255,255,255,0.1);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 25px;
}

.completion-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--report-primary), var(--report-accent));
    border-radius: 6px;
    transition: width 0.5s ease;
}

.ritual-stats-row {
    display: flex;
    justify-content: space-around;
}

.ritual-stat .rs-value {
    display: block;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--report-secondary);
}

.ritual-stat .rs-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Synergy Report */
.triads-display {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.triad-card {
    background: rgba(255,255,255,0.05);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
}

.triad-card.emotional { border-top: 3px solid #FF6B6B; }
.triad-card.cognitive { border-top: 3px solid #4A90D9; }
.triad-card.relational { border-top: 3px solid #50C878; }

.triad-card h4 {
    margin-bottom: 10px;
    font-size: 1rem;
}

.triad-domains {
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.triad-status {
    padding: 4px 12px;
    border-radius: 10px;
    font-size: 0.8rem;
    background: rgba(80,200,120,0.2);
    color: var(--report-accent);
}

/* Memory Report */
.memory-display {
    text-align: center;
}

.memory-stat {
    margin-bottom: 25px;
}

.mem-value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--report-secondary);
}

.mem-label {
    display: block;
    font-size: 1rem;
    color: var(--text-secondary);
}

.motifs-cloud {
    margin-bottom: 25px;
}

.motifs-cloud h3 {
    margin-bottom: 15px;
    font-size: 1rem;
}

.motifs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.motif-tag {
    padding: 8px 16px;
    background: rgba(123,104,238,0.2);
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--report-secondary);
}

.memory-metrics {
    display: flex;
    justify-content: center;
    gap: 40px;
}

.mm-item {
    text-align: center;
}

.mm-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.mm-value {
    font-size: 1.3rem;
    font-weight: 600;
}

/* Recommendations */
.recommendations-section {
    background: rgba(255,255,255,0.03);
    border-radius: 20px;
    padding: 25px;
}

.recommendations-section h3 {
    margin-bottom: 15px;
}

.recommendations-list {
    list-style: none;
    padding: 0;
}

.recommendations-list li {
    padding: 12px 15px;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    margin-bottom: 10px;
    border-left: 3px solid var(--report-warning);
}

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

@media (max-width: 768px) {
    .integration-banner {
        flex-direction: column;
    }
    .quick-stats {
        flex-wrap: wrap;
        justify-content: center;
    }
    .safety-modes {
        grid-template-columns: repeat(3, 1fr);
    }
    .triads-display {
        grid-template-columns: 1fr;
    }
    .vectors-grid {
        grid-template-columns: 1fr;
    }
}
