/**
 * Black Trap Codex - Design System (V1.9.2) & Interactive UI
 * Pfad: assets/css/btwiki.css
 */

:root {
    --bt-primary: #2c3e50;
    --bt-secondary: #34495e;
    --bt-accent: #27ae60;
    --bt-danger: #c0392b;
    --bt-warning: #f39c12;
    --bt-light: #f8f9fa;
    --bt-border: #e9ecef;
    --bt-text: #333;
    --bt-text-muted: #666;
    --bt-white: #ffffff;
    --bt-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* --- BASIS & UTILS --- */

.btwiki-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--bt-text);
    line-height: 1.6;
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Globaler Listen-Fix */
.btwiki-container ul, 
.btwiki-container ol {
    margin: 1.5em 0 1.5em 2.5em !important;
    padding: 0 !important;
    list-style-position: outside !important;
    display: block !important;
}

.btwiki-container li {
    display: list-item !important;
    margin-bottom: 8px !important;
    padding-left: 5px !important;
}

.btwiki-container ul { list-style-type: disc !important; }
.btwiki-container ol { list-style-type: decimal !important; }

/* Buttons */
.btwiki-btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--bt-primary);
    color: var(--bt-white) !important;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s, opacity 0.2s;
    border: none;
    cursor: pointer;
    text-align: center;
    font-size: 0.9rem;
}

.btwiki-btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

/* --- LAYOUT & GRID --- */

.btwiki-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 30px;
    margin-top: 30px;
}

.btwiki-layout-sidebar {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 0;
    border: 1px solid var(--bt-border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bt-white);
    box-shadow: var(--bt-shadow);
}

@media (max-width: 900px) {
    .btwiki-layout-sidebar { grid-template-columns: 1fr; }
    .btwiki-sidebar {
        border-right: none !important;
        border-bottom: 1px solid var(--bt-border);
    }
}

/* --- CARDS --- */

.btwiki-card {
    background: var(--bt-white);
    border: 1px solid var(--bt-border);
    border-radius: 6px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.btwiki-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
}

.btwiki-card img {
    width: 100% !important;
    height: 200px !important;
    object-fit: cover;
    display: block;
}

.score-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--bt-accent);
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 800;
    font-family: monospace;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* --- HABITAT FINDER CONTROLS --- */

.bt-control-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--bt-secondary);
    margin-bottom: 10px;
}

.bt-habitat-slider {
    width: 100%;
    margin: 10px 0;
    cursor: pointer;
}

.bt-slider-val {
    font-family: monospace;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--bt-primary);
    text-align: right;
}

/* Animation für den Live-Status */
.bt-pulse {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: var(--bt-accent);
    border-radius: 50%;
    margin-right: 8px;
    animation: bt_pulse_green 2s infinite;
}

@keyframes bt_pulse_green {
    0% { transform: scale(0.95); opacity: 1; }
    70% { transform: scale(1.1); opacity: 0.5; }
    100% { transform: scale(0.95); opacity: 1; }
}

/* --- MODAL / PCA OVERLAY --- */

.bt-pca-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.85); /* Slate-Transparenz */
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.bt-pca-modal {
    background: var(--bt-white);
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    border-radius: 8px;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* --- API & CODE BLOCKS --- */

.btwiki-api-box {
    background: #1e1e1e !important;
    color: #e0e0e0 !important;
    font-family: 'Consolas', 'Monaco', monospace;
    padding: 20px;
    border-radius: 6px;
    font-size: 0.85rem;
    border-left: 4px solid var(--bt-accent);
}

/* --- QUELLEN & CITATION --- */

.btwiki-sources-list {
    font-size: 0.85rem;
    color: #555;
    background: #fdfdfe;
    border: 1px solid var(--bt-border);
    padding: 20px;
    border-radius: 4px;
}

.btwiki-citation-box {
    background: #eef6fc;
    border: 1px solid #d1e3f0;
    padding: 15px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.8rem;
    margin-top: 10px;
    color: var(--bt-secondary);
}