/* ============================================
   CODE BLOCK ENHANCER STYLES
   Renovasia Documentation - Enhanced Code Blocks
   ============================================ */

/* ----------------------------------------
   BASE STYLES
   ---------------------------------------- */
.document-content pre {
    position: relative;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Fira Code', 'Consolas', monospace;
    transition: all 0.3s ease;
}

.document-content pre code {
    background: none;
    padding: 0;
    font-size: inherit;
    color: inherit;
}

/* ----------------------------------------
   1. ACTUAL CODE - Dark Theme (default)
   ---------------------------------------- */
.document-content pre.code-block {
    background: #1e1e2e;
    color: #cdd6f4;
    border: 1px solid #313244;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.document-content pre.code-block code {
    color: #cdd6f4;
    line-height: 1.6;
}

/* ----------------------------------------
   2. ASCII ART / DIAGRAM - Light Card Theme
   ---------------------------------------- */
.document-content pre.ascii-art {
    background: #f8f9fa;
    color: #2d3436;
    border: 1px solid #e9ecef;
    font-size: 13px;
    line-height: 1.5;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.document-content pre.ascii-art code {
    color: #2d3436;
}

/* ----------------------------------------
   3. ASCII TABLE - Special Styling
   ---------------------------------------- */
.document-content pre.ascii-table {
    background: #ffffff;
    color: #2d3436;
    border: 2px solid #dee2e6;
    font-size: 12px;
    line-height: 1.4;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.document-content pre.ascii-table code {
    color: #2d3436;
}

/* ----------------------------------------
   CONVERTED TABLE WRAPPER
   ---------------------------------------- */
.converted-table-wrapper {
    margin: 20px 0;
}

/* ----------------------------------------
   4. INFO BOX / CALLOUT - Gradient Theme
   ---------------------------------------- */
.document-content pre.info-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border: none;
    font-size: 14px;
    line-height: 1.7;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.document-content pre.info-box::before {
    content: attr(data-title);
    display: block;
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.3);
}

.document-content pre.info-box code {
    color: #ffffff;
    background: rgba(255,255,255,0.15);
    padding: 2px 6px;
    border-radius: 4px;
}

/* ----------------------------------------
   5. CHART VISUAL - Chart Theme
   ---------------------------------------- */
.document-content pre.chart-visual {
    background: #0f1419;
    color: #e6edf3;
    border: 1px solid #30363d;
    font-size: 13px;
    line-height: 1.5;
}

.document-content pre.chart-visual code {
    color: #e6edf3;
}

/* ----------------------------------------
   CONTENT TYPE LABELS
   ---------------------------------------- */
.code-block-label {
    position: absolute;
    top: 8px;
    right: 12px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    opacity: 0.9;
    pointer-events: none;
}

.label-code {
    background: #313244;
    color: #cdd6f4;
}

.label-art {
    background: #e9ecef;
    color: #495057;
}

.label-table {
    background: #dee2e6;
    color: #495057;
}

.label-info {
    background: rgba(255,255,255,0.2);
    color: #ffffff;
}

.label-chart {
    background: #30363d;
    color: #e6edf3;
}

/* ----------------------------------------
   CONVERTED HTML TABLE STYLES
   ---------------------------------------- */
.converted-table-wrapper {
    margin: 20px 0;
}

.table-responsive {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    background: #ffffff;
}

.ascii-converted-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: #ffffff;
}

/* Table Title (center header) - Purple gradient */
.ascii-converted-table thead.table-title th {
    color: #ffffff;
    text-align: center;
    font-weight: 700;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Body header cells (column headers like 1. CASHFLOW, 2. COST CENTER, 3. PENCATATAN) */
.ascii-converted-table tbody th,
.ascii-converted-table th {
    background: #e9ecef;
    color: #2d3436;
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #dee2e6;
}

.ascii-converted-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #e9ecef;
    color: #2d3436;
    vertical-align: top;
}

.ascii-converted-table tbody tr:hover {
    background: #f8f9fa;
}

.ascii-converted-table tbody tr:nth-child(even) {
    background: #fafbfc;
}

.ascii-converted-table tbody tr:nth-child(even):hover {
    background: #f1f3f5;
}

/* ----------------------------------------
   STATUS BADGES (dalam tabel)
   ---------------------------------------- */
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-status.success {
    background: #d4edda;
    color: #155724;
}

.badge-status.warning {
    background: #fff3cd;
    color: #856404;
}

.badge-status.danger {
    background: #f8d7da;
    color: #721c24;
}

/* ----------------------------------------
   SCROLLBAR STYLING
   ---------------------------------------- */
.document-content pre::-webkit-scrollbar,
.table-responsive::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}

.document-content pre::-webkit-scrollbar-track,
.table-responsive::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.05);
    border-radius: 4px;
}

.document-content pre::-webkit-scrollbar-thumb,
.table-responsive::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.2);
    border-radius: 4px;
}

.document-content pre::-webkit-scrollbar-thumb:hover,
.table-responsive::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,0.3);
}

.document-content pre.code-block::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
}

.document-content pre.code-block::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
}

.document-content pre.code-block::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.25);
}

/* ----------------------------------------
   RESPONSIVE ADJUSTMENTS
   ---------------------------------------- */
@media (max-width: 768px) {
    .document-content pre {
        padding: 15px;
        font-size: 12px;
    }
    
    .document-content pre.ascii-table {
        font-size: 10px;
    }
    
    .document-content pre.info-box {
        font-size: 13px;
    }
    
    .ascii-converted-table {
        font-size: 12px;
    }
    
    .ascii-converted-table th,
    .ascii-converted-table td {
        padding: 10px 12px;
    }
    
    .code-block-label {
        font-size: 9px;
        padding: 3px 8px;
    }
}

/* ----------------------------------------
   PRINT STYLES
   ---------------------------------------- */
@media print {
    .document-content pre {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .code-block-label,
    .table-toggle-btn {
        display: none;
    }
    
    .table-responsive {
        overflow-x: visible;
    }
}
