/**
 * Phase 1 UI Styles
 * 4-Layer Reliability Architecture Visualization
 */

/* ===== Result Header ===== */
.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* ===== Determinism Badge ===== */
.determinism-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 14px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: help;
    transition: all 0.3s ease;
}

.determinism-badge .badge-icon {
    font-size: 1rem;
}

/* Color-coded by determinism score */
.determinism-badge.high { /* 90-100% */
    background: #e8f5e9;
    color: #2e7d32;
    border: 1.5px solid #4caf50;
}

.determinism-badge.medium-high { /* 70-89% */
    background: #fff3e0;
    color: #e65100;
    border: 1.5px solid #ff9800;
}

.determinism-badge.medium { /* 50-69% */
    background: #fff9c4;
    color: #f57f17;
    border: 1.5px solid #fdd835;
}

.determinism-badge.low { /* 0-49% */
    background: #e3f2fd;
    color: #1565c0;
    border: 1.5px solid #2196f3;
}

.determinism-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* ===== Confidence Breakdown ===== */
.confidence-breakdown {
    margin: 16px 0 24px 0;
}

.confidence-label {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 12px;
}

.confidence-bar {
    display: flex;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    margin-bottom: 12px;
}

.confidence-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s ease;
}

.confidence-segment.deterministic {
    background: linear-gradient(135deg, #4caf50, #66bb6a);
    color: white;
}

.confidence-segment.semantic {
    background: linear-gradient(135deg, #2196f3, #42a5f5);
    color: white;
}

.confidence-segment:hover {
    opacity: 0.9;
    transform: scaleY(1.05);
}

.segment-label {
    font-size: 0.9rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.confidence-details {
    display: flex;
    justify-content: space-around;
    gap: 16px;
    font-size: 0.9rem;
    color: #666;
}

.detail-item {
    flex: 1;
    text-align: center;
    padding: 6px;
    background: #f5f5f5;
    border-radius: 6px;
}

/* ===== Verification Layers ===== */
.verification-layers {
    margin: 24px 0;
    padding: 16px;
    background: #fafafa;
    border-radius: 8px;
}

.layers-title {
    margin: 0 0 16px 0;
    font-size: 1.2rem;
    color: #333;
}

.layer-card {
    margin-bottom: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    transition: all 0.3s ease;
}

.layer-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.layer-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #f5f5f5;
    cursor: pointer;
    user-select: none;
    transition: background 0.3s ease;
}

.layer-header:hover {
    background: #eeeeee;
}

.layer-status {
    margin-right: 12px;
    font-size: 1.2rem;
    min-width: 24px;
}

.layer-status:contains('✓') {
    color: #4caf50;
}

.layer-status:contains('⚠') {
    color: #ff9800;
}

.layer-status:contains('○') {
    color: #9e9e9e;
}

.layer-title {
    flex: 1;
    font-weight: 600;
    color: #333;
}

.layer-toggle {
    font-size: 0.8rem;
    color: #666;
    transition: transform 0.3s ease;
}

.layer-card.expanded .layer-toggle {
    transform: rotate(180deg);
}

.layer-content {
    padding: 16px;
    background: white;
}

.layer-stats {
    list-style: none;
    padding: 0;
    margin: 0;
}

.layer-stats li {
    padding: 6px 0;
    color: #555;
    font-size: 0.95rem;
}

.layer-stats strong {
    color: #333;
    font-weight: 600;
}

.layer-empty {
    color: #999;
    font-style: italic;
    margin: 8px 0;
}

/* ===== Proofs List (Week 3) ===== */
.proofs-list {
    margin: 16px 0 0 0;
}

.proof-item {
    background: #f9f9f9;
    border-left: 4px solid #ccc;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.proof-item.proof-pass {
    border-left-color: #4caf50;
}

.proof-item.proof-fail {
    border-left-color: #f44336;
}

.proof-item:hover {
    background: #f0f0f0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.proof-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.proof-status {
    margin-right: 8px;
    font-weight: bold;
    font-size: 1.1rem;
}

.proof-item.proof-pass .proof-status {
    color: #4caf50;
}

.proof-item.proof-fail .proof-status {
    color: #f44336;
}

.proof-rule {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.proof-detail {
    margin-top: 8px;
}

.proof-detail code {
    display: block;
    background: white;
    padding: 10px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: #333;
    white-space: pre-wrap;
    word-wrap: break-word;
    border: 1px solid #e0e0e0;
}

.more-proofs {
    margin-top: 12px;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    font-style: italic;
}

/* ===== Model Votes (Week 4) ===== */
.model-votes {
    margin: 12px 0 0 0;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 6px;
}

.model-votes p {
    margin: 6px 0;
    font-size: 0.9rem;
}

.models-agree {
    color: #2e7d32;
}

.models-disagree {
    color: #c62828;
}

.model-votes strong {
    font-weight: 600;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .determinism-badge {
        font-size: 0.75rem;
        padding: 4px 10px;
    }

    .confidence-bar {
        height: 36px;
    }

    .segment-label {
        font-size: 0.8rem;
    }

    .confidence-details {
        flex-direction: column;
        gap: 8px;
    }

    .layer-header {
        padding: 10px 12px;
    }

    .layer-title {
        font-size: 0.9rem;
    }

    .proof-detail code {
        font-size: 0.75rem;
    }
}

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

.layer-content {
    animation: fadeIn 0.3s ease-out;
}

/* ===== Print Styles ===== */
@media print {
    .layer-header {
        cursor: default;
    }

    .layer-content {
        display: block !important;
    }

    .layer-toggle {
        display: none;
    }

    .determinism-badge,
    .confidence-segment {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
}
