/* LEA+ Premium AI UI Components */

:root {
    --ai-primary: #3b82f6;
    --ai-primary-glow: rgba(59, 130, 246, 0.4);
    --ai-felony: #ff3e3e;
    --ai-misdemeanor: #ffb300;
    --ai-infraction: #00e676;
    --ai-precedent: #42a5f5;
    --ai-bg-dark: rgba(15, 23, 42, 0.9);
    --ai-border: rgba(255, 255, 255, 0.12);
}

/* AI Intelligence Briefing Card */
.explanation-card {
    background: linear-gradient(135deg, hsla(var(--h), 25%, 10%, 0.8), hsla(var(--h), 25%, 5%, 0.8));
    border: 1px solid var(--ai-border);
    border-left: 4px solid var(--ai-primary);
    border-radius: 16px;
    margin-bottom: 2rem;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.explanation-card .card-header {
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--ai-border);
    display: flex;
    align-items: center;
}

.explanation-card .card-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.explanation-card .card-content {
    padding: 1.5rem;
    line-height: 1.8;
    color: #fff;
    font-size: 1.05rem;
}

/* Penal Code & Caselaw Cards */
.pc-card, .caselaw-card {
    background: rgba(4, 7, 12, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid var(--ai-border);
    border-radius: 16px;
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.pc-card:hover, .caselaw-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 15px 45px rgba(0,0,0,0.5);
    background: rgba(4, 7, 12, 0.8);
}

.card-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.label-tag {
    font-size: 0.65rem;
    font-weight: 900;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    padding: 2px 0;
}

.label-tag.felony { color: var(--ai-felony); text-shadow: 0 0 10px rgba(255,62,62,0.3); }
.label-tag.misdemeanor { color: var(--ai-misdemeanor); }
.label-tag.infraction { color: var(--ai-infraction); }
.label-tag.precedent { color: var(--ai-precedent); text-shadow: 0 0 10px rgba(66,165,245,0.3); }

.card-id {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.2);
    font-family: 'JetBrains Mono', monospace;
}

.card-title-main {
    font-size: 1.3rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.75rem;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-desc {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.6;
}

/* Caselaw Specifics */
.implication-label {
    color: var(--ai-precedent);
    font-weight: 900;
    font-size: 0.75rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.implication-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(66, 165, 245, 0.2);
}

.implication-text {
    color: #fff;
    font-size: 1rem;
    line-height: 1.6;
    opacity: 0.9;
}

/* External Precedents (Oyez) rows */
.oyez-row {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--ai-border);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: inherit;
}

.oyez-row:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateX(5px);
}

.oyez-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
}

.oyez-icon {
    font-size: 0.8rem;
    color: var(--ai-primary);
    opacity: 0.6;
}

/* Pro-Tip Box (used in Trainer AI) */
.protip-box {
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 1.5rem;
    border-radius: 12px;
    margin-top: 1.5rem;
    position: relative;
}

.protip-box::before {
    content: 'PRO-TIP';
    position: absolute;
    top: -10px;
    left: 20px;
    background: #10b981;
    color: #000;
    font-size: 0.65rem;
    font-weight: 900;
    padding: 2px 8px;
    border-radius: 4px;
}

/* Badges for inline mentions */
.pc-badge {
    background: rgba(59, 130, 246, 0.15);
    color: var(--ai-primary);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Radio Callout Box (Meldunek) */
.radio-box {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-left: 4px solid var(--ai-primary);
    padding: 1.25rem 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    color: #fff;
    position: relative;
    line-height: 1.6;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.radio-box::before {
    content: 'RADIO CALLOUT';
    position: absolute;
    top: -10px;
    left: 10px;
    background: var(--ai-primary);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 3px;
    letter-spacing: 1px;
    box-shadow: 0 2px 5px rgba(59, 130, 246, 0.4);
}

/* AI Tables */
.ai-table-container {
    overflow-x: auto;
    margin: 1.5rem 0;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.ai-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    color: #fff;
    table-layout: auto; /* Changed back to auto to prevent overlap of long words */
}

.ai-th {
    background: rgba(59, 130, 246, 0.1);
    color: var(--ai-primary);
    font-weight: 700;
    text-align: left;
    padding: 12px 15px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
}

.ai-th:nth-child(1), .ai-td:nth-child(1) { width: 40px; text-align: center; } /* KROK */
.ai-th:nth-child(2), .ai-td:nth-child(2) { 
    width: 180px; /* Increased width for longer labels like IDENTYFIKACJA */
    min-width: 140px;
    font-weight: 700;
    color: var(--ai-primary);
}

.ai-td {
    padding: 12px 15px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
    line-height: 1.5;
    vertical-align: top;
}

.ai-td:nth-child(1) { color: rgba(255,255,255,0.4); font-size: 0.8rem; }

.ai-table tr:hover .ai-td {
    background: rgba(255, 255, 255, 0.04);
}
