/**
 * BRI Studio Blocks - Frontend Styles
 */

/* =========================================================================
   FORMULA BLOCK
   ========================================================================= */
.bri-formula-block {
    background: linear-gradient(135deg, #1a1f2e 0%, #252b3d 100%);
    border: 1px solid #3d4663;
    border-radius: 8px;
    padding: 20px;
    color: #e0e6ed;
    margin: 16px 0;
}

.bri-formula-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.bri-formula-icon {
    font-size: 28px;
}

.bri-formula-name {
    font-size: 20px;
    color: #fff;
}

.bri-formula-expression {
    background: #0d1117;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 12px;
}

.bri-formula-expression code {
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    color: #7ee787;
    font-size: 18px;
    letter-spacing: 0.5px;
}

.bri-formula-description {
    color: #8b949e;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.bri-formula-io {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.bri-formula-inputs,
.bri-formula-outputs {
    background: rgba(255,255,255,0.03);
    border-radius: 6px;
    padding: 12px;
}

.bri-formula-inputs strong,
.bri-formula-outputs strong {
    color: #8b949e;
    font-size: 11px;
    text-transform: uppercase;
    margin-right: 8px;
}

.bri-io-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 13px;
    margin: 2px;
}

.bri-io-tag.bri-input {
    background: #1e3a5f;
    color: #58a6ff;
}

.bri-io-tag.bri-output {
    background: #1a4731;
    color: #3fb950;
}

/* =========================================================================
   LIBRARY REFERENCE BLOCK
   ========================================================================= */
.bri-library-reference {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s, transform 0.2s;
}

.bri-library-reference:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.bri-library-reference.bri-empty,
.bri-library-reference.bri-error {
    background: #f8f9fa;
    color: #6c757d;
    text-align: center;
    padding: 24px;
}

.bri-library-reference.bri-error {
    border-color: #e53e3e;
    color: #c53030;
}

.bri-library-reference-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bri-library-icon {
    font-size: 32px;
}

.bri-library-title-wrap {
    flex: 1;
}

.bri-library-title-wrap strong {
    display: block;
    font-size: 16px;
    color: #1a202c;
}

.bri-library-category {
    background: #e2e8f0;
    color: #4a5568;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    text-transform: uppercase;
}

.bri-library-reference-excerpt {
    color: #718096;
    margin-top: 10px;
    font-size: 14px;
    line-height: 1.5;
}

.bri-library-reference-actions {
    margin-top: 16px;
    display: flex;
    gap: 8px;
}

.bri-library-reference-actions .button {
    padding: 6px 16px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
}

/* =========================================================================
   MODEL STAGE BLOCK
   ========================================================================= */
.bri-model-stage {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    border-left: 4px solid #4299e1;
    border-radius: 0 8px 8px 0;
    padding: 20px;
    color: #e2e8f0;
    margin: 12px 0;
}

.bri-model-stage-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.bri-stage-number {
    width: 36px;
    height: 36px;
    background: #4299e1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    color: #fff;
}

.bri-stage-name {
    font-size: 18px;
    color: #fff;
}

.bri-stage-duration {
    margin-left: auto;
    color: #a0aec0;
    font-size: 13px;
}

.bri-model-stage-params {
    background: rgba(0,0,0,0.2);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 12px;
}

.bri-param {
    display: flex;
    gap: 8px;
    margin-bottom: 4px;
}

.bri-param-key {
    color: #a0aec0;
}

.bri-param-value {
    color: #fff;
    font-weight: 500;
}

.bri-model-stage-indicators {
    color: #a0aec0;
}

.bri-model-stage-indicators ul {
    margin: 8px 0 0 20px;
    padding: 0;
}

.bri-model-stage-indicators li {
    margin-bottom: 4px;
}

.bri-model-stage-content {
    margin-top: 16px;
}

/* =========================================================================
   RESEARCH PHASE BLOCK
   ========================================================================= */
.bri-research-phase {
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    margin: 20px 0;
}

.bri-research-phase-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.bri-phase-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.bri-phase-status {
    background: rgba(255,255,255,0.2);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 500;
}

.bri-research-phase-content {
    padding: 24px;
}

.bri-research-phase[data-status="completed"] .bri-research-phase-header {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

.bri-research-phase[data-status="in_progress"] .bri-research-phase-header {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
}

.bri-research-phase[data-status="blocked"] .bri-research-phase-header {
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
}

/* =========================================================================
   FINDING BLOCK
   ========================================================================= */
.bri-finding-block {
    border-left: 4px solid #f59e0b;
    border-radius: 0 8px 8px 0;
    padding: 20px;
    margin: 16px 0;
    background: #fffbeb;
}

.bri-finding-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.bri-finding-icon {
    font-size: 28px;
}

.bri-finding-title {
    font-size: 18px;
    color: #1a202c;
    flex: 1;
}

.bri-finding-confidence {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 600;
}

.bri-confidence-low {
    background: #fee2e2;
    color: #991b1b;
}

.bri-confidence-medium {
    background: #fef3c7;
    color: #92400e;
}

.bri-confidence-high {
    background: #d1fae5;
    color: #065f46;
}

.bri-finding-content {
    color: #4a5568;
    line-height: 1.6;
}

.bri-finding-block[data-type="measurement"] {
    background: #eff6ff;
    border-color: #3b82f6;
}

.bri-finding-block[data-type="conclusion"] {
    background: #f0fdf4;
    border-color: #22c55e;
}

.bri-finding-block[data-type="hypothesis"] {
    background: #faf5ff;
    border-color: #a855f7;
}

/* =========================================================================
   PARAMETERS BLOCK
   ========================================================================= */
.bri-parameters-block {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
}

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

.bri-parameters-header .bri-icon {
    font-size: 20px;
}

.bri-parameters-table {
    width: 100%;
    border-collapse: collapse;
}

.bri-parameters-table th,
.bri-parameters-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.bri-parameters-table th {
    background: #f1f5f9;
    font-size: 11px;
    text-transform: uppercase;
    color: #64748b;
}

.bri-parameters-table code {
    background: #e2e8f0;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 13px;
}

/* =========================================================================
   SOURCES BLOCK
   ========================================================================= */
.bri-sources-block {
    background: #fefce8;
    border: 1px solid #fde047;
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
}

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

.bri-sources-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.bri-sources-list li {
    padding: 8px 0;
    border-bottom: 1px solid #fef08a;
}

.bri-sources-list li:last-child {
    border-bottom: none;
}

.bri-sources-list a {
    color: #b45309;
    text-decoration: none;
}

.bri-sources-list a:hover {
    text-decoration: underline;
}

.bri-source-author {
    color: #92400e;
    margin-left: 4px;
}

/* =========================================================================
   DATA INPUT BLOCK
   ========================================================================= */
.bri-data-input-block {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 20px;
    color: #e2e8f0;
    margin: 16px 0;
}

.bri-data-input-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.bri-data-icon {
    font-size: 32px;
}

.bri-data-input-config {
    background: rgba(0,0,0,0.3);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 16px;
}

.bri-data-input-empty {
    color: #64748b;
    font-style: italic;
}

.bri-data-input-actions {
    display: flex;
    gap: 8px;
}

.bri-data-input-actions .button {
    background: #3b82f6;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.bri-data-input-actions .button:hover {
    background: #2563eb;
}

.bri-data-input-actions .bri-preview-data {
    background: #475569;
}

.bri-data-input-actions .bri-preview-data:hover {
    background: #64748b;
}
