/* ═══════════════════════════════════════════════
   Detail-Sidebar – rechts aufgleitend
   Zeigt Kurzinfos zu NPCs, Kreaturen, Würfeltabellen
   ═══════════════════════════════════════════════ */

.detail-sidebar {
    position: fixed;
    top: 60px;
    right: 0;
    bottom: 0;
    width: 400px;
    background: var(--color-surface, #1a0f0f);
    border-left: 2px solid rgba(212, 175, 55, 0.3);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 200;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.detail-sidebar.open {
    transform: translateX(0);
}

/* Content-Bereich wird schmaler wenn Sidebar offen */
.content.detail-open {
    right: 400px;
    transition: right 0.3s ease;
}

/* Header */
.detail-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    flex-shrink: 0;
}

.detail-sidebar-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #d4af37;
    font-family: var(--font-fantasy, 'Cinzel', serif);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.detail-sidebar-close {
    background: none;
    border: 1px solid rgba(212, 175, 55, 0.25);
    color: #bbb;
    font-size: 1.4rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: 0.8rem;
    transition: all 0.15s;
}

.detail-sidebar-close:hover {
    background: rgba(212, 175, 55, 0.15);
    border-color: #d4af37;
    color: #d4af37;
}

/* Body */
.detail-sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.2rem;
}

.detail-sidebar-body::-webkit-scrollbar {
    width: 5px;
}
.detail-sidebar-body::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.3);
    border-radius: 3px;
}

/* Loading state */
.detail-sidebar-loading {
    text-align: center;
    padding: 2rem;
    color: #888;
}

/* Detail-Subtitle */
.detail-subtitle {
    color: #999;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

/* Stats Grid */
.detail-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.detail-stat {
    text-align: center;
    padding: 0.5rem 0.3rem;
    background: rgba(212, 175, 55, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: 6px;
}

.detail-stat-label {
    display: block;
    font-size: 0.7rem;
    color: #d4af37;
    font-weight: 600;
    margin-bottom: 0.2rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detail-stat-value {
    display: block;
    font-size: 1rem;
    color: #e0e0e0;
    font-weight: 600;
}

.detail-stat-mod {
    display: block;
    font-size: 0.78rem;
    color: #999;
}

/* Combat Line */
.detail-combat {
    display: flex;
    gap: 1rem;
    padding: 0.6rem 0;
    margin-bottom: 0.8rem;
    border-top: 1px solid rgba(212, 175, 55, 0.12);
    border-bottom: 1px solid rgba(212, 175, 55, 0.12);
    font-size: 0.88rem;
}

.detail-combat span {
    color: #ccc;
}

.detail-combat strong {
    color: #d4af37;
    font-weight: 600;
}

/* Description */
.detail-desc {
    color: #bbb;
    font-size: 0.88rem;
    line-height: 1.6;
    margin-bottom: 0.8rem;
}

.detail-desc-label {
    color: #d4af37;
    font-weight: 600;
    font-size: 0.82rem;
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Würfeltabelle in Sidebar */
.detail-wuerfel-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.detail-wuerfel-table th {
    background: rgba(212, 175, 55, 0.1);
    color: #d4af37;
    padding: 0.4rem 0.6rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 1px solid rgba(212, 175, 55, 0.25);
}

.detail-wuerfel-table td {
    padding: 0.35rem 0.6rem;
    border-bottom: 1px solid rgba(212, 175, 55, 0.08);
    color: #ccc;
}

/* Wiki-Seite Preview */
.detail-preview {
    color: #aaa;
    font-size: 0.88rem;
    line-height: 1.6;
    margin-top: 0.5rem;
}

/* Footer */
.detail-sidebar-footer {
    padding: 0.8rem 1.2rem;
    border-top: 1px solid rgba(212, 175, 55, 0.2);
    flex-shrink: 0;
    display: none;
}

.detail-sidebar-footer.has-link {
    display: block;
}

/* Erwähnungen */
.detail-erwaehnungen {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(212, 175, 55, 0.15);
}

.erwaehnung-group {
    margin-bottom: 0.5rem;
}

.erwaehnung-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.5rem;
    margin-bottom: 0.25rem;
    border-radius: 5px;
    text-decoration: none;
    color: #ccc;
    font-size: 0.85rem;
    transition: background 0.12s;
}

.erwaehnung-link:hover {
    background: rgba(212, 175, 55, 0.1);
    color: #d4af37;
}

.erwaehnung-icon {
    font-size: 0.95rem;
    flex-shrink: 0;
}

.erwaehnung-titel {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.erwaehnung-kontext {
    font-size: 0.72rem;
    color: #666;
    flex-shrink: 0;
}

/* Responsive: Sidebar wird Overlay auf kleinen Bildschirmen */
@media (max-width: 900px) {
    .detail-sidebar {
        width: 100%;
        max-width: 400px;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
    }
    .content.detail-open {
        right: 0;
    }
}

@media (max-width: 767px) {
    .detail-sidebar {
        top: 0;
        max-width: 100%;
        z-index: 1001;
    }
}
