/* ===== PASSAGE DISPLAY SYSTEM - LIGHT THEME (FINAL) ===== */
/* Matches svapna.space - Translator tags AFTER title on LEFT */

:root {
    /* Light Theme Colors from svapna.space */
    --bg-white: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --primary: #1e40af;
    --primary-light: #3b82f6;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Text Node with Passages */
.text-node-with-passages {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin: 12px 0;
    box-shadow: var(--shadow-sm);
}

/* Text Header - UPDATED: Title and translator tags on left */
.text-header {
    padding: 16px 20px;
    cursor: pointer;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 20px;
    align-items: center;
    border-bottom: 1px solid var(--border);
    background: var(--bg-tertiary);
    border-radius: 8px 8px 0 0;
}

.text-header:hover {
    background: var(--bg-secondary);
}

.text-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.text-title-main {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
    min-width: 0;
}

/* Translator tags - after title */
.text-translator-tags {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
}

.text-meta-info {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
    white-space: nowrap;
}

.passage-count {
    background: var(--bg-secondary);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    border: 1px solid var(--border);
}

.toggle-passages {
    font-size: 18px;
    color: var(--text-muted);
    transition: transform 0.3s ease;
    display: inline-block;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
}

.toggle-passages::before {
    content: '›';
    font-weight: 600;
}

.toggle-passages.rotated::before {
    content: '⌄';
}

/* Passage Cards Container */
.passages-container {
    display: none;
}

.passages-container.expanded {
    display: block;
}

/* Individual Passage Card */
.passage-card {
    border-bottom: 1px solid var(--border-light);
}

.passage-card:last-child {
    border-bottom: none;
    border-radius: 0 0 8px 8px;
}

.passage-header {
    background: var(--bg-secondary);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.passage-reference {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

/* Taxonomy Tags - Light Theme (on right in passage header) */
.tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tag {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: lowercase;
    border: 1px solid;
}

/* Light theme taxonomy colors */
.tag.revelation {
    background: #ecfdf5;
    color: #065f46;
    border-color: #a7f3d0;
}

.tag.empowerment {
    background: #fff7ed;
    color: #9a3412;
    border-color: #fed7aa;
}

.tag.magic {
    background: #f3e8ff;
    color: #6b21a8;
    border-color: #c084fc;
}

.tag.yoga,
.tag[class*="yoga&consciousness"] {
    background: #eef2ff;
    color: #4338ca;
    border-color: #a5b4fc;
}

.tag.omens,
.tag[class*="omens&protection"] {
    background: #f8fafc;
    color: #64748b;
    border-color: #cbd5e1;
}

/* Translator tags - small, compact style for LEFT placement */
.tag.translator {
    background: #f8fafc;
    color: #475569;
    border-color: #cbd5e1;
    font-size: 11px;
    padding: 4px 10px;
    line-height: 1;
}

.tag.translated {
    background: #f8fafc;
    color: #475569;
    border-color: #cbd5e1;
    font-size: 11px;
    padding: 4px 10px;
    line-height: 1;
}

.tag.untranslated {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
    font-size: 11px;
    padding: 4px 10px;
    line-height: 1;
}

/* Two Column Layout */
.passage-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.sanskrit-column {
    padding: 20px;
    background: #fefce8;
    border-right: 1px solid var(--border);
}

.translation-column {
    padding: 20px;
    background: var(--bg-white);
}

.column-header {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 12px;
    font-weight: 700;
}

/* Verse Formatting */
.verse {
    margin-bottom: 16px;
    line-height: 1.7;
    display: flex;
    gap: 8px;
}

.verse:last-child {
    margin-bottom: 0;
}

.verse-number {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
    white-space: nowrap;
}

.verse-text {
    color: var(--text-primary);
    font-size: 14px;
    white-space: pre-line;
    flex: 1;
    min-width: 0;
}

.sanskrit-column .verse-text {
    font-style: italic;
    color: #78716c;
}

.translation-column .verse-text {
    color: var(--text-primary);
}

/* Context Summary */
.passage-summary {
    padding: 16px 20px;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.passage-summary strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 900px) {
    .passage-content {
        grid-template-columns: 1fr;
    }

    .sanskrit-column {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .text-header-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* Integration with existing tree styles */
.tree-node .text-node-with-passages {
    margin-left: 0;
}

/* Ensure proper nesting in tree structure */
.tree-node .text-node-with-passages .text-header {
    padding-left: 20px;
}

/* Tooltip for tags with [title] attribute */
.tag[title] {
    cursor: help;
    position: relative;
}

.tag[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 10px;
    background: #1e293b;
    color: #ffffff;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    border-radius: 4px;
    margin-bottom: 5px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tag[title]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1e293b;
    margin-bottom: -5px;
    z-index: 1000;
}
