/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--forge-void);
    border: 1px solid var(--forge-basalt);
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--forge-basalt);
}

.modal-header h2 {
    margin: 0 0 8px 0;
    color: #FFFFFF;
    font-family: 'Inter Tight', sans-serif;
    font-size: 24px;
    font-weight: 700;
}

.modal-header p {
    margin: 0;
    color: var(--forge-ash);
    font-size: 14px;
    line-height: 1.5;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--forge-basalt);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Temper List */
.temper-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.temper-option {
    background: var(--forge-charcoal);
    border: 2px solid var(--forge-basalt);
    border-radius: 6px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.temper-option:hover {
    border-color: var(--forge-ash);
    background: rgba(138, 138, 146, 0.05);
}

.temper-option.selected {
    border-color: var(--forge-ember);
    background: rgba(255, 77, 0, 0.08);
    box-shadow: var(--forge-glow-ember);
}

.temper-option-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.temper-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid var(--forge-silver);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.temper-option.selected .temper-checkbox {
    background: var(--forge-ember);
    border-color: var(--forge-ember);
}

.temper-checkbox::after {
    content: '✓';
    color: var(--forge-void);
    font-size: 14px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.temper-option.selected .temper-checkbox::after {
    opacity: 1;
}

.temper-name {
    color: var(--forge-gold);
    font-weight: 600;
    font-size: 16px;
    flex: 1;
}

.temper-description {
    color: var(--forge-cool-smoke);
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

/* Modal Buttons */
.btn-primary,
.btn-secondary {
    padding: 10px 24px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-family: 'Inter', sans-serif;
}

.btn-primary {
    background: linear-gradient(180deg, #FF8C00 0%, #FF6200 100%);
    color: #000000;
    font-weight: 700;
    border-radius: 12px;
}

.btn-primary:hover {
    background: linear-gradient(180deg, #FFA033 0%, #FF7A1A 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(255, 122, 0, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--forge-ash);
    border: 1px solid transparent;
}

.btn-secondary:hover {
    color: #FFFFFF;
    background: rgba(138, 138, 146, 0.1);
}

/* Session Tempers Display */
.session-tempers {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.temper-info {
    color: var(--forge-silver);
    font-size: 13px;
    font-style: italic;
    padding: 8px;
}

.temper-badge {
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid var(--forge-gold);
    border-radius: 4px;
    padding: 8px 12px;
    color: var(--forge-gold);
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.temper-badge::before {
    content: '⚡';
    font-size: 14px;
}

.no-tempers {
    color: var(--forge-silver);
    font-size: 13px;
    font-style: italic;
    padding: 8px;
    text-align: center;
}

/* Large Modal (for Reports) */
.modal-large {
    max-width: 900px;
    max-height: 90vh;
}

/* Report Content Styles */
.report-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.report-empty {
    text-align: center;
    padding: 40px;
    color: var(--forge-silver);
}

.report-empty p {
    margin: 8px 0;
}

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

.report-timestamp {
    color: var(--forge-silver);
    font-size: 13px;
}

.report-overall {
    display: flex;
    gap: 16px;
    align-items: center;
}

.overall-decision {
    padding: 6px 12px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
}

.overall-decision.pass {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
}

.overall-decision.flag {
    background: rgba(255, 193, 7, 0.2);
    color: #FFC107;
}

.overall-decision.block {
    background: rgba(244, 67, 54, 0.2);
    color: #F44336;
}

.overall-confidence {
    color: var(--forge-gold);
    font-weight: 600;
}

.report-response {
    background: var(--forge-charcoal);
    border-radius: 6px;
    padding: 16px;
}

.report-response h4 {
    margin: 0 0 12px 0;
    color: var(--forge-gold);
    font-size: 14px;
    font-weight: 600;
}

.response-content {
    color: var(--forge-silver);
    font-size: 14px;
    line-height: 1.6;
    max-height: 200px;
    overflow-y: auto;
}

.report-gates h4 {
    margin: 0 0 16px 0;
    color: var(--forge-gold);
    font-size: 14px;
    font-weight: 600;
}

.report-gate {
    background: var(--forge-charcoal);
    border: 1px solid var(--forge-basalt);
    border-radius: 6px;
    margin-bottom: 12px;
    overflow: hidden;
}

.report-gate-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.2);
}

.report-gate-header .gate-name {
    font-weight: 700;
    color: var(--forge-gold);
    min-width: 80px;
}

.report-gate-header .gate-decision {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.report-gate-header .gate-decision.pass {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
}

.report-gate-header .gate-decision.flag {
    background: rgba(255, 193, 7, 0.2);
    color: #FFC107;
}

.report-gate-header .gate-decision.block {
    background: rgba(244, 67, 54, 0.2);
    color: #F44336;
}

.report-gate-header .gate-quality,
.report-gate-header .gate-confidence {
    color: var(--forge-silver);
    font-size: 13px;
}

.report-gate-summary {
    padding: 12px 16px;
    color: var(--forge-silver);
    font-size: 13px;
    line-height: 1.5;
    border-top: 1px solid var(--forge-basalt);
}

.summary-toggle {
    color: var(--forge-ember, #e8912d);
    font-size: 12px;
    cursor: pointer;
    text-decoration: none;
    margin-left: 4px;
}

.summary-toggle:hover {
    text-decoration: underline;
}

.report-factors {
    padding: 12px 16px;
    border-top: 1px solid var(--forge-basalt);
}

.report-factors h5 {
    margin: 0 0 8px 0;
    color: var(--forge-silver);
    font-size: 12px;
    font-weight: 600;
}

.report-factor {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
    font-size: 12px;
}

.report-factor.positive .factor-weight {
    color: #4CAF50;
}

.report-factor.negative .factor-weight {
    color: #F44336;
}

.report-factor .factor-name {
    color: var(--forge-silver);
    flex: 1;
}

.report-factor .factor-patterns {
    color: var(--forge-silver);
    opacity: 0.7;
}

/* Modal Sections */
.modal-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--forge-basalt);
}

.modal-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.modal-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px 0;
    color: var(--forge-ash);
    font-family: 'Inter Tight', sans-serif;
    font-size: 16px;
    font-weight: 600;
}

.modal-section-title svg {
    stroke: var(--forge-ash);
}

.modal-section-desc {
    margin: 0 0 16px 0;
    color: var(--forge-cool-smoke);
    font-size: 13px;
    line-height: 1.5;
}

/* Project Selector */
.project-select {
    width: 100%;
    padding: 12px 16px;
    background: var(--forge-charcoal);
    border: 2px solid var(--forge-basalt);
    border-radius: 6px;
    color: var(--forge-silver);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8a8a' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.project-select:hover {
    border-color: var(--forge-ash);
}

.project-select:focus {
    outline: none;
    border-color: var(--forge-ember);
    box-shadow: 0 0 0 2px rgba(255, 77, 0, 0.2);
}

.project-select option {
    background: var(--forge-void);
    color: var(--forge-silver);
    padding: 12px;
}

/* Project Info Box */
.project-info {
    margin-top: 12px;
    padding: 12px 16px;
    background: rgba(255, 77, 0, 0.05);
    border: 1px solid rgba(255, 77, 0, 0.2);
    border-radius: 6px;
}

.project-info-name {
    color: var(--forge-gold);
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.project-info-desc {
    color: var(--forge-cool-smoke);
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 8px;
}

.project-info-stats {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.project-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--forge-silver);
}

.project-stat-value {
    color: var(--forge-gold);
    font-weight: 600;
}

/* Session Project Badge */
.session-project-badge {
    background: rgba(76, 175, 255, 0.1);
    border: 1px solid rgba(76, 175, 255, 0.3);
    border-radius: 4px;
    padding: 8px 12px;
    color: #4CAFFF;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.session-project-badge::before {
    content: '☁';
    font-size: 14px;
}
