/**
 * TheraNotes Golden Thread & Briefing Styles
 * CSS for briefing and golden thread visualization
 * 
 * File: assets/css/theranotes-golden-thread.css
 */

/* ==================== Briefing Styles ==================== */

.tnp-briefing {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 24px;
    margin: 20px 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tnp-briefing-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.tnp-briefing-section:last-of-type {
    border-bottom: none;
    margin-bottom: 12px;
}

.tnp-briefing-section h3 {
    color: #2d3748;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 12px 0;
    padding: 0;
}

.tnp-briefing-section p {
    color: #4a5568;
    line-height: 1.6;
    margin: 0;
}

.tnp-key-points,
.tnp-themes,
.tnp-goals,
.tnp-suggestions {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tnp-key-points li,
.tnp-themes li,
.tnp-goals li,
.tnp-suggestions li {
    padding: 8px 12px;
    margin: 6px 0;
    background: #f7fafc;
    border-left: 3px solid #4299e1;
    border-radius: 4px;
    color: #2d3748;
}

.tnp-risk-factors {
    background: #fff5f5;
    border-left: 4px solid #fc8181;
    padding: 16px;
    border-radius: 4px;
}

.tnp-risk-factors h3 {
    color: #c53030;
}

.tnp-risk-factors ul {
    list-style: none;
    padding: 0;
    margin: 8px 0 0 0;
}

.tnp-risk-factors li {
    padding: 8px 12px;
    margin: 6px 0;
    background: #ffffff;
    border-left: 3px solid #fc8181;
    border-radius: 4px;
    color: #742a2a;
}

.tnp-briefing-meta {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
    color: #718096;
    font-size: 12px;
}

/* ==================== Golden Thread Styles ==================== */

.tnp-golden-thread {
    background: #ffffff;
    border: 2px solid #805ad5;
    border-radius: 8px;
    padding: 24px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(128, 90, 213, 0.1);
}

.tnp-gt-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9d8fd;
}

.tnp-gt-section:last-of-type {
    border-bottom: none;
    margin-bottom: 12px;
}

.tnp-gt-section h3 {
    color: #6b46c1;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 12px 0;
    padding: 0;
}

.tnp-gt-summary {
    color: #4a5568;
    line-height: 1.7;
    font-size: 16px;
    padding: 16px;
    background: #faf5ff;
    border-radius: 6px;
    border-left: 4px solid #805ad5;
}

.tnp-gt-themes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
    margin-top: 12px;
}

.tnp-theme-card {
    background: #faf5ff;
    border: 1px solid #e9d8fd;
    border-radius: 6px;
    padding: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.tnp-theme-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(128, 90, 213, 0.15);
}

.tnp-theme-card h4 {
    color: #6b46c1;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.tnp-frequency {
    display: inline-block;
    background: #805ad5;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.tnp-theme-card p {
    color: #553c9a;
    font-size: 14px;
    line-height: 1.5;
    margin: 8px 0 0 0;
}

.tnp-patterns {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tnp-patterns li {
    padding: 12px 16px;
    margin: 8px 0;
    background: #faf5ff;
    border-left: 3px solid #805ad5;
    border-radius: 4px;
    color: #4a5568;
}

.tnp-patterns li strong {
    color: #6b46c1;
    display: block;
    margin-bottom: 4px;
}

.tnp-gt-meta {
    margin-top: 20px;
    padding: 16px;
    background: #faf5ff;
    border-radius: 6px;
}

.tnp-confidence {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.tnp-confidence-bar {
    flex: 1;
    height: 24px;
    background: #e9d8fd;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.tnp-confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, #9f7aea, #805ad5);
    transition: width 0.5s ease;
    border-radius: 12px;
}

.tnp-confidence span {
    color: #553c9a;
    font-weight: 600;
    font-size: 14px;
}

.tnp-gt-meta p {
    color: #718096;
    font-size: 12px;
    margin: 4px 0;
}

/* ==================== Loading & Error States ==================== */

.tnp-loading {
    text-align: center;
    padding: 40px 20px;
    color: #718096;
    font-style: italic;
}

.tnp-loading::before {
    content: "⏳ ";
    font-size: 24px;
    display: block;
    margin-bottom: 8px;
}

.tnp-error {
    background: #fff5f5;
    border: 1px solid #feb2b2;
    border-radius: 6px;
    padding: 16px;
    color: #c53030;
    margin: 20px 0;
}

.tnp-error::before {
    content: "⚠️ ";
    font-weight: bold;
}

.tnp-notice {
    background: #ebf8ff;
    border: 1px solid #90cdf4;
    border-radius: 6px;
    padding: 16px;
    color: #2c5282;
    margin: 20px 0;
}

.tnp-notice::before {
    content: "ℹ️ ";
    font-weight: bold;
}

/* ==================== Buttons ==================== */

.tnp-button-primary {
    background: #805ad5;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.tnp-button-primary:hover {
    background: #6b46c1;
    transform: translateY(-1px);
}

.tnp-button-primary:active {
    transform: translateY(0);
}

.tnp-button-primary:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    transform: none;
}

.tnp-button-secondary {
    background: #4299e1;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.tnp-button-secondary:hover {
    background: #3182ce;
}

.tnp-button-secondary:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
}

/* ==================== Control Panel ==================== */

.tnp-controls {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    margin: 20px 0;
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.tnp-controls label {
    font-weight: 600;
    color: #2d3748;
    margin-right: 8px;
}

.tnp-controls select {
    padding: 8px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    background: white;
    font-size: 14px;
}

/* ==================== Responsive Design ==================== */

@media (max-width: 768px) {
    .tnp-briefing,
    .tnp-golden-thread {
        padding: 16px;
        margin: 16px 0;
    }

    .tnp-gt-themes {
        grid-template-columns: 1fr;
    }

    .tnp-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .tnp-button-primary,
    .tnp-button-secondary {
        width: 100%;
    }
}

/* ==================== Print Styles ==================== */

@media print {
    .tnp-controls,
    .tnp-button-primary,
    .tnp-button-secondary {
        display: none;
    }

    .tnp-briefing,
    .tnp-golden-thread {
        box-shadow: none;
        border: 1px solid #000;
        page-break-inside: avoid;
    }
}

/* ==================== Animations ==================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tnp-briefing,
.tnp-golden-thread {
    animation: fadeIn 0.3s ease-out;
}

/* ==================== Dark Mode Support (Optional) ==================== */

@media (prefers-color-scheme: dark) {
    .tnp-briefing,
    .tnp-golden-thread {
        background: #1a202c;
        border-color: #2d3748;
    }

    .tnp-briefing-section h3,
    .tnp-gt-section h3 {
        color: #e2e8f0;
    }

    .tnp-briefing-section p,
    .tnp-key-points li,
    .tnp-themes li,
    .tnp-goals li,
    .tnp-suggestions li {
        color: #cbd5e0;
        background: #2d3748;
    }

    .tnp-gt-summary {
        background: #2d3748;
        color: #e2e8f0;
    }

    .tnp-theme-card {
        background: #2d3748;
        border-color: #4a5568;
    }
}
