/* Sacred Geometry Application Styles */

:root {
    /* Color Palette - Esoteric Theme (Dark) */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;
    --text-primary: #e8e8e8;
    --text-secondary: #a0a0a0;
    --text-muted: #666;
    --gold: #ffd700;
    --gold-dark: #b8860b;
    --silver: #c0c0c0;
    --mystic-purple: #6a0dad;
    --deep-blue: #1e3a5f;
    --cosmic-blue: #4a9eff;
    --ember: #ff6b35;
    --emerald: #2ecc71;

    /* Canvas & SVG colors */
    --canvas-bg: #0a0a0f;
    --canvas-stroke: #ffd700;
    --canvas-stroke-secondary: #4a9eff;
    --border-glow: rgba(255, 215, 0, 0.1);

    /* Spacing */
    --sidebar-width: 280px;
    --header-height: 60px;
    --control-panel-height: 80px;

    /* Typography */
    --font-primary: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-mystical: 'Palatino Linotype', 'Book Antiqua', Palatino, serif;
}

/* Light Theme */
[data-theme="light"] {
    --bg-primary: #f5f5f0;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e8e8e3;
    --text-primary: #1a1a1f;
    --text-secondary: #4a4a50;
    --text-muted: #888;
    --gold: #996600;
    --gold-dark: #664400;
    --silver: #666666;
    --mystic-purple: #8b5cf6;
    --deep-blue: #3b82f6;
    --cosmic-blue: #2563eb;
    --ember: #ea580c;
    --emerald: #16a34a;

    /* Canvas & SVG colors */
    --canvas-bg: #fafaf8;
    --canvas-stroke: #664400;
    --canvas-stroke-secondary: #2563eb;
    --border-glow: rgba(102, 68, 0, 0.15);
}

/* Light Theme - Component Overrides */
[data-theme="light"] .btn:hover {
    background: rgba(102, 68, 0, 0.1);
}

[data-theme="light"] .sidebar {
    border-right-color: rgba(102, 68, 0, 0.2);
}

[data-theme="light"] .logo {
    border-bottom-color: rgba(102, 68, 0, 0.2);
}

[data-theme="light"] .search-container {
    border-bottom-color: rgba(102, 68, 0, 0.2);
}

[data-theme="light"] .search-container input {
    border-color: rgba(102, 68, 0, 0.3);
}

[data-theme="light"] .nav-section {
    border-bottom-color: rgba(102, 68, 0, 0.1);
}

[data-theme="light"] .nav-menu a:hover,
[data-theme="light"] .nav-menu a.active,
[data-theme="light"] .section-content a:hover,
[data-theme="light"] .section-content a.active {
    background: rgba(102, 68, 0, 0.1);
}

[data-theme="light"] .nav-group-toggle:hover,
[data-theme="light"] .section-toggle:hover {
    background: rgba(102, 68, 0, 0.05);
}

[data-theme="light"] .quick-link {
    background: rgba(102, 68, 0, 0.08);
}

[data-theme="light"] .quick-link:hover {
    background: rgba(102, 68, 0, 0.12);
}

[data-theme="light"] .section-content {
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .nav-group-toggle .group-count {
    background: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .control-panel {
    border-top-color: rgba(102, 68, 0, 0.2);
}

[data-theme="light"] .info-panel {
    border-left-color: rgba(102, 68, 0, 0.2);
}

[data-theme="light"] #main-canvas {
    background: var(--canvas-bg);
}

[data-theme="light"] .canvas-zoom-controls {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .canvas-zoom-btn {
    color: var(--gold);
    border-color: rgba(102, 68, 0, 0.2);
}

[data-theme="light"] .canvas-zoom-btn:hover {
    background: rgba(102, 68, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
}

/* App Container */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid rgba(255, 215, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: sticky;
    top: 0;
    height: 100vh;
}

.logo {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.1);
    background: linear-gradient(180deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
}

.logo-icon {
    width: 40px;
    height: 40px;
    color: var(--gold);
}

.logo h1 {
    font-family: var(--font-mystical);
    font-size: 1.2rem;
    color: var(--gold);
    font-weight: normal;
    letter-spacing: 1px;
}

/* Search Container */
.search-container {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.1);
    position: relative;
}

.search-container input {
    width: 100%;
    padding: 10px 15px;
    background: var(--bg-tertiary);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.search-container input::placeholder {
    color: var(--text-muted);
}

.search-container input:focus {
    border-color: var(--gold);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 10px;
    right: 10px;
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 4px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.search-results.visible {
    display: block;
}

.search-result-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 215, 0, 0.05);
    transition: background 0.2s;
}

.search-result-item:hover {
    background: rgba(255, 215, 0, 0.1);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-title {
    color: var(--gold);
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.search-result-category {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.search-result-excerpt {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-top: 5px;
    line-height: 1.4;
}

.search-result-excerpt mark {
    background: rgba(255, 215, 0, 0.3);
    color: var(--gold);
    padding: 0 2px;
    border-radius: 2px;
}

.search-no-results {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
}

.nav-menu {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
    list-style: none;
}

.nav-menu::-webkit-scrollbar {
    width: 6px;
}

.nav-menu::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.nav-menu::-webkit-scrollbar-thumb {
    background: var(--gold-dark);
    border-radius: 3px;
}

/* Quick Link (Search) */
.nav-item {
    margin-bottom: 10px;
}

.quick-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    color: var(--gold);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    background: rgba(255, 215, 0, 0.08);
    border-radius: 8px;
    margin: 0 10px;
    transition: all 0.2s ease;
}

.quick-link:hover {
    background: rgba(255, 215, 0, 0.15);
}

.nav-icon {
    font-size: 1rem;
}

/* Nav Groups (Top Level Collapsible) */
.nav-group {
    margin-bottom: 2px;
}

.nav-group-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 15px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.nav-group-toggle:hover {
    background: rgba(255, 215, 0, 0.05);
}

.nav-group-toggle .toggle-icon {
    font-size: 0.6rem;
    color: var(--gold);
    transition: transform 0.2s ease;
    width: 12px;
}

.nav-group-toggle .group-title {
    flex: 1;
}

.nav-group-toggle .group-count {
    font-size: 0.7rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 10px;
}

.nav-group-content {
    display: none;
    padding-left: 5px;
}

.nav-group[aria-expanded="true"] > .nav-group-content,
.nav-group.expanded > .nav-group-content {
    display: block;
}

.nav-group[aria-expanded="true"] > .nav-group-toggle .toggle-icon,
.nav-group.expanded > .nav-group-toggle .toggle-icon {
    transform: rotate(90deg);
}

/* Inner Section List */
.nav-section-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Collapsible Sections (Second Level) */
.nav-section.collapsible {
    margin-bottom: 0;
}

.section-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 15px 8px 25px;
    background: transparent;
    border: none;
    color: var(--gold);
    cursor: pointer;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.2s ease;
}

.section-toggle:hover {
    background: rgba(255, 215, 0, 0.05);
}

.section-toggle .toggle-icon {
    font-size: 0.5rem;
    color: var(--gold-dark);
    transition: transform 0.2s ease;
    width: 10px;
}

.section-toggle .section-title {
    padding: 0;
    display: inline;
}

.section-content {
    display: none;
    list-style: none;
    padding: 0;
    margin: 0;
    background: rgba(0, 0, 0, 0.1);
}

.nav-section.collapsible[aria-expanded="true"] > .section-content,
.nav-section.collapsible.expanded > .section-content {
    display: block;
}

.nav-section.collapsible[aria-expanded="true"] > .section-toggle .toggle-icon,
.nav-section.collapsible.expanded > .section-toggle .toggle-icon {
    transform: rotate(90deg);
}

/* Nav Links */
.section-content a {
    display: block;
    padding: 7px 15px 7px 45px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    border-left: 2px solid transparent;
}

.section-content a:hover {
    color: var(--text-primary);
    background: rgba(255, 215, 0, 0.05);
    border-left-color: var(--gold);
}

.section-content a.active {
    color: var(--gold);
    background: rgba(255, 215, 0, 0.1);
    border-left-color: var(--gold);
}

/* Legacy support for non-collapsible sections */
.nav-section:not(.collapsible) {
    margin-bottom: 5px;
}

.nav-section:not(.collapsible) > .section-title {
    display: block;
    padding: 12px 20px 8px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--gold);
    font-weight: 600;
}

.nav-section:not(.collapsible) ul {
    list-style: none;
}

.nav-section:not(.collapsible) a {
    display: block;
    padding: 8px 20px 8px 30px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    border-left: 2px solid transparent;
}

.nav-section:not(.collapsible) a:hover {
    color: var(--text-primary);
    background: rgba(255, 215, 0, 0.05);
    border-left-color: var(--gold);
}

.nav-section:not(.collapsible) a.active {
    color: var(--gold);
    background: rgba(255, 215, 0, 0.1);
    border-left-color: var(--gold);
}

/* Main Content Area */
.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.content-header {
    height: var(--header-height);
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-secondary);
    border-bottom: 1px solid rgba(255, 215, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.content-header h2 {
    font-family: var(--font-mystical);
    font-weight: normal;
    font-size: 1.4rem;
    color: var(--text-primary);
}

.controls {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--gold-dark);
    color: var(--gold);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: var(--gold);
}

.btn.active {
    background: var(--gold);
    color: var(--bg-primary);
}

.btn .icon {
    font-size: 1rem;
}

/* Canvas Container */
.canvas-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    background: radial-gradient(ellipse at center, var(--bg-tertiary) 0%, var(--bg-primary) 100%);
    min-height: calc(100vh - var(--header-height) - var(--control-panel-height));
}

#main-canvas {
    width: 100%;
    height: 100%;
    max-width: 800px;
    max-height: 800px;
    border-radius: 8px;
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.1);
}

/* Control Panel */
.control-panel {
    height: var(--control-panel-height);
    padding: 15px 30px;
    background: var(--bg-secondary);
    border-top: 1px solid rgba(255, 215, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 30px;
    overflow-x: auto;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.control-group label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    min-width: 80px;
}

.control-group input[type="range"] {
    width: 100px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-tertiary);
    border-radius: 2px;
    outline: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: var(--gold);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s;
}

.control-group input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.control-group input[type="color"] {
    width: 40px;
    height: 30px;
    border: 1px solid var(--gold-dark);
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    padding: 2px;
}

.control-group span {
    font-size: 0.8rem;
    color: var(--gold);
    min-width: 35px;
}

/* Info Panel */
.info-panel {
    position: absolute;
    top: 0;
    right: -400px;
    width: 380px;
    height: 100%;
    background: var(--bg-secondary);
    border-left: 1px solid rgba(255, 215, 0, 0.2);
    padding: 30px;
    overflow-y: auto;
    transition: right 0.3s ease;
    z-index: 100;
}

.info-panel.visible {
    right: 0;
}

.info-panel .close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    background: transparent;
    border: 1px solid var(--gold-dark);
    color: var(--gold);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    transition: all 0.2s;
}

.info-panel .close-btn:hover {
    background: var(--gold);
    color: var(--bg-primary);
}

.info-panel h3 {
    font-family: var(--font-mystical);
    color: var(--gold);
    font-size: 1.3rem;
    margin-bottom: 20px;
    padding-right: 40px;
}

.info-panel p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.info-panel h4 {
    color: var(--text-primary);
    font-size: 1rem;
    margin: 20px 0 10px;
}

.info-panel ul {
    color: var(--text-secondary);
    padding-left: 20px;
    margin-bottom: 15px;
}

.info-panel li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.info-panel .tradition-tag {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid var(--gold-dark);
    border-radius: 3px;
    font-size: 0.75rem;
    color: var(--gold);
    margin-right: 5px;
    margin-bottom: 5px;
}

/* Fullscreen mode */
body.fullscreen .sidebar {
    display: none;
}

body.fullscreen .content-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(10, 10, 15, 0.8);
    z-index: 10;
}

body.fullscreen .control-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(10, 10, 15, 0.8);
    z-index: 10;
}

body.fullscreen .canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0;
}

body.fullscreen #main-canvas {
    max-width: none;
    max-height: none;
    border-radius: 0;
}

/* Animation states */
.drawing-layer.animating {
    animation: rotate-slow 60s linear infinite;
}

@keyframes rotate-slow {
    from { transform: translate(400px, 400px) rotate(0deg); }
    to { transform: translate(400px, 400px) rotate(360deg); }
}

@keyframes pulse-glow {
    0%, 100% { filter: url(#glow); }
    50% { filter: url(#gold-glow); }
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 60px;
        overflow: visible;
    }

    .logo h1,
    .section-title,
    .nav-section a span {
        display: none;
    }

    .nav-section a {
        padding: 12px;
        text-align: center;
    }

    .control-panel {
        flex-wrap: wrap;
        height: auto;
        padding: 10px 15px;
    }

    .control-group {
        flex: 1 1 45%;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .content-header h2 {
        font-size: 1.1rem;
    }

    .info-panel {
        width: 100%;
        right: -100%;
    }
}

/* ========== DATABASE VIEW STYLES ========== */

/* Override canvas-container for database views */
.canvas-container:has(.database-view),
.canvas-container.has-database-view {
    align-items: flex-start;
    justify-content: flex-start;
    padding: 0;
}

/* Hide control panel for database views */
.content:has(.database-view) .control-panel,
.content.has-database-view .control-panel {
    display: none;
}

.database-view {
    width: 100%;
    padding: 30px;
    text-align: left;
    padding-bottom: 100px;
}

.database-title {
    font-family: var(--font-mystical);
    color: var(--gold);
    font-size: 1.8rem;
    margin-bottom: 10px;
    font-weight: normal;
}

.database-count {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 25px;
}

.database-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Database Search */
.search-header {
    margin-bottom: 25px;
}

.database-search {
    width: 100%;
    max-width: 600px;
    padding: 15px 20px;
    font-size: 1rem;
    background: var(--bg-tertiary);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.database-search::placeholder {
    color: var(--text-muted);
}

.database-search:focus {
    border-color: var(--gold);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.15);
}

.search-hint {
    color: var(--text-muted);
    font-style: italic;
    padding: 20px 0;
}

.no-results {
    color: var(--ember);
    padding: 20px 0;
}

/* Database Items */
.database-item {
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 215, 0, 0.15);
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
}

.database-item:hover {
    border-color: rgba(255, 215, 0, 0.4);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.database-item.expanded {
    border-color: var(--gold);
    background: var(--bg-tertiary);
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.item-title {
    font-family: var(--font-mystical);
    color: var(--gold);
    font-size: 1.2rem;
    font-weight: normal;
    margin: 0;
}

.item-date,
.item-rank {
    color: var(--cosmic-blue);
    font-size: 0.85rem;
    background: rgba(74, 158, 255, 0.1);
    padding: 3px 10px;
    border-radius: 4px;
}

.item-original-title {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.item-alt-names {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 10px;
}

/* Meta Tags */
.item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.meta-tag {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(255, 215, 0, 0.08);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.meta-tag.author {
    background: rgba(106, 13, 173, 0.15);
    border-color: rgba(106, 13, 173, 0.3);
    color: #b57edc;
}

.meta-tag.tradition {
    background: rgba(46, 204, 113, 0.1);
    border-color: rgba(46, 204, 113, 0.3);
    color: var(--emerald);
}

.meta-tag.legions {
    background: rgba(255, 107, 53, 0.1);
    border-color: rgba(255, 107, 53, 0.3);
    color: var(--ember);
}

.meta-tag.element {
    background: rgba(74, 158, 255, 0.1);
    border-color: rgba(74, 158, 255, 0.3);
    color: var(--cosmic-blue);
}

.meta-tag.planet {
    background: rgba(192, 192, 192, 0.1);
    border-color: rgba(192, 192, 192, 0.3);
    color: var(--silver);
}

/* Tradition Tags */
.item-traditions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 15px;
}

.tradition-tag {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid var(--gold-dark);
    border-radius: 3px;
    font-size: 0.7rem;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Item Content (hidden by default, shown when expanded) */
.item-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.item-contents,
.item-powers,
.item-sources {
    display: none;
    margin-bottom: 15px;
}

.database-item.expanded .item-contents,
.database-item.expanded .item-powers,
.database-item.expanded .item-sources {
    display: block;
}

.item-contents strong,
.item-powers strong,
.item-sources strong,
.item-significance strong,
.item-appearance strong,
.item-notes strong,
.item-source strong {
    color: var(--text-primary);
    font-size: 0.85rem;
}

.item-contents ul,
.item-powers ul,
.item-sources ul {
    margin-top: 8px;
    padding-left: 20px;
    color: var(--text-secondary);
}

.item-contents li,
.item-powers li,
.item-sources li {
    margin-bottom: 6px;
    line-height: 1.5;
    font-size: 0.9rem;
}

.item-significance,
.item-appearance,
.item-notes {
    display: none;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.database-item.expanded .item-significance,
.database-item.expanded .item-appearance,
.database-item.expanded .item-notes {
    display: block;
}

/* Source Links */
.item-sources a,
.item-source a {
    color: var(--cosmic-blue);
    text-decoration: none;
    transition: color 0.2s;
}

.item-sources a:hover,
.item-source a:hover {
    color: var(--gold);
    text-decoration: underline;
}

.item-source {
    display: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 215, 0, 0.1);
}

.database-item.expanded .item-source {
    display: block;
}

.item-source a {
    margin-left: 10px;
}

/* Grimoire-specific styling */
.grimoire-item {
    border-left: 3px solid var(--gold-dark);
}

.item-header-with-cover {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.item-cover {
    flex-shrink: 0;
    width: 140px;
    position: relative;
}

.item-cover img {
    width: 100%;
    height: auto;
    min-height: 180px;
    max-height: 220px;
    object-fit: cover;
    border-radius: 4px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(255, 215, 0, 0.1);
    transition: all 0.3s ease;
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.9), rgba(40, 40, 60, 0.9));
}

.item-cover img:hover {
    transform: scale(1.05);
    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(255, 215, 0, 0.2);
    border-color: var(--gold);
}

/* Book spine effect */
.item-cover::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 8px;
    background: linear-gradient(90deg,
        rgba(0, 0, 0, 0.4) 0%,
        rgba(255, 215, 0, 0.2) 50%,
        rgba(0, 0, 0, 0.3) 100%);
    border-radius: 4px 0 0 4px;
    pointer-events: none;
    z-index: 2;
}

/* Grimoire cover placeholder */
.cover-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 180px;
    max-height: 220px;
    background: linear-gradient(145deg,
        rgba(40, 30, 20, 0.95) 0%,
        rgba(60, 45, 30, 0.9) 50%,
        rgba(30, 20, 15, 0.95) 100%);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 4px;
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.4),
        inset 0 0 30px rgba(0, 0, 0, 0.3);
    text-align: center;
    padding: 15px 10px;
    box-sizing: border-box;
}

.cover-placeholder .placeholder-icon {
    font-size: 3em;
    margin-bottom: 10px;
    opacity: 0.8;
    filter: grayscale(30%);
}

.cover-placeholder .placeholder-title {
    font-size: 0.75em;
    color: var(--gold);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.3;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Grimoire-specific cover styling */
.grimoire-cover {
    position: relative;
}

.grimoire-cover::after {
    content: '';
    position: absolute;
    top: 10px;
    right: 10px;
    bottom: 10px;
    left: 15px;
    border: 1px solid rgba(255, 215, 0, 0.1);
    border-radius: 2px;
    pointer-events: none;
}

.item-header-content {
    flex: 1;
    min-width: 0;
}

.item-header-content .item-header {
    margin-bottom: 8px;
}

.item-header-content .item-description {
    margin-bottom: 10px;
}

/* History section */
.item-history {
    display: none;
    margin-bottom: 15px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    border-left: 3px solid var(--mystic-purple);
}

.database-item.expanded .item-history {
    display: block;
}

.item-history strong {
    color: var(--mystic-purple);
    display: block;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.history-text p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 12px;
    font-size: 0.9rem;
    text-align: justify;
}

.history-text p:last-child {
    margin-bottom: 0;
}

/* Key figures */
.item-key-figures {
    display: none;
    margin-bottom: 15px;
}

.database-item.expanded .item-key-figures {
    display: block;
}

.item-key-figures strong {
    color: var(--cosmic-blue);
}

.item-key-figures ul {
    margin-top: 8px;
    padding-left: 20px;
    color: var(--text-secondary);
}

.item-key-figures li {
    margin-bottom: 4px;
    font-size: 0.9rem;
}

/* Bibliography */
.item-bibliography {
    display: none;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 215, 0, 0.1);
}

.database-item.expanded .item-bibliography {
    display: block;
}

.item-bibliography strong {
    color: var(--emerald);
}

.item-bibliography ul {
    margin-top: 8px;
    padding-left: 20px;
    color: var(--text-muted);
}

.item-bibliography li {
    margin-bottom: 6px;
    font-size: 0.85rem;
    font-style: italic;
    line-height: 1.5;
}

/* Invocation and additional fields */
.item-invocation,
.item-day,
.item-feast,
.item-significance,
.item-traditions {
    display: none;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.database-item.expanded .item-invocation,
.database-item.expanded .item-day,
.database-item.expanded .item-feast,
.database-item.expanded .item-traditions {
    display: block;
}

.item-invocation strong,
.item-day strong,
.item-feast strong,
.item-traditions strong {
    color: var(--text-primary);
}

.item-usage {
    display: none;
    margin-bottom: 15px;
}

.database-item.expanded .item-usage {
    display: block;
}

.item-usage strong {
    color: var(--text-primary);
    font-size: 0.9rem;
}

.item-usage ul {
    margin-top: 8px;
    padding-left: 20px;
    color: var(--text-secondary);
}

.item-usage li {
    margin-bottom: 6px;
    line-height: 1.5;
    font-size: 0.9rem;
}

/* Demon-specific styling */
.demon-item .item-title {
    color: var(--ember);
}

.demon-item:hover {
    border-color: rgba(255, 107, 53, 0.4);
}

.demon-item.expanded {
    border-color: var(--ember);
}

.demon-item {
    border-left: 3px solid var(--ember);
}

/* Demon images - small preview in listing */
.demon-images {
    flex-shrink: 0;
    width: 100px;
}

.demon-seal-preview,
.demon-image-preview {
    width: 100px;
    height: 100px;
    object-fit: contain;
    border-radius: 6px;
    border: 1px solid rgba(255, 107, 53, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    background: rgba(255, 255, 255, 0.05);
    padding: 8px;
}

.demon-image-preview {
    object-fit: cover;
}

/* Expanded image gallery */
.item-images-expanded {
    display: none;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 20px;
    margin-bottom: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(255, 107, 53, 0.2);
}

.database-item.expanded .item-images-expanded {
    display: flex;
}

.demon-image-large,
.angel-image-large {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
}

.demon-image-large img {
    max-width: 500px;
    max-height: 600px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    border: 2px solid rgba(255, 107, 53, 0.4);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    background: rgba(255, 255, 255, 0.03);
    padding: 12px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.demon-image-large img:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.6);
}

.image-caption {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Fullscreen expand button */
.image-expand-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
    z-index: 10;
}

.demon-image-large:hover .image-expand-btn,
.angel-image-large:hover .image-expand-btn {
    opacity: 1;
}

.image-expand-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* Fullscreen Image Overlay */
.image-fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.98);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    overflow: hidden;
}

.image-fullscreen-overlay.active {
    opacity: 1;
    visibility: visible;
}

.fullscreen-image-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: grab;
}

.fullscreen-image-container:active {
    cursor: grabbing;
}

.fullscreen-image-container.zoomed {
    overflow: auto;
}

.image-fullscreen-overlay img {
    max-width: 100vw;
    max-height: 100vh;
    object-fit: contain;
    transition: transform 0.2s ease-out;
    transform-origin: center center;
    flex-shrink: 0;
}

.fullscreen-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    cursor: pointer;
    font-size: 1.5em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    z-index: 10002;
}

.fullscreen-close-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

/* Zoom Controls */
.fullscreen-zoom-controls {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 20px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 10002;
}

.fullscreen-zoom-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    cursor: pointer;
    font-size: 1.4em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.fullscreen-zoom-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.fullscreen-zoom-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.fullscreen-zoom-level {
    color: white;
    font-size: 0.95rem;
    min-width: 50px;
    text-align: center;
    font-family: var(--font-primary);
}

.fullscreen-zoom-btn.reset {
    font-size: 1.1em;
}

.fullscreen-caption {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    text-align: center;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 25px;
    border-radius: 8px;
    z-index: 10001;
}

.fullscreen-entity-name {
    font-size: 1.3rem;
    color: white;
    margin-bottom: 3px;
}

.demon-item .item-history {
    border-left-color: var(--ember);
}

.demon-item .item-history strong {
    color: var(--ember);
}

.meta-tag.direction {
    background: rgba(155, 89, 182, 0.1);
    border-color: rgba(155, 89, 182, 0.3);
    color: #b57edc;
}

/* ========== MAGICAL ALPHABETS STYLES ========== */

.alphabet-item .item-history {
    border-left-color: var(--mystic-purple);
}

.alphabet-item .item-history strong,
.alphabet-item .item-usage strong,
.alphabet-full-chart strong {
    color: var(--mystic-purple);
}

/* Character Samples Preview */
.alphabet-preview {
    margin: 15px 0;
}

.character-samples {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.sample-char {
    font-size: 1.8rem;
    padding: 8px 12px;
    background: rgba(155, 89, 182, 0.15);
    border: 1px solid rgba(155, 89, 182, 0.3);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: default;
    transition: all 0.2s ease;
}

.sample-char:hover {
    background: rgba(155, 89, 182, 0.25);
    transform: scale(1.1);
}

.more-chars {
    font-size: 1.2rem;
    color: var(--text-muted);
    padding: 8px;
}

/* Character Chart */
.alphabet-full-chart {
    display: none;
    margin-top: 20px;
}

.database-item.expanded .alphabet-full-chart {
    display: block;
}

.character-chart {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    margin-top: 15px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 1px solid rgba(155, 89, 182, 0.2);
}

.chart-char {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    background: rgba(155, 89, 182, 0.1);
    border: 1px solid rgba(155, 89, 182, 0.25);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.chart-char:hover {
    background: rgba(155, 89, 182, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(155, 89, 182, 0.2);
}

.char-symbol {
    font-size: 1.6rem;
    margin-bottom: 5px;
    color: var(--text-primary);
}

.char-symbol.large {
    font-size: 2.2rem;
    margin-bottom: 8px;
}

.char-key {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--mystic-purple);
    background: rgba(155, 89, 182, 0.15);
    padding: 2px 8px;
    border-radius: 3px;
}

.char-name {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 4px;
    text-align: center;
}

.char-meaning {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 2px;
    text-align: center;
}

.char-value,
.char-planet,
.char-element,
.char-tree {
    font-size: 0.6rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Large Chart for Detail View */
.large-chart {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
}

.large-chart .chart-char {
    padding: 15px;
}

/* Notable Words */
.notable-words,
.alphabet-notable-words {
    display: none;
    margin-top: 15px;
}

.database-item.expanded .notable-words {
    display: block;
}

.words-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.notable-word {
    display: flex;
    flex-direction: column;
    padding: 10px 15px;
    background: rgba(155, 89, 182, 0.1);
    border: 1px solid rgba(155, 89, 182, 0.25);
    border-radius: 6px;
}

.word-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    font-family: monospace;
}

.word-meaning {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.word-usage {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 4px;
}

/* Words Grid for Detail View */
.words-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.notable-word-card {
    padding: 15px;
    background: rgba(155, 89, 182, 0.1);
    border: 1px solid rgba(155, 89, 182, 0.25);
    border-radius: 8px;
}

/* Translator View */
.alphabet-translator-view {
    max-width: 800px;
    margin: 0 auto;
}

.translator-description {
    color: var(--text-secondary);
    margin-bottom: 25px;
    text-align: center;
}

.translator-controls {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.translator-controls .control-group {
    flex: 1;
    min-width: 200px;
}

.translator-controls label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-secondary);
}

.alphabet-select {
    width: 100%;
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(155, 89, 182, 0.3);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
}

.alphabet-select:focus {
    outline: none;
    border-color: var(--mystic-purple);
    box-shadow: 0 0 10px rgba(155, 89, 182, 0.3);
}

.translator-input {
    width: 100%;
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(155, 89, 182, 0.3);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.translator-input:focus {
    outline: none;
    border-color: var(--mystic-purple);
    box-shadow: 0 0 10px rgba(155, 89, 182, 0.3);
}

.translation-output {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.output-section {
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(155, 89, 182, 0.2);
    border-radius: 8px;
}

.output-section h3 {
    font-size: 0.9rem;
    color: var(--mystic-purple);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.original-text {
    font-size: 1.4rem;
    color: var(--text-primary);
    letter-spacing: 2px;
}

.translated-text {
    font-size: 2rem;
    color: var(--text-primary);
    letter-spacing: 4px;
    line-height: 1.6;
    word-break: break-all;
}

.trans-char {
    display: inline-block;
    transition: transform 0.2s ease;
}

.trans-char:hover {
    transform: scale(1.2);
    color: var(--mystic-purple);
}

.placeholder {
    color: var(--text-muted);
    font-style: italic;
}

/* Character Breakdown */
.character-breakdown {
    background: rgba(155, 89, 182, 0.05);
}

.character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

.breakdown-char {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px;
    background: rgba(155, 89, 182, 0.1);
    border: 1px solid rgba(155, 89, 182, 0.2);
    border-radius: 6px;
}

.breakdown-char .orig {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.breakdown-char .arrow {
    color: var(--mystic-purple);
    margin: 5px 0;
}

.breakdown-char .trans {
    font-size: 1.6rem;
    color: var(--text-primary);
}

.breakdown-char .name {
    font-size: 0.7rem;
    color: var(--mystic-purple);
    margin-top: 5px;
    font-weight: 600;
}

.breakdown-char .meaning {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
}

/* Gematria Section */
.gematria-section {
    margin-top: 25px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.15), rgba(255, 107, 53, 0.1));
    border: 1px solid rgba(155, 89, 182, 0.3);
    border-radius: 8px;
}

.gematria-section h3 {
    font-size: 0.9rem;
    color: var(--mystic-purple);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.gematria-total {
    font-size: 1.4rem;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.gematria-total strong {
    font-size: 2rem;
    color: var(--mystic-purple);
}

.gematria-breakdown {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-family: monospace;
}

/* Alphabet Detail View */
.alphabet-detail-view {
    max-width: 900px;
    margin: 0 auto;
}

.alphabet-alt-names {
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 15px;
}

.alphabet-meta-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.alphabet-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 30px;
}

.detail-chart {
    margin-bottom: 30px;
}

.detail-chart h3 {
    color: var(--mystic-purple);
    margin-bottom: 15px;
}

.alphabet-history,
.alphabet-usage,
.alphabet-notable-words,
.alphabet-bibliography {
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border-left: 3px solid var(--mystic-purple);
}

.alphabet-history h3,
.alphabet-usage h3,
.alphabet-notable-words h3,
.alphabet-bibliography h3 {
    color: var(--mystic-purple);
    margin-bottom: 15px;
}

.history-content p {
    margin-bottom: 15px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.alphabet-usage ul,
.alphabet-bibliography ul {
    list-style: none;
    padding: 0;
}

.alphabet-usage li,
.alphabet-bibliography li {
    padding: 8px 0;
    padding-left: 20px;
    position: relative;
    color: var(--text-secondary);
}

.alphabet-usage li::before {
    content: '✦';
    position: absolute;
    left: 0;
    color: var(--mystic-purple);
}

.alphabet-bibliography li::before {
    content: '📖';
    position: absolute;
    left: 0;
}

.alphabet-source {
    text-align: center;
    margin-top: 30px;
}

.source-link {
    display: inline-block;
    padding: 12px 30px;
    background: linear-gradient(135deg, var(--mystic-purple), #8e44ad);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.source-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.4);
}

/* Item Usage */
.item-usage {
    display: none;
    margin-top: 15px;
}

.database-item.expanded .item-usage {
    display: block;
}

.item-usage ul {
    list-style: none;
    padding: 0;
    margin-top: 10px;
}

.item-usage li {
    padding: 6px 0;
    padding-left: 20px;
    position: relative;
    color: var(--text-secondary);
}

.item-usage li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--mystic-purple);
}

/* ========== ALPHABET ANALYSIS TOOL ========== */

.alphabet-analysis-view {
    max-width: 1000px;
    margin: 0 auto;
}

.analysis-description {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 30px;
}

.analysis-controls {
    background: rgba(0, 0, 0, 0.2);
    padding: 25px;
    border-radius: 10px;
    border: 1px solid rgba(155, 89, 182, 0.2);
    margin-bottom: 30px;
}

.analysis-controls label {
    display: block;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.alphabet-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: rgba(155, 89, 182, 0.1);
    border: 1px solid rgba(155, 89, 182, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.checkbox-label:hover {
    background: rgba(155, 89, 182, 0.2);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--mystic-purple);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-text {
    color: var(--mystic-purple);
    font-weight: 600;
}

.btn-analysis {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    padding: 15px 30px;
    background: linear-gradient(135deg, var(--mystic-purple), #8e44ad);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-analysis:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(155, 89, 182, 0.4);
}

.analysis-results {
    min-height: 100px;
}

.results-placeholder,
.results-error {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-style: italic;
}

.results-error {
    color: #e74c3c;
}

/* Quick Analysis Section */
.quick-analysis-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid rgba(155, 89, 182, 0.2);
}

.quick-analysis-section h3 {
    color: var(--mystic-purple);
    margin-bottom: 20px;
}

.quick-analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
}

.quick-analysis-card {
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(155, 89, 182, 0.2);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.quick-analysis-card:hover {
    border-color: var(--mystic-purple);
    transform: translateY(-2px);
}

.quick-analysis-card h4 {
    color: var(--text-primary);
    margin-bottom: 10px;
    font-size: 1rem;
}

.analysis-stats {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.analysis-stats .stat {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.complexity-simple { color: #2ecc71; }
.complexity-moderate { color: #f39c12; }
.complexity-highly-complex { color: #9b59b6; }

.analysis-features {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.analysis-features .feature {
    font-size: 0.7rem;
    padding: 3px 8px;
    background: rgba(155, 89, 182, 0.15);
    border-radius: 4px;
    color: var(--text-secondary);
}

/* Comparison Results */
.comparison-results {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    padding: 25px;
}

.comparison-header h3 {
    color: var(--mystic-purple);
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.3rem;
}

.comparison-overview {
    margin-bottom: 30px;
}

.overview-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.overview-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 30px;
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.2), rgba(155, 89, 182, 0.1));
    border: 1px solid rgba(155, 89, 182, 0.3);
    border-radius: 10px;
    min-width: 120px;
}

.overview-card .card-name {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.overview-card .card-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--mystic-purple);
}

.overview-card .card-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Analysis Sections */
.analysis-section {
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border-left: 3px solid var(--mystic-purple);
}

.analysis-section h4 {
    color: var(--mystic-purple);
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.section-intro {
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.no-matches {
    color: var(--text-muted);
    font-style: italic;
}

/* Symbol Matches */
.symbol-match-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.symbol-match-card {
    padding: 15px;
    background: rgba(155, 89, 182, 0.1);
    border: 1px solid rgba(155, 89, 182, 0.25);
    border-radius: 8px;
}

.match-symbol {
    display: block;
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.match-occurrences {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.occurrence {
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.occ-alphabet {
    display: block;
    font-weight: 600;
    color: var(--mystic-purple);
    font-size: 0.85rem;
}

.occ-key {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-right: 10px;
}

.occ-name {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.occ-meaning {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 4px;
}

/* Usage List */
.usage-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.usage-item {
    padding: 12px 15px;
    background: rgba(155, 89, 182, 0.1);
    border-radius: 6px;
}

.usage-text {
    display: block;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.usage-alphabets {
    font-size: 0.8rem;
    color: var(--mystic-purple);
}

/* Similarity List */
.similarity-list,
.connection-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.similarity-item,
.connection-item {
    padding: 15px;
    background: rgba(155, 89, 182, 0.1);
    border-radius: 8px;
}

.similarity-type,
.connection-type {
    display: inline-block;
    padding: 4px 12px;
    background: var(--mystic-purple);
    color: white;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.similarity-alphabets,
.connection-alphabets {
    display: block;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.connection-source,
.connection-derived {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.similarity-desc,
.connection-desc {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.6;
    margin: 0;
}

/* Detailed Comparison */
.similarity-score {
    text-align: center;
    margin-bottom: 25px;
}

.score-label {
    color: var(--text-secondary);
    margin-right: 10px;
}

.score-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--mystic-purple);
}

.score-bar {
    width: 100%;
    max-width: 400px;
    height: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    margin: 15px auto 0;
    overflow: hidden;
}

.score-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--mystic-purple), #8e44ad);
    border-radius: 5px;
    transition: width 0.5s ease;
}

/* Side by Side Grid */
.side-by-side-grid {
    margin-top: 20px;
    border: 1px solid rgba(155, 89, 182, 0.2);
    border-radius: 8px;
    overflow: hidden;
}

.grid-header {
    display: grid;
    grid-template-columns: 60px 1fr 1fr 60px;
    padding: 12px 15px;
    background: rgba(155, 89, 182, 0.2);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.grid-row {
    display: grid;
    grid-template-columns: 60px 1fr 1fr 60px;
    padding: 10px 15px;
    border-top: 1px solid rgba(155, 89, 182, 0.1);
    align-items: center;
}

.grid-row.match {
    background: rgba(46, 204, 113, 0.1);
}

.grid-row.no-match {
    background: rgba(231, 76, 60, 0.05);
}

.row-key {
    font-weight: 600;
    color: var(--text-secondary);
}

.row-symbol {
    font-size: 1.4rem;
    text-align: center;
}

.row-match {
    text-align: center;
    font-size: 1.2rem;
}

.grid-row.match .row-match {
    color: #2ecc71;
}

.grid-row.no-match .row-match {
    color: #e74c3c;
}

/* Unique Characters */
.unique-chars-section {
    display: flex;
    gap: 30px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.unique-chars {
    flex: 1;
    min-width: 200px;
}

.unique-chars h5 {
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.unique-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.unique-char {
    font-size: 1.3rem;
    padding: 8px 12px;
    background: rgba(155, 89, 182, 0.15);
    border: 1px solid rgba(155, 89, 182, 0.25);
    border-radius: 6px;
    cursor: default;
}

/* Origin Grid */
.origin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.origin-card {
    padding: 15px;
    background: rgba(155, 89, 182, 0.1);
    border: 1px solid rgba(155, 89, 182, 0.2);
    border-radius: 8px;
    text-align: center;
}

.origin-name {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.origin-value {
    display: block;
    color: var(--mystic-purple);
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.period-value {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ========== ANGEL DATABASE STYLES ========== */

.angel-item .item-title {
    color: var(--cosmic-blue);
}

.angel-item:hover {
    border-color: rgba(74, 158, 255, 0.4);
}

.angel-item.expanded {
    border-color: var(--cosmic-blue);
}

.angel-item {
    border-left: 3px solid var(--cosmic-blue);
}

.angel-item .item-history {
    border-left-color: var(--cosmic-blue);
}

.angel-item .item-history strong {
    color: var(--cosmic-blue);
}

/* Meta tag for sephira */
.meta-tag.sephira {
    background: rgba(255, 215, 0, 0.1);
    border-color: rgba(255, 215, 0, 0.3);
    color: var(--gold);
}

.meta-tag.choir {
    background: rgba(74, 158, 255, 0.1);
    border-color: rgba(74, 158, 255, 0.3);
    color: var(--cosmic-blue);
}

/* Angel images - small preview in listing */
.angel-images {
    flex-shrink: 0;
    width: 100px;
}

.angel-image-preview {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid rgba(74, 158, 255, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    background: rgba(255, 255, 255, 0.05);
}

/* Angel expanded image gallery */
.angel-item .item-images-expanded {
    border-color: rgba(74, 158, 255, 0.2);
}

.angel-image-large img {
    max-width: 500px;
    max-height: 600px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    border: 2px solid rgba(74, 158, 255, 0.4);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    background: rgba(255, 255, 255, 0.03);
    padding: 12px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.angel-image-large img:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.6);
}

/* ========== HIERARCHY VISUALIZATION STYLES ========== */

.hierarchy-view {
    max-width: 1000px;
    margin: 0 auto;
}

.hierarchy-description {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 30px;
}

/* Hierarchy Tabs */
.hierarchy-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.hierarchy-tab {
    padding: 12px 24px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(74, 158, 255, 0.3);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.hierarchy-tab:hover {
    background: rgba(74, 158, 255, 0.15);
    border-color: var(--cosmic-blue);
    color: var(--text-primary);
}

.hierarchy-tab.active {
    background: linear-gradient(135deg, rgba(74, 158, 255, 0.3), rgba(74, 158, 255, 0.15));
    border-color: var(--cosmic-blue);
    color: var(--cosmic-blue);
    font-weight: 600;
}

/* Demon hierarchy tabs */
.hierarchy-tab.demon-tab {
    border-color: rgba(255, 107, 53, 0.3);
}

.hierarchy-tab.demon-tab:hover {
    background: rgba(255, 107, 53, 0.15);
    border-color: var(--ember);
}

.hierarchy-tab.demon-tab.active {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.3), rgba(255, 107, 53, 0.15));
    border-color: var(--ember);
    color: var(--ember);
}

/* Hierarchy Content */
.hierarchy-content {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 25px;
    border: 1px solid rgba(74, 158, 255, 0.2);
}

.hierarchy-content.demon-hierarchy {
    border-color: rgba(255, 107, 53, 0.2);
}

.hierarchy-source {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 25px;
    font-size: 0.9rem;
}

/* Triads (Christian Hierarchy) */
.hierarchy-triads {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.hierarchy-triad {
    background: linear-gradient(135deg, rgba(74, 158, 255, 0.1), rgba(0, 0, 0, 0.1));
    border: 1px solid rgba(74, 158, 255, 0.25);
    border-radius: 10px;
    padding: 20px;
    position: relative;
}

.hierarchy-triad:nth-child(1) {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 215, 0, 0.05));
    border-color: rgba(255, 215, 0, 0.4);
}

.hierarchy-triad:nth-child(2) {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.15), rgba(192, 192, 192, 0.05));
    border-color: rgba(192, 192, 192, 0.4);
}

.hierarchy-triad:nth-child(3) {
    background: linear-gradient(135deg, rgba(74, 158, 255, 0.1), rgba(74, 158, 255, 0.03));
    border-color: rgba(74, 158, 255, 0.3);
}

.triad-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.triad-name {
    font-family: var(--font-mystical);
    font-size: 1.2rem;
    color: var(--gold);
}

.hierarchy-triad:nth-child(2) .triad-name {
    color: var(--silver);
}

.hierarchy-triad:nth-child(3) .triad-name {
    color: var(--cosmic-blue);
}

.triad-level {
    font-size: 0.8rem;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: var(--text-secondary);
}

.triad-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 15px;
    line-height: 1.5;
}

.triad-choirs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.choir-badge {
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    font-size: 0.95rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.choir-badge:hover {
    background: rgba(74, 158, 255, 0.2);
    border-color: var(--cosmic-blue);
    transform: translateY(-2px);
}

.hierarchy-triad:nth-child(1) .choir-badge:hover {
    background: rgba(255, 215, 0, 0.2);
    border-color: var(--gold);
}

/* Kabbalistic Orders */
.hierarchy-orders {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hierarchy-order {
    display: grid;
    grid-template-columns: 140px 1fr 200px;
    gap: 15px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border-left: 4px solid var(--gold);
    align-items: center;
}

.order-sephira {
    font-weight: 600;
    color: var(--gold);
    font-size: 0.95rem;
}

.order-name {
    color: var(--text-primary);
    font-size: 1.05rem;
}

.order-meaning {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
    text-align: right;
}

/* Islamic Categories */
.hierarchy-categories {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.hierarchy-category {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 20px;
    border-left: 4px solid var(--emerald);
}

.category-name {
    font-family: var(--font-mystical);
    font-size: 1.1rem;
    color: var(--emerald);
    margin-bottom: 8px;
}

.category-arabic {
    display: inline-block;
    margin-left: 10px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.category-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.category-examples {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.example-angel {
    padding: 5px 12px;
    background: rgba(46, 204, 113, 0.15);
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--text-primary);
}

/* ========== DEMON HIERARCHY (GOETIC RANKS) ========== */

.demon-rank-pyramid {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.rank-level {
    width: 100%;
    padding: 15px 20px;
    background: linear-gradient(90deg, rgba(255, 107, 53, 0.2), rgba(0, 0, 0, 0.1), rgba(255, 107, 53, 0.2));
    border-radius: 8px;
    border: 1px solid rgba(255, 107, 53, 0.3);
    text-align: center;
    transition: all 0.2s ease;
}

.rank-level:hover {
    background: linear-gradient(90deg, rgba(255, 107, 53, 0.3), rgba(0, 0, 0, 0.15), rgba(255, 107, 53, 0.3));
    transform: scale(1.02);
}

.rank-level:nth-child(1) { max-width: 60%; }
.rank-level:nth-child(2) { max-width: 70%; }
.rank-level:nth-child(3) { max-width: 80%; }
.rank-level:nth-child(4) { max-width: 90%; }
.rank-level:nth-child(5) { max-width: 100%; }

.rank-title {
    font-family: var(--font-mystical);
    font-size: 1.1rem;
    color: var(--ember);
    margin-bottom: 5px;
}

.rank-count {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.rank-demons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.rank-demon {
    padding: 4px 10px;
    background: rgba(255, 107, 53, 0.15);
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.rank-demon:hover {
    background: rgba(255, 107, 53, 0.3);
    transform: translateY(-1px);
}

/* ========== TRADITIONS VISUALIZATION ========== */

.traditions-view {
    max-width: 1000px;
    margin: 0 auto;
}

.traditions-description {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 30px;
}

/* Tradition Cards */
.traditions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.tradition-card {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(74, 158, 255, 0.2);
    transition: all 0.3s ease;
}

.tradition-card:hover {
    border-color: var(--cosmic-blue);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.tradition-card.demon-tradition {
    border-color: rgba(255, 107, 53, 0.2);
}

.tradition-card.demon-tradition:hover {
    border-color: var(--ember);
}

.tradition-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.tradition-name {
    font-family: var(--font-mystical);
    font-size: 1.2rem;
    color: var(--cosmic-blue);
}

.tradition-card.demon-tradition .tradition-name {
    color: var(--ember);
}

.tradition-count {
    padding: 5px 12px;
    background: rgba(74, 158, 255, 0.2);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--cosmic-blue);
}

.tradition-card.demon-tradition .tradition-count {
    background: rgba(255, 107, 53, 0.2);
    color: var(--ember);
}

.tradition-entities {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tradition-entity {
    padding: 6px 12px;
    background: rgba(74, 158, 255, 0.1);
    border: 1px solid rgba(74, 158, 255, 0.2);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.tradition-entity:hover {
    background: rgba(74, 158, 255, 0.25);
    border-color: var(--cosmic-blue);
}

.tradition-card.demon-tradition .tradition-entity {
    background: rgba(255, 107, 53, 0.1);
    border-color: rgba(255, 107, 53, 0.2);
}

.tradition-card.demon-tradition .tradition-entity:hover {
    background: rgba(255, 107, 53, 0.25);
    border-color: var(--ember);
}

/* Tradition Comparison Bar Chart */
.tradition-comparison {
    margin-top: 40px;
    padding: 25px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 1px solid rgba(74, 158, 255, 0.2);
}

.tradition-comparison.demon-comparison {
    border-color: rgba(255, 107, 53, 0.2);
}

.comparison-title {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 25px;
    font-size: 1.1rem;
}

.comparison-bars {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.comparison-bar-item {
    display: grid;
    grid-template-columns: 140px 1fr 50px;
    gap: 15px;
    align-items: center;
}

.bar-label {
    color: var(--text-primary);
    font-size: 0.9rem;
    text-align: right;
}

.bar-container {
    height: 28px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--cosmic-blue), #2980b9);
    border-radius: 6px;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
}

.tradition-comparison.demon-comparison .bar-fill {
    background: linear-gradient(90deg, var(--ember), #c0392b);
}

.bar-count {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
}

/* ========== HIERARCHY DIAGRAM STYLES ========== */

.hierarchy-diagram-container {
    width: 100%;
    max-width: 900px;
    margin: 20px auto;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(255, 215, 0, 0.15);
}

.angel-hierarchy-svg,
.demon-hierarchy-svg {
    width: 100%;
    height: auto;
    display: block;
}

.hierarchy-panel {
    display: none;
}

.hierarchy-panel.active {
    display: block;
}

/* Triads Container */
.triads-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.triad {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 20px;
    border-left: 4px solid var(--gold);
}

.triad-1 {
    border-left-color: #ffd700;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(0, 0, 0, 0.2));
}

.triad-2 {
    border-left-color: #c0c0c0;
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.1), rgba(0, 0, 0, 0.2));
}

.triad-3 {
    border-left-color: #4a9eff;
    background: linear-gradient(135deg, rgba(74, 158, 255, 0.1), rgba(0, 0, 0, 0.2));
}

.triad h4 {
    color: var(--gold);
    margin-bottom: 8px;
    font-family: var(--font-mystical);
}

.triad-1 h4 { color: #ffd700; }
.triad-2 h4 { color: #c0c0c0; }
.triad-3 h4 { color: #4a9eff; }

.triad-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.choirs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.choir-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.choir-card:hover {
    background: rgba(255, 215, 0, 0.15);
    transform: translateY(-2px);
}

.choir-rank {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 215, 0, 0.2);
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--gold);
}

.choir-name {
    color: var(--text-primary);
    font-size: 0.95rem;
}

/* Kabbalistic Orders */
.kabbalistic-orders {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.order-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border-left: 4px solid var(--gold);
}

.order-rank {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ffd700, #b8860b);
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: bold;
    color: #0a0a0f;
}

.order-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.order-name {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
}

.order-meaning {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
}

.order-sephira {
    color: var(--gold);
    font-size: 0.8rem;
}

/* Islamic Categories */
.islamic-categories {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.category-card {
    display: flex;
    gap: 15px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    border-left: 4px solid var(--emerald);
}

.category-rank {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    border-radius: 50%;
    font-size: 0.9rem;
    font-weight: bold;
    color: #0a0a0f;
    flex-shrink: 0;
}

.category-info {
    flex: 1;
}

.category-info .category-name {
    color: var(--emerald);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.category-info .category-meaning {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
    margin-bottom: 8px;
}

.category-info .category-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

/* Goetic Rank Pyramid */
.rank-pyramid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin: 25px 0;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
}

.rank-pyramid .rank-level {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 12px 25px;
    background: linear-gradient(90deg,
        rgba(255, 107, 53, 0.1),
        rgba(255, 107, 53, 0.2),
        rgba(255, 107, 53, 0.1)
    );
    border: 1px solid var(--rank-color, #ff6b35);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.rank-pyramid .rank-level:nth-child(1) { width: 50%; }
.rank-pyramid .rank-level:nth-child(2) { width: 60%; }
.rank-pyramid .rank-level:nth-child(3) { width: 70%; }
.rank-pyramid .rank-level:nth-child(4) { width: 80%; }
.rank-pyramid .rank-level:nth-child(5) { width: 90%; }
.rank-pyramid .rank-level:nth-child(6) { width: 100%; }

.rank-pyramid .rank-level:hover {
    transform: scale(1.02);
    background: linear-gradient(90deg,
        rgba(255, 107, 53, 0.2),
        rgba(255, 107, 53, 0.3),
        rgba(255, 107, 53, 0.2)
    );
}

.rank-pyramid .rank-name {
    font-weight: 600;
    color: var(--rank-color, var(--ember));
    font-size: 1rem;
}

.rank-pyramid .rank-count {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Hierarchy Details */
.hierarchy-details {
    margin-top: 25px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.hierarchy-details h4 {
    color: var(--ember);
    margin-bottom: 15px;
    font-size: 1rem;
}

.rank-descriptions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rank-desc {
    padding: 12px 15px;
    background: rgba(255, 107, 53, 0.05);
    border-left: 3px solid var(--ember);
    border-radius: 0 6px 6px 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.rank-desc strong {
    color: var(--ember);
}

/* Grimorium Verum Hierarchy */
.gv-hierarchy {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    padding: 30px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
}

.gv-level {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 40px;
    border-radius: 10px;
    text-align: center;
    transition: all 0.3s ease;
}

.gv-level.emperor {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.3), rgba(255, 0, 0, 0.2));
    border: 2px solid #ff6b35;
    width: 40%;
}

.gv-level.prince {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.2), rgba(128, 128, 128, 0.15));
    border: 2px solid #c0c0c0;
    width: 55%;
}

.gv-level.grand-duke {
    background: linear-gradient(135deg, rgba(184, 115, 51, 0.2), rgba(139, 69, 19, 0.15));
    border: 2px solid #b87333;
    width: 70%;
}

.gv-level:hover {
    transform: scale(1.02);
}

.gv-title {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.gv-name {
    font-size: 1.3rem;
    font-family: var(--font-mystical);
    font-weight: 600;
}

.gv-level.emperor .gv-name { color: #ff6b35; }
.gv-level.prince .gv-name { color: #c0c0c0; }
.gv-level.grand-duke .gv-name { color: #b87333; }

.gv-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 5px;
}

.gv-subordinates {
    margin-top: 10px;
    padding: 15px 30px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    width: 85%;
    text-align: center;
}

.gv-subordinates span {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-style: italic;
}

/* Hierarchy intro text */
.hierarchy-intro {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 25px;
    font-size: 1rem;
    line-height: 1.6;
}

/* Demon hierarchy view specific */
.demon-hierarchy-view .hierarchy-content {
    border-color: rgba(255, 107, 53, 0.2);
}

.demon-hierarchy-view .hierarchy-panel h3 {
    color: var(--ember);
    font-family: var(--font-mystical);
    margin-bottom: 10px;
}

/* Section descriptions */
.section-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

/* Responsive Hierarchy/Traditions */
@media (max-width: 768px) {
    .hierarchy-tabs {
        flex-direction: column;
    }

    .hierarchy-tab {
        width: 100%;
        text-align: center;
    }

    .hierarchy-order {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .order-meaning {
        text-align: left;
    }

    .rank-level {
        max-width: 100% !important;
    }

    .traditions-grid {
        grid-template-columns: 1fr;
    }

    .comparison-bar-item {
        grid-template-columns: 100px 1fr 40px;
    }

    .bar-label {
        font-size: 0.8rem;
    }

    .hierarchy-diagram-container {
        padding: 10px;
    }

    .rank-pyramid .rank-level {
        width: 100% !important;
        padding: 10px 15px;
    }

    .gv-level.emperor,
    .gv-level.prince,
    .gv-level.grand-duke {
        width: 100%;
    }

    .choirs {
        flex-direction: column;
    }

    .choir-card {
        width: 100%;
    }

    .category-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .order-card {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Responsive Database Views */
@media (max-width: 768px) {
    .database-view {
        padding: 15px;
    }

    .database-title {
        font-size: 1.4rem;
    }

    .database-item {
        padding: 15px;
    }

    .item-header {
        flex-direction: column;
    }

    .item-title {
        font-size: 1.1rem;
    }

    .database-search {
        padding: 12px 15px;
        font-size: 0.95rem;
    }

    .item-header-with-cover {
        flex-direction: column;
    }

    .item-cover {
        width: 100%;
        max-width: 200px;
        margin: 0 auto 15px;
    }

    .demon-images {
        width: 50px;
    }

    .demon-seal-preview {
        width: 50px;
        height: 50px;
    }

    .item-images-expanded {
        padding: 15px;
        gap: 15px;
    }

    .demon-image-large img {
        max-width: 150px;
        max-height: 180px;
    }

    .item-history {
        padding: 12px;
    }

    .history-text p {
        text-align: left;
    }
}

/* ========== GLOBAL SEARCH STYLES ========== */

.global-search-view {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.global-search-view .database-intro {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.global-search-input {
    max-width: 100%;
    font-size: 1.1rem;
    padding: 18px 25px;
}

.global-results-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding: 15px 20px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.global-results-summary .result-count {
    font-size: 1.1rem;
    color: var(--gold);
    font-weight: bold;
}

.global-results-summary .result-types {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.type-badge {
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
}

.type-badge.angel {
    background: rgba(255, 215, 0, 0.2);
    color: var(--gold);
}

.type-badge.demon {
    background: rgba(255, 107, 53, 0.2);
    color: var(--ember);
}

.type-badge.grimoire {
    background: rgba(106, 13, 173, 0.2);
    color: #a855f7;
}

.type-badge.alphabet {
    background: rgba(74, 158, 255, 0.2);
    color: var(--cosmic-blue);
}

.type-badge.symbol {
    background: rgba(46, 204, 113, 0.2);
    color: var(--emerald);
}

.result-section {
    margin-bottom: 30px;
}

.result-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mystical);
    color: var(--text-primary);
    font-size: 1.3rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}

.result-section-title .section-icon {
    font-size: 1.5rem;
}

.global-result mark {
    background: rgba(255, 215, 0, 0.4);
    color: var(--text-primary);
    padding: 0 2px;
    border-radius: 2px;
}

.symbol-item .item-symbol-content {
    display: none;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 215, 0, 0.1);
}

.symbol-item.expanded .item-symbol-content {
    display: block;
}

.symbol-item .item-action {
    display: block !important;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 215, 0, 0.1);
}

.view-symbol-btn {
    background: linear-gradient(135deg, var(--gold-dark), var(--gold));
    color: var(--bg-primary);
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    position: relative;
    z-index: 10;
    pointer-events: auto;
}

.view-symbol-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.view-symbol-btn:active {
    transform: translateY(0);
}

.alphabet-preview {
    font-size: 1.5rem;
    color: var(--gold);
    margin-top: 10px;
    opacity: 0.8;
}

/* ========== SIGIL GENERATOR STYLES ========== */

.sigil-generator-view {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.sigil-description {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 30px;
    line-height: 1.6;
}

.sigil-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    padding: 25px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 1px solid rgba(255, 215, 0, 0.15);
}

.sigil-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sigil-input-group label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.sigil-input-group input,
.sigil-input-group select {
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s ease;
}

.sigil-input-group input:focus,
.sigil-input-group select:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
}

.sigil-input-group input::placeholder {
    color: var(--text-muted);
}

.sigil-input-group select option {
    background: #1a1a2e;
    color: var(--text-primary);
}

.sigil-generate-btn {
    padding: 14px 30px;
    background: linear-gradient(135deg, var(--gold), #b8860b);
    border: none;
    border-radius: 8px;
    color: #0a0a0f;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    align-self: end;
}

.sigil-generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.3);
}

.sigil-generate-btn:active {
    transform: translateY(0);
}

.sigil-display-container {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border: 1px solid rgba(255, 215, 0, 0.15);
    padding: 20px;
    margin-bottom: 20px;
}

.sigil-zoom-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.zoom-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 6px;
    color: var(--gold);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.zoom-btn:hover {
    background: rgba(255, 215, 0, 0.2);
    border-color: var(--gold);
}

#sigil-zoom-level {
    min-width: 60px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.sigil-display-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 450px;
    background: radial-gradient(circle at center, rgba(255, 215, 0, 0.03), transparent 70%);
    border-radius: 8px;
    overflow: hidden;
}

.sigil-svg {
    width: 100%;
    max-width: 500px;
    height: auto;
    transition: transform 0.3s ease;
    transform-origin: center center;
}

.sigil-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawSigil 2s ease forwards;
}

@keyframes drawSigil {
    to {
        stroke-dashoffset: 0;
    }
}

.sigil-start {
    animation: pulseStart 2s ease infinite;
}

@keyframes pulseStart {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.wheel-letter {
    font-family: var(--font-mystical), serif;
}

.sigil-info {
    margin-top: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border-left: 3px solid var(--gold);
}

.sigil-info p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.95rem;
}

.sigil-result-info p {
    margin: 5px 0;
}

.sigil-result-info strong {
    color: var(--gold);
}

.sigil-error {
    color: #ff6b6b !important;
}

.sigil-export-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.export-btn {
    padding: 12px 25px;
    background: rgba(74, 158, 255, 0.15);
    border: 1px solid rgba(74, 158, 255, 0.3);
    border-radius: 8px;
    color: var(--cosmic-blue);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.export-btn:hover {
    background: rgba(74, 158, 255, 0.25);
    border-color: var(--cosmic-blue);
    transform: translateY(-2px);
}

/* Responsive Sigil Generator */
@media (max-width: 768px) {
    .sigil-controls {
        grid-template-columns: 1fr;
    }

    .sigil-generate-btn {
        width: 100%;
    }

    .sigil-display-wrapper {
        min-height: 350px;
    }

    .sigil-svg {
        max-width: 100%;
    }

    .sigil-export-controls {
        flex-direction: column;
    }

    .export-btn {
        width: 100%;
        text-align: center;
    }
}

/* ========== GLOBAL ZOOM CONTROLS ========== */

.canvas-zoom-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 8px;
    border: 1px solid rgba(255, 215, 0, 0.2);
    z-index: 100;
}

.canvas-zoom-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 6px;
    color: var(--gold);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.canvas-zoom-btn:hover {
    background: rgba(255, 215, 0, 0.2);
    border-color: var(--gold);
}

.canvas-zoom-level {
    min-width: 50px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ========== TAROT DATABASE STYLES ========== */

.tarot-item {
    position: relative;
}

.tarot-item.major-arcana {
    border-left: 3px solid var(--gold);
}

.tarot-item.minor-arcana {
    border-left: 3px solid var(--cosmic-blue);
}

/* Tarot card image styles */
.tarot-item .item-cover.tarot-card-image {
    width: 80px;
    height: 130px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid rgba(255, 215, 0, 0.3);
    background: var(--bg-tertiary);
}

.tarot-item .item-cover.tarot-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tarot-image-expanded {
    display: none;
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
}

.tarot-item.expanded .tarot-image-expanded {
    display: block;
}

.tarot-image-large {
    position: relative;
    max-width: 300px;
    margin: 0 auto;
    text-align: center;
}

.tarot-image-large img {
    max-width: 100%;
    max-height: 450px;
    border-radius: 8px;
    border: 3px solid rgba(255, 215, 0, 0.4);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tarot-image-large img:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
}

.tarot-image-large .image-expand-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 215, 0, 0.5);
    border-radius: 6px;
    color: var(--gold);
    font-size: 1.1rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.tarot-image-large:hover .image-expand-btn {
    opacity: 1;
}

.tarot-image-large .image-expand-btn:hover {
    background: rgba(255, 215, 0, 0.2);
}

.tarot-image-large .image-caption {
    display: block;
    margin-top: 0.75rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
}

.tarot-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--gold);
    color: var(--bg-primary);
    border-radius: 50%;
    font-weight: bold;
    font-size: 0.85rem;
    margin-right: 0.5rem;
}

.tarot-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.75rem 0;
}

.tarot-keywords .keyword {
    background: rgba(255, 215, 0, 0.15);
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: var(--gold);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
}

.tarot-meanings {
    display: none;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1rem 0;
}

.tarot-item.expanded .tarot-meanings {
    display: grid;
}

.meaning-upright,
.meaning-reversed {
    padding: 1rem;
    border-radius: 8px;
}

.meaning-upright {
    background: rgba(46, 204, 113, 0.1);
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.meaning-reversed {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.meaning-upright strong,
.meaning-reversed strong {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.meaning-upright strong {
    color: var(--emerald);
}

.meaning-reversed strong {
    color: #e74c3c;
}

.tarot-symbolism,
.tarot-kabbalah,
.tarot-esoteric,
.tarot-golden-dawn,
.tarot-esoteric-title,
.tarot-numerology {
    display: none;
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border-left: 3px solid var(--mystic-purple);
}

.tarot-item.expanded .tarot-symbolism,
.tarot-item.expanded .tarot-kabbalah,
.tarot-item.expanded .tarot-esoteric,
.tarot-item.expanded .tarot-golden-dawn,
.tarot-item.expanded .tarot-esoteric-title,
.tarot-item.expanded .tarot-numerology {
    display: block;
}

.tarot-kabbalah {
    border-left-color: var(--gold);
}

.tarot-esoteric {
    border-left-color: var(--cosmic-blue);
}

.tarot-golden-dawn {
    border-left-color: #e74c3c;
}

/* Suit colors */
.item-rank.suit-wands {
    background: rgba(255, 107, 53, 0.2);
    color: var(--ember);
}

.item-rank.suit-cups {
    background: rgba(74, 158, 255, 0.2);
    color: var(--cosmic-blue);
}

.item-rank.suit-swords {
    background: rgba(192, 192, 192, 0.2);
    color: var(--silver);
}

.item-rank.suit-pentacles {
    background: rgba(46, 204, 113, 0.2);
    color: var(--emerald);
}

.item-rank.major {
    background: rgba(255, 215, 0, 0.2);
    color: var(--gold);
}

/* Suit header */
.suit-header {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(255, 215, 0, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.suit-element {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.suit-attribute {
    color: var(--gold);
    font-style: italic;
}

/* Correspondences view */
.tarot-correspondences-view .database-intro {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.correspondence-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.correspondence-tab {
    padding: 0.75rem 1.25rem;
    background: transparent;
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.correspondence-tab:hover {
    background: rgba(255, 215, 0, 0.1);
    color: var(--gold);
}

.correspondence-tab.active {
    background: rgba(255, 215, 0, 0.15);
    border-color: var(--gold);
    color: var(--gold);
}

.correspondence-panel {
    display: none;
}

.correspondence-panel.active {
    display: block;
}

.correspondence-panel h3 {
    color: var(--gold);
    margin-bottom: 1rem;
}

/* Element grid */
.element-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.element-section {
    padding: 1.25rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
}

.element-section h4 {
    color: var(--gold);
    margin-bottom: 0.75rem;
}

.element-section.element-fire {
    border: 1px solid rgba(255, 107, 53, 0.3);
}

.element-section.element-water {
    border: 1px solid rgba(74, 158, 255, 0.3);
}

.element-section.element-air {
    border: 1px solid rgba(192, 192, 192, 0.3);
}

.element-section.element-earth {
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.element-suit,
.element-attr {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.element-cards ul {
    margin: 0.5rem 0;
    padding-left: 1rem;
}

.element-cards li {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0.25rem 0;
}

/* Zodiac grid */
.zodiac-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.zodiac-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 8px;
    text-align: center;
}

.zodiac-sign {
    color: var(--gold);
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.zodiac-tarot {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.zodiac-none {
    color: var(--text-muted);
}

/* Planet grid */
.planet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.planet-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(74, 158, 255, 0.2);
    border-radius: 8px;
    text-align: center;
}

.planet-name {
    color: var(--cosmic-blue);
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.planet-tarot {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.planet-none {
    color: var(--text-muted);
}

/* Kabbalah grid */
.kabbalah-intro {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.kabbalah-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
}

.kabbalah-card {
    display: grid;
    grid-template-columns: 40px 1fr auto auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 215, 0, 0.15);
    border-radius: 6px;
}

.kabbalah-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--gold);
    color: var(--bg-primary);
    border-radius: 50%;
    font-weight: bold;
    font-size: 0.85rem;
}

.kabbalah-name {
    color: var(--text-primary);
    font-weight: 500;
}

.kabbalah-hebrew {
    color: var(--gold);
    font-size: 0.9rem;
}

.kabbalah-path {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Suits grid */
.suits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.suit-card {
    padding: 1.5rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
}

.suit-card h4 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.suit-card.suit-wands {
    border: 2px solid rgba(255, 107, 53, 0.3);
}

.suit-card.suit-wands h4 {
    color: var(--ember);
}

.suit-card.suit-cups {
    border: 2px solid rgba(74, 158, 255, 0.3);
}

.suit-card.suit-cups h4 {
    color: var(--cosmic-blue);
}

.suit-card.suit-swords {
    border: 2px solid rgba(192, 192, 192, 0.3);
}

.suit-card.suit-swords h4 {
    color: var(--silver);
}

.suit-card.suit-pentacles {
    border: 2px solid rgba(46, 204, 113, 0.3);
}

.suit-card.suit-pentacles h4 {
    color: var(--emerald);
}

.suit-details p {
    margin: 0.5rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.suit-details strong {
    color: var(--text-primary);
}

/* Tarot in global search results */
.type-badge.tarot {
    background: rgba(106, 13, 173, 0.2);
    color: var(--mystic-purple);
}

.tarot-meanings-preview {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.meaning-upright-preview,
.meaning-reversed-preview {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.meaning-upright-preview strong {
    color: var(--emerald);
}

.meaning-reversed-preview strong {
    color: #e74c3c;
}

/* Light theme adjustments for tarot */
[data-theme="light"] .tarot-number {
    background: var(--gold-dark);
    color: white;
}

[data-theme="light"] .kabbalah-number {
    background: var(--gold-dark);
    color: white;
}

[data-theme="light"] .tarot-keywords .keyword {
    background: rgba(153, 102, 0, 0.1);
    border-color: rgba(153, 102, 0, 0.3);
}

[data-theme="light"] .meaning-upright {
    background: rgba(46, 204, 113, 0.08);
}

[data-theme="light"] .meaning-reversed {
    background: rgba(231, 76, 60, 0.08);
}

/* Responsive tarot styles */
@media (max-width: 768px) {
    .tarot-meanings {
        grid-template-columns: 1fr;
    }

    .correspondence-tabs {
        flex-direction: column;
    }

    .kabbalah-grid {
        grid-template-columns: 1fr;
    }

    .kabbalah-card {
        grid-template-columns: 40px 1fr;
    }

    .kabbalah-hebrew,
    .kabbalah-path {
        grid-column: 2;
    }
}

/* ========================================
   ASTROLOGY STYLES
   ======================================== */

.astrology-view {
    padding: 2rem;
}

/* Overview Grid */
.astrology-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.overview-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.overview-section:hover {
    background: rgba(255, 215, 0, 0.05);
    border-color: var(--gold);
    transform: translateY(-2px);
}

.overview-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.overview-icon svg {
    width: 100%;
    height: 100%;
}

.overview-icon .large-symbol {
    font-size: 3rem;
    color: var(--gold);
}

.overview-icon.elements-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    font-size: 1.5rem;
}

.overview-section h3 {
    color: var(--gold);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.overview-section p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.overview-symbols {
    font-size: 1.25rem;
    color: var(--gold);
    opacity: 0.8;
    letter-spacing: 0.25rem;
}

/* Quick Reference */
.astrology-quick-ref {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.astrology-quick-ref h3 {
    color: var(--gold);
    margin-bottom: 1rem;
}

.quick-ref-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.quick-ref-item h4 {
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.element-signs,
.modality-signs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    flex-wrap: wrap;
}

.element-name,
.modality-name {
    font-weight: 600;
    min-width: 50px;
}

/* Zodiac Wheel */
.zodiac-wheel-container,
.houses-wheel-container {
    display: flex;
    justify-content: center;
    padding: 2rem;
    margin-bottom: 2rem;
}

.zodiac-wheel-svg,
.houses-wheel-svg {
    max-width: 500px;
    width: 100%;
    height: auto;
}

.zodiac-wheel-symbol {
    font-family: serif;
}

/* Zodiac List */
.zodiac-list .database-item {
    border-left: 4px solid var(--gold);
}

.zodiac-item .item-header {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.zodiac-symbol-large {
    font-size: 3rem;
    line-height: 1;
    min-width: 60px;
    text-align: center;
}

.zodiac-dates {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0.25rem 0 0.5rem;
}

.zodiac-details {
    background: rgba(255, 255, 255, 0.02);
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}

.zodiac-details .detail-row {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.zodiac-keywords,
.planet-keywords,
.house-keywords,
.aspect-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.zodiac-keywords .keyword,
.planet-keywords .keyword,
.house-keywords .keyword,
.aspect-keywords .keyword {
    background: rgba(255, 215, 0, 0.1);
    color: var(--gold);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
}

.zodiac-traits {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1rem 0;
}

.traits-positive,
.traits-negative {
    padding: 1rem;
    border-radius: 8px;
}

.traits-positive {
    background: rgba(46, 204, 113, 0.1);
    border: 1px solid rgba(46, 204, 113, 0.2);
}

.traits-negative {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.2);
}

.traits-positive strong {
    color: #2ecc71;
}

.traits-negative strong {
    color: #e74c3c;
}

.zodiac-description,
.zodiac-mythology,
.zodiac-esoteric,
.planet-description,
.planet-psychological,
.planet-esoteric,
.house-description,
.house-domains,
.aspect-description,
.aspect-interpretation {
    margin: 1rem 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

.zodiac-mythology strong,
.zodiac-esoteric strong,
.planet-psychological strong,
.planet-esoteric strong,
.aspect-interpretation strong {
    color: var(--gold);
    display: block;
    margin-bottom: 0.5rem;
}

.zodiac-correspondences,
.planet-correspondences {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    margin-top: 1rem;
}

.zodiac-correspondences .correspondence,
.planet-correspondences .correspondence {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.zodiac-correspondences .correspondence strong,
.planet-correspondences .correspondence strong {
    color: var(--text-primary);
}

/* Planet List */
.planet-types-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.planet-type-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 215, 0, 0.2);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.planet-type-btn:hover {
    background: rgba(255, 215, 0, 0.1);
    color: var(--gold);
}

.planet-type-btn.active {
    background: rgba(255, 215, 0, 0.15);
    border-color: var(--gold);
    color: var(--gold);
}

.planet-item .item-header {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.planet-symbol-large {
    font-size: 3rem;
    color: var(--gold);
    min-width: 60px;
    text-align: center;
}

.planet-details {
    background: rgba(255, 255, 255, 0.02);
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}

.planet-details .detail-row {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.dignities-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

/* Lunar Nodes */
.lunar-nodes-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 215, 0, 0.2);
}

.lunar-nodes-section h3 {
    color: var(--gold);
    margin-bottom: 1rem;
}

.nodes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.node-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
}

.node-symbol {
    font-size: 2.5rem;
    color: var(--gold);
    margin-bottom: 0.5rem;
}

.node-card h4 {
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.node-keywords {
    color: var(--gold);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.node-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.node-esoteric {
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 215, 0, 0.1);
}

/* Houses */
.house-item .item-header {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.house-number-large {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--gold);
    min-width: 60px;
    text-align: center;
}

.house-latin {
    color: var(--text-secondary);
    font-style: italic;
    font-size: 0.9rem;
    margin: 0.25rem 0 0.5rem;
}

.house-domains strong {
    color: var(--gold);
    display: block;
    margin-bottom: 0.5rem;
}

/* Chart Points */
.chart-points-section {
    margin-bottom: 2rem;
}

.chart-points-section h3 {
    color: var(--gold);
    margin-bottom: 1rem;
}

.chart-points-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.chart-point-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(74, 158, 255, 0.3);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.point-abbr {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--cosmic-blue);
    margin-bottom: 0.25rem;
}

.point-name {
    display: block;
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.chart-point-card p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* House Systems */
.house-systems-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 215, 0, 0.2);
}

.house-systems-section h3 {
    color: var(--gold);
    margin-bottom: 0.5rem;
}

.section-intro {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.house-systems-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.house-system-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 215, 0, 0.15);
    border-radius: 8px;
    padding: 1rem;
}

.house-system-card h4 {
    color: var(--gold);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.house-system-card p {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.system-usage {
    display: inline-block;
    font-size: 0.75rem;
    color: var(--cosmic-blue);
    background: rgba(74, 158, 255, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* Aspects */
.aspects-diagram {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
}

.aspects-diagram svg {
    max-width: 300px;
    width: 100%;
}

.aspect-legend {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.legend-color {
    width: 20px;
    height: 4px;
    border-radius: 2px;
}

.legend-symbol {
    font-size: 1.25rem;
    width: 30px;
    text-align: center;
}

.legend-name {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Aspect Categories */
.aspects-categories {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.aspect-category h3 {
    color: var(--gold);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}

.aspect-item {
    border-left: 4px solid;
}

.aspect-item .item-header {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.aspect-symbol-large {
    font-size: 2.5rem;
    min-width: 50px;
    text-align: center;
}

.meta-tag.nature-harmonious {
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
}

.meta-tag.nature-challenging {
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
}

.meta-tag.nature-variable {
    background: rgba(241, 196, 15, 0.15);
    color: #f1c40f;
}

.meta-tag.nature-adjusting,
.meta-tag.nature-mildly-challenging {
    background: rgba(155, 89, 182, 0.15);
    color: #9b59b6;
}

.meta-tag.nature-creative {
    background: rgba(255, 105, 180, 0.15);
    color: #ff69b4;
}

/* Elements Section */
.elements-section,
.modalities-section {
    margin-bottom: 2rem;
}

.elements-section h3,
.modalities-section h3 {
    color: var(--gold);
    margin-bottom: 1rem;
}

.elements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.element-card {
    border: 2px solid;
    border-radius: 12px;
    overflow: hidden;
}

.element-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
}

.element-symbol {
    font-size: 2rem;
}

.element-header h4 {
    color: var(--text-primary);
    margin: 0;
}

.element-body {
    padding: 1rem;
}

.element-quality,
.element-temperament {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.element-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.element-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.element-signs {
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sign-badge {
    display: inline-block;
    margin: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    font-size: 0.85rem;
}

/* Modalities Grid */
.modalities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.modality-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 12px;
    overflow: hidden;
}

.modality-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 215, 0, 0.05);
}

.modality-header h4 {
    color: var(--gold);
    margin: 0;
}

.modality-quality {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.modality-body {
    padding: 1rem;
}

.modality-season {
    font-size: 0.85rem;
    color: var(--cosmic-blue);
    margin-bottom: 0.75rem;
}

.modality-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.modality-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.modality-signs {
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Element-Modality Matrix */
.cross-reference-section {
    margin-top: 2rem;
}

.cross-reference-section h3 {
    color: var(--gold);
    margin-bottom: 1rem;
}

.element-modality-matrix {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    overflow: hidden;
}

.element-modality-matrix th,
.element-modality-matrix td {
    padding: 1rem;
    text-align: center;
    border: 1px solid rgba(255, 215, 0, 0.1);
}

.element-modality-matrix thead th {
    background: rgba(255, 215, 0, 0.1);
    color: var(--gold);
}

.element-modality-matrix tbody th {
    background: rgba(255, 255, 255, 0.02);
}

.element-modality-matrix td {
    font-size: 0.9rem;
}

/* Dignities */
.dignities-explanation {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.dignity-type {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 1rem;
}

.dignity-type h4 {
    color: var(--gold);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.dignity-type p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.dignities-table-container {
    margin-bottom: 2rem;
}

.dignities-table-container h3 {
    color: var(--gold);
    margin-bottom: 1rem;
}

.dignities-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    overflow: hidden;
}

.dignities-table th,
.dignities-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 215, 0, 0.1);
}

.dignities-table thead th {
    background: rgba(255, 215, 0, 0.1);
    color: var(--gold);
}

.dignities-table .planet-symbol {
    font-size: 1.25rem;
    margin-right: 0.5rem;
}

.dignity-domicile {
    color: var(--gold);
}

.dignity-exaltation {
    color: #2ecc71;
}

.dignity-detriment {
    color: #e74c3c;
}

.dignity-fall {
    color: #9b59b6;
}

/* Dignities by Sign */
.dignities-by-sign h3 {
    color: var(--gold);
    margin-bottom: 1rem;
}

.dignities-sign-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.dignity-sign-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 215, 0, 0.15);
    border-radius: 8px;
    overflow: hidden;
}

.dignity-sign-card .sign-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(255, 215, 0, 0.05);
}

.dignity-sign-card .sign-symbol {
    font-size: 1.5rem;
    color: var(--gold);
}

.dignity-sign-card .sign-name {
    color: var(--text-primary);
    font-weight: 500;
}

.dignity-sign-card .sign-dignities {
    padding: 0.75rem;
}

.dignity-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    padding: 0.25rem 0;
}

.dignity-label {
    color: var(--text-secondary);
}

.dignity-row.ruler .dignity-value {
    color: var(--gold);
}

.dignity-row.exaltation .dignity-value {
    color: #2ecc71;
}

.dignity-row.detriment .dignity-value {
    color: #e74c3c;
}

.dignity-row.fall .dignity-value {
    color: #9b59b6;
}

/* Retrograde */
.retrograde-meaning {
    background: rgba(255, 255, 255, 0.03);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.retrograde-meaning h3 {
    color: var(--gold);
    margin-bottom: 0.75rem;
}

.retrograde-meaning p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.retrograde-diagram {
    text-align: center;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    margin-bottom: 2rem;
}

.retrograde-diagram svg {
    max-width: 600px;
    width: 100%;
}

.diagram-caption {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 1rem;
    font-style: italic;
}

.retrograde-planets h3 {
    color: var(--gold);
    margin-bottom: 1rem;
}

.retrograde-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.retrograde-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 215, 0, 0.15);
    border-radius: 8px;
    padding: 1rem;
}

.retrograde-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.planet-symbol-med {
    font-size: 1.75rem;
    color: var(--gold);
}

.retrograde-header h4 {
    color: var(--text-primary);
    margin: 0;
}

.retrograde-details .detail-row {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0.25rem 0;
}

.retrograde-themes {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 215, 0, 0.1);
    font-size: 0.85rem;
}

.retrograde-themes strong {
    color: var(--gold);
    display: block;
    margin-bottom: 0.25rem;
}

.retrograde-themes p {
    color: var(--text-secondary);
    margin: 0;
}

.retrograde-tips {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 215, 0, 0.2);
}

.retrograde-tips h3 {
    color: var(--gold);
    margin-bottom: 1rem;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.tip-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.tip-card h4 {
    color: var(--gold);
    margin-bottom: 0.5rem;
}

.tip-card p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0;
}

/* Responsive Astrology Styles */
@media (max-width: 768px) {
    .astrology-overview-grid {
        grid-template-columns: 1fr 1fr;
    }

    .zodiac-traits {
        grid-template-columns: 1fr;
    }

    .zodiac-item .item-header,
    .planet-item .item-header,
    .house-item .item-header,
    .aspect-item .item-header {
        flex-direction: column;
        text-align: center;
    }

    .zodiac-symbol-large,
    .planet-symbol-large,
    .house-number-large,
    .aspect-symbol-large {
        margin-bottom: 1rem;
    }

    .zodiac-correspondences,
    .planet-correspondences {
        flex-direction: column;
    }

    .dignities-row {
        flex-direction: column;
        gap: 0.5rem;
    }

    .element-modality-matrix {
        font-size: 0.8rem;
    }

    .element-modality-matrix th,
    .element-modality-matrix td {
        padding: 0.5rem;
    }
}

@media (max-width: 480px) {
    .astrology-overview-grid {
        grid-template-columns: 1fr;
    }

    .quick-ref-grid {
        grid-template-columns: 1fr;
    }

    .nodes-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   BIRTH CHART CALCULATOR STYLES
   ============================================ */

.birth-chart-view {
    padding: 2rem;
}

.birth-chart-form {
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.15), rgba(75, 0, 130, 0.2));
    border: 1px solid rgba(138, 43, 226, 0.3);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    max-width: 600px;
}

.birth-chart-form h3 {
    color: var(--gold);
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.4rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    color: var(--gold);
    font-size: 0.9rem;
    font-weight: 500;
}

.form-group input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-group small {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.calculate-btn {
    background: linear-gradient(135deg, var(--gold), #DAA520);
    color: var(--bg-primary);
    border: none;
    border-radius: 8px;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.4);
}

.calculate-btn:active {
    transform: translateY(0);
}

/* Chart Results */
.chart-results {
    margin-top: 2rem;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.chart-result-card {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(218, 165, 32, 0.05));
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.chart-result-card h3 {
    color: var(--gold);
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Sun Sign Result */
.sun-sign-result {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    flex-wrap: wrap;
}

.sun-sign-symbol {
    font-size: 5rem;
    line-height: 1;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
}

.sun-sign-details {
    flex: 1;
    min-width: 250px;
}

.sun-sign-details h4 {
    color: var(--gold);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.sign-dates {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.sign-element-modality {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.sign-element-modality span {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.sign-description {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Moon Sign Result */
.moon-sign-result {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    flex-wrap: wrap;
}

.moon-sign-symbol {
    font-size: 4rem;
    line-height: 1;
    text-shadow: 0 0 25px rgba(192, 192, 192, 0.5);
}

.moon-sign-details {
    flex: 1;
    min-width: 250px;
}

.moon-sign-details h4 {
    color: #C0C0C0;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.moon-note {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
    margin-bottom: 1rem;
}

.moon-interpretation {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Horoscope Section */
.horoscope-section {
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.1), rgba(75, 0, 130, 0.15));
    border: 1px solid rgba(138, 43, 226, 0.3);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.horoscope-section h3 {
    color: var(--gold);
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    text-align: center;
}

.horoscope-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.horoscope-paragraph {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    border-left: 3px solid var(--gold);
}

.horoscope-paragraph h4 {
    color: var(--gold);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.horoscope-paragraph p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin: 0;
}

/* Horoscope Influences */
.horoscope-influences {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 215, 0, 0.2);
}

.influence-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
}

.influence-item h5 {
    color: var(--gold);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.influence-item p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0;
}

/* Correspondences Grid */
.correspondences-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.corr-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    transition: all 0.3s ease;
}

.corr-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.corr-item strong {
    display: block;
    color: var(--gold);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.corr-item span {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Current Sky Section */
.current-sky {
    background: linear-gradient(135deg, rgba(25, 25, 112, 0.3), rgba(0, 0, 50, 0.4));
    border: 1px solid rgba(100, 149, 237, 0.3);
    border-radius: 16px;
    padding: 2rem;
    margin-top: 2rem;
}

.current-sky h3 {
    color: var(--gold);
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.3rem;
}

.current-sky > p {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 1.5rem;
}

.current-positions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.planet-position-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.planet-position-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 215, 0, 0.3);
    transform: translateY(-3px);
}

.planet-position-card .planet-symbol {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

.planet-position-card .planet-name {
    color: var(--gold);
    font-weight: 600;
    font-size: 0.9rem;
    display: block;
    margin-bottom: 0.25rem;
}

.planet-position-card .planet-sign {
    color: var(--text-secondary);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

/* Lucky Elements */
.lucky-elements {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 215, 0, 0.2);
}

.lucky-item {
    text-align: center;
    padding: 0.75rem;
}

.lucky-item strong {
    display: block;
    color: var(--gold);
    font-size: 0.75rem;
    text-transform: uppercase;
    margin-bottom: 0.35rem;
}

.lucky-item span {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Responsive Birth Chart Styles */
@media (max-width: 768px) {
    .birth-chart-view {
        padding: 1rem;
    }

    .birth-chart-form {
        padding: 1.5rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .sun-sign-result,
    .moon-sign-result {
        flex-direction: column;
        text-align: center;
    }

    .sun-sign-symbol,
    .moon-sign-symbol {
        margin: 0 auto;
    }

    .sign-element-modality {
        justify-content: center;
    }

    .horoscope-influences {
        grid-template-columns: 1fr 1fr;
    }

    .correspondences-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .current-positions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .horoscope-influences {
        grid-template-columns: 1fr;
    }

    .correspondences-grid {
        grid-template-columns: 1fr 1fr;
    }

    .current-positions-grid {
        grid-template-columns: 1fr 1fr;
    }

    .lucky-elements {
        grid-template-columns: 1fr 1fr;
    }
}

/* ============================================
   TOOL VIEWS - COMPASS & RULER, CALCULATOR, EXPORT
   ============================================ */

.tool-view {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.tool-description {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

/* Compass & Ruler Tool */
.compass-ruler-view .tool-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.tool-controls {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
}

.control-group {
    margin-bottom: 1.25rem;
}

.control-group label {
    display: block;
    color: var(--gold);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.control-group select,
.control-group input[type="range"],
.control-group input[type="color"] {
    width: 100%;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.control-group input[type="range"] {
    padding: 0;
    height: 8px;
    -webkit-appearance: none;
    background: rgba(255, 215, 0, 0.2);
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--gold);
    border-radius: 50%;
    cursor: pointer;
}

.control-group input[type="color"] {
    height: 40px;
    padding: 4px;
    cursor: pointer;
}

.control-group input[type="checkbox"] {
    margin-right: 0.5rem;
}

.tool-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(218, 165, 32, 0.1));
    border: 1px solid var(--gold);
    border-radius: 8px;
    color: var(--gold);
    font-size: 0.9rem;
    cursor: pointer;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.tool-btn:hover {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(218, 165, 32, 0.2));
    transform: translateY(-2px);
}

.tool-canvas {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.tool-canvas svg {
    width: 100%;
    height: 100%;
    max-height: 500px;
}

.construction-steps {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
}

.construction-steps h3 {
    color: var(--gold);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.steps-list {
    list-style: decimal;
    padding-left: 1.5rem;
    color: var(--text-secondary);
}

.steps-list li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

/* Geometry Calculator */
.calculator-view .calculator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.calc-section {
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.1), rgba(75, 0, 130, 0.15));
    border: 1px solid rgba(138, 43, 226, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
}

.calc-section h3 {
    color: var(--gold);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}

.calc-group {
    margin-bottom: 1rem;
}

.calc-group label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
}

.calc-group input,
.calc-group select {
    width: 100%;
    padding: 0.6rem 0.75rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.calc-btn {
    width: 100%;
    padding: 0.6rem 1rem;
    background: linear-gradient(135deg, var(--gold), #DAA520);
    border: none;
    border-radius: 6px;
    color: var(--bg-primary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.calc-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.calc-results {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

.calc-results p {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.calc-results span {
    color: var(--gold);
    font-weight: 600;
}

.fib-sequence {
    font-family: monospace;
    word-break: break-word;
    font-size: 0.85rem !important;
    line-height: 1.6;
}

/* Export Tool */
.export-view .export-options {
    max-width: 600px;
}

.export-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.export-section h3 {
    color: var(--gold);
    margin-bottom: 1rem;
    font-size: 1rem;
}

.export-section p {
    color: var(--text-secondary);
}

.export-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.export-btn-large {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(218, 165, 32, 0.05));
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 12px;
    color: var(--gold);
    cursor: pointer;
    transition: all 0.3s ease;
}

.export-btn-large:hover {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(218, 165, 32, 0.1));
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.2);
}

.export-btn-large .export-icon {
    font-size: 2rem;
}

.export-btn-large span {
    font-weight: 600;
}

.export-btn-large small {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.export-option-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.export-option-group label {
    color: var(--text-secondary);
    min-width: 100px;
}

.export-option-group select,
.export-option-group input[type="color"] {
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 6px;
    color: var(--text-primary);
}

.export-btn {
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    color: var(--gold);
    cursor: pointer;
    transition: all 0.3s ease;
}

.export-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Responsive Tool Views */
@media (max-width: 768px) {
    .compass-ruler-view .tool-layout {
        grid-template-columns: 1fr;
    }

    .tool-controls {
        order: 2;
    }

    .tool-canvas {
        order: 1;
        min-height: 300px;
    }

    .calculator-view .calculator-grid {
        grid-template-columns: 1fr;
    }

    .export-buttons {
        grid-template-columns: 1fr;
    }
}

/* Light Theme Adjustments for Tools */
[data-theme="light"] .tool-controls,
[data-theme="light"] .construction-steps,
[data-theme="light"] .export-section {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(102, 68, 0, 0.2);
}

[data-theme="light"] .tool-canvas {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(102, 68, 0, 0.2);
}

[data-theme="light"] .calc-section {
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.05), rgba(75, 0, 130, 0.08));
    border-color: rgba(138, 43, 226, 0.2);
}

[data-theme="light"] .calc-results {
    background: rgba(0, 0, 0, 0.03);
}

/* ============================================
   Mandala Generator Styles
   ============================================ */

.mandala-generator-view {
    padding: 20px;
}

.mandala-generator-view h2 {
    color: var(--gold);
    margin-bottom: 10px;
}

.mandala-generator-view .tool-description {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 0.95em;
}

.mandala-generator-view .tool-controls {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.mandala-generator-view .control-group {
    margin-bottom: 15px;
}

.mandala-generator-view .control-group label {
    display: block;
    color: var(--text-primary);
    margin-bottom: 5px;
    font-size: 0.9em;
}

.mandala-generator-view .control-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mandala-generator-view .control-row input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 215, 0, 0.2);
    appearance: none;
    cursor: pointer;
}

.mandala-generator-view .control-row input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--gold);
    cursor: pointer;
}

.mandala-generator-view .control-row span {
    min-width: 40px;
    text-align: center;
    color: var(--gold);
    font-weight: bold;
}

.mandala-generator-view select {
    width: 100%;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.9em;
    cursor: pointer;
}

.mandala-generator-view select:focus {
    outline: none;
    border-color: var(--gold);
}

.mandala-generator-view .color-inputs {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.mandala-generator-view .color-inputs input[type="color"] {
    width: 40px;
    height: 40px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    padding: 0;
}

.mandala-generator-view .color-inputs input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.mandala-generator-view .color-inputs input[type="color"]::-webkit-color-swatch {
    border-radius: 2px;
}

.mandala-generator-view .control-group input[type="checkbox"] {
    margin-right: 8px;
    accent-color: var(--gold);
}

.mandala-generator-view .button-group {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.mandala-generator-view .primary-btn {
    background: linear-gradient(135deg, var(--gold), var(--dark-gold));
    color: var(--bg-primary);
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.mandala-generator-view .primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.mandala-generator-view .secondary-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid rgba(255, 215, 0, 0.3);
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mandala-generator-view .secondary-btn:hover {
    background: rgba(255, 215, 0, 0.2);
    border-color: var(--gold);
}

.mandala-generator-view .export-btn {
    background: rgba(74, 158, 255, 0.2);
    color: var(--cosmic-blue);
    border: 1px solid rgba(74, 158, 255, 0.3);
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mandala-generator-view .export-btn:hover {
    background: rgba(74, 158, 255, 0.3);
    border-color: var(--cosmic-blue);
}

.mandala-presets {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 15px;
    border: 1px solid rgba(255, 215, 0, 0.1);
}

.mandala-presets h3 {
    color: var(--gold);
    margin-bottom: 12px;
    font-size: 1em;
}

.preset-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.preset-btn {
    background: linear-gradient(135deg, rgba(147, 112, 219, 0.2), rgba(75, 0, 130, 0.3));
    color: var(--text-primary);
    border: 1px solid rgba(147, 112, 219, 0.3);
    padding: 8px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.3s ease;
}

.preset-btn:hover {
    background: linear-gradient(135deg, rgba(147, 112, 219, 0.4), rgba(75, 0, 130, 0.5));
    border-color: var(--amethyst);
    transform: translateY(-1px);
}

/* Light Theme Adjustments for Mandala Generator */
[data-theme="light"] .mandala-generator-view .tool-controls,
[data-theme="light"] .mandala-presets {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(102, 68, 0, 0.2);
}

[data-theme="light"] .mandala-generator-view select {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(102, 68, 0, 0.3);
}

[data-theme="light"] .mandala-generator-view .secondary-btn {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(102, 68, 0, 0.3);
}

[data-theme="light"] .preset-btn {
    background: linear-gradient(135deg, rgba(147, 112, 219, 0.1), rgba(75, 0, 130, 0.15));
}

/* Responsive Mandala Generator */
@media (max-width: 768px) {
    .mandala-generator-view .button-group {
        flex-direction: column;
    }

    .mandala-generator-view .button-group button {
        width: 100%;
    }

    .preset-buttons {
        justify-content: center;
    }
}

/* ========== I CHING ORACLE STYLES ========== */

.iching-oracle-view,
.iching-library-view,
.iching-trigrams-view,
.iching-search-view {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Oracle Casting Interface */
.oracle-intro {
    text-align: center;
    margin-bottom: 30px;
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.8;
}

.oracle-intro p {
    margin-bottom: 15px;
}

.casting-interface {
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.15), rgba(218, 165, 32, 0.1));
    border: 2px solid rgba(218, 165, 32, 0.3);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
}

.method-selection {
    margin-bottom: 25px;
}

.method-selection h3 {
    color: var(--gold);
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.method-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.method-btn {
    padding: 12px 24px;
    background: rgba(139, 69, 19, 0.2);
    border: 2px solid rgba(218, 165, 32, 0.3);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.method-btn:hover {
    background: rgba(139, 69, 19, 0.4);
    border-color: var(--gold);
}

.method-btn.active {
    background: linear-gradient(135deg, rgba(218, 165, 32, 0.3), rgba(139, 69, 19, 0.4));
    border-color: var(--gold);
    box-shadow: 0 0 15px rgba(218, 165, 32, 0.3);
}

.method-description {
    margin-top: 15px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.question-input {
    margin-bottom: 25px;
}

.question-input label {
    display: block;
    color: var(--gold);
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.question-input textarea {
    width: 100%;
    min-height: 100px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(218, 165, 32, 0.3);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: var(--font-mystical);
    resize: vertical;
}

.question-input textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 10px rgba(218, 165, 32, 0.2);
}

.cast-button {
    display: block;
    width: 100%;
    padding: 18px 40px;
    background: linear-gradient(135deg, #8b4513, #daa520);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1.3rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.cast-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(218, 165, 32, 0.4);
}

.cast-button:active {
    transform: translateY(0);
}

/* Casting Animation */
.casting-animation {
    text-align: center;
    padding: 40px;
}

.coin-container {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
}

.coin {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #daa520, #b8860b);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #8b4513;
    box-shadow: 0 4px 15px rgba(218, 165, 32, 0.5);
    animation: coinFlip 0.5s ease-in-out infinite;
}

.coin:nth-child(2) {
    animation-delay: 0.1s;
}

.coin:nth-child(3) {
    animation-delay: 0.2s;
}

@keyframes coinFlip {
    0%, 100% { transform: rotateY(0deg); }
    50% { transform: rotateY(180deg); }
}

.casting-status {
    color: var(--gold);
    font-size: 1.2rem;
    font-family: var(--font-mystical);
}

.lines-progress {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.line-indicator {
    width: 40px;
    height: 8px;
    background: rgba(218, 165, 32, 0.2);
    border-radius: 4px;
}

.line-indicator.cast {
    background: var(--gold);
}

/* Hexagram Result Display */
.hexagram-result {
    background: linear-gradient(180deg, rgba(139, 69, 19, 0.1), rgba(0, 0, 0, 0.2));
    border: 2px solid rgba(218, 165, 32, 0.4);
    border-radius: 12px;
    padding: 30px;
    margin-top: 30px;
}

.result-header {
    display: flex;
    align-items: flex-start;
    gap: 30px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.hexagram-visual {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}

.hexagram-line {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 12px;
}

.hexagram-line.yang {
    width: 80px;
    background: var(--gold);
    border-radius: 2px;
}

.hexagram-line.yin {
    display: flex;
    gap: 12px;
}

.hexagram-line.yin span {
    flex: 1;
    height: 12px;
    background: var(--gold);
    border-radius: 2px;
}

.hexagram-line.changing::after {
    content: '○';
    color: var(--ember);
    font-size: 14px;
    margin-left: 8px;
}

.hexagram-line.yang.changing::after {
    content: '×';
}

.hexagram-info {
    flex: 1;
}

.hexagram-number {
    color: var(--gold);
    font-size: 1rem;
    margin-bottom: 5px;
}

.hexagram-name {
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.hexagram-chinese {
    font-size: 2.5rem;
    color: var(--gold);
    margin-bottom: 10px;
}

.hexagram-english {
    font-size: 1.3rem;
    color: var(--text-secondary);
    font-style: italic;
}

.trigram-info {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(218, 165, 32, 0.2);
}

.trigram-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(218, 165, 32, 0.1);
    border-radius: 20px;
    font-size: 0.9rem;
}

.trigram-badge .symbol {
    font-size: 1.4rem;
}

.trigram-badge .name {
    color: var(--text-secondary);
}

/* Result Sections */
.result-section {
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    border-left: 3px solid var(--gold);
}

.result-section h3 {
    color: var(--gold);
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.result-section p {
    color: var(--text-secondary);
    line-height: 1.8;
}

.judgment-text,
.image-text {
    font-family: var(--font-mystical);
    font-size: 1.1rem;
    color: var(--text-primary);
    font-style: italic;
}

.keywords-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.keyword-tag {
    padding: 6px 14px;
    background: rgba(218, 165, 32, 0.15);
    border: 1px solid rgba(218, 165, 32, 0.3);
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--text-primary);
}

/* Changing Lines Section */
.changing-lines-section {
    background: rgba(255, 107, 53, 0.1);
    border-left-color: var(--ember);
}

.changing-lines-section h3 {
    color: var(--ember);
}

.changing-line-item {
    padding: 15px;
    margin-bottom: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}

.changing-line-item:last-child {
    margin-bottom: 0;
}

.line-position {
    color: var(--ember);
    font-weight: bold;
    margin-bottom: 8px;
}

/* Relating Hexagram */
.relating-hexagram {
    background: linear-gradient(135deg, rgba(74, 158, 255, 0.1), rgba(139, 69, 19, 0.1));
    border: 1px solid rgba(74, 158, 255, 0.3);
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.relating-hexagram h3 {
    color: var(--cosmic-blue);
    margin-bottom: 15px;
}

.relating-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--cosmic-blue);
    text-decoration: none;
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

.relating-link:hover {
    color: var(--gold);
}

/* Hexagram Library Grid */
.hexagram-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.hexagram-card {
    background: rgba(139, 69, 19, 0.1);
    border: 1px solid rgba(218, 165, 32, 0.2);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.hexagram-card:hover {
    background: rgba(139, 69, 19, 0.2);
    border-color: var(--gold);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(218, 165, 32, 0.2);
}

.hexagram-card .number {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 5px;
}

.hexagram-card .symbol {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.hexagram-card .name {
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
}

.hexagram-card .chinese {
    color: var(--gold);
    font-size: 1.2rem;
    margin-top: 5px;
}

/* Hexagram Mini Display */
.hexagram-mini {
    display: flex;
    flex-direction: column;
    gap: 3px;
    align-items: center;
}

.hexagram-mini .line {
    height: 6px;
    border-radius: 2px;
}

.hexagram-mini .line.yang {
    width: 40px;
    background: var(--gold);
}

.hexagram-mini .line.yin {
    width: 40px;
    display: flex;
    gap: 8px;
}

.hexagram-mini .line.yin span {
    flex: 1;
    height: 6px;
    background: var(--gold);
    border-radius: 2px;
}

/* Trigram Display */
.trigrams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 25px;
}

.trigram-card {
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.15), rgba(218, 165, 32, 0.1));
    border: 2px solid rgba(218, 165, 32, 0.3);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.trigram-card:hover {
    border-color: var(--gold);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(218, 165, 32, 0.25);
}

.trigram-symbol {
    font-size: 3rem;
    margin-bottom: 10px;
}

.trigram-name {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.trigram-english {
    color: var(--gold);
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.trigram-attributes {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.trigram-detail {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(218, 165, 32, 0.2);
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Bagua Arrangement */
.bagua-container {
    display: flex;
    justify-content: center;
    margin: 40px 0;
}

.bagua-diagram {
    position: relative;
    width: 350px;
    height: 350px;
}

.bagua-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
}

.bagua-trigram {
    position: absolute;
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.bagua-trigram:hover {
    transform: scale(1.1);
}

.bagua-trigram .symbol {
    font-size: 2rem;
    display: block;
}

.bagua-trigram .name {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* I Ching Search */
.iching-search-form {
    margin-bottom: 30px;
}

.search-input-group {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.search-input-group input {
    flex: 1;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(218, 165, 32, 0.3);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.search-input-group input:focus {
    outline: none;
    border-color: var(--gold);
}

.search-input-group button {
    padding: 15px 30px;
    background: linear-gradient(135deg, #8b4513, #daa520);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-input-group button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(218, 165, 32, 0.4);
}

.search-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-btn {
    padding: 8px 16px;
    background: rgba(139, 69, 19, 0.15);
    border: 1px solid rgba(218, 165, 32, 0.3);
    border-radius: 20px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
    background: rgba(218, 165, 32, 0.2);
    border-color: var(--gold);
}

.search-results-count {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* Light Theme Adjustments for I Ching */
[data-theme="light"] .casting-interface,
[data-theme="light"] .hexagram-result {
    background: rgba(139, 69, 19, 0.08);
    border-color: rgba(139, 69, 19, 0.3);
}

[data-theme="light"] .method-btn {
    background: rgba(139, 69, 19, 0.1);
}

[data-theme="light"] .method-btn.active {
    background: rgba(218, 165, 32, 0.2);
}

[data-theme="light"] .question-input textarea,
[data-theme="light"] .search-input-group input {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(139, 69, 19, 0.3);
}

[data-theme="light"] .hexagram-visual {
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .result-section {
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .hexagram-card {
    background: rgba(139, 69, 19, 0.05);
}

[data-theme="light"] .trigram-card {
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.08), rgba(218, 165, 32, 0.05));
}

/* Responsive I Ching Styles */
@media (max-width: 768px) {
    .result-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .trigram-info {
        flex-direction: column;
        align-items: center;
    }

    .method-buttons {
        flex-direction: column;
    }

    .search-input-group {
        flex-direction: column;
    }

    .hexagram-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .bagua-diagram {
        width: 280px;
        height: 280px;
    }
}

/* ========== CORRESPONDENCE TABLES STYLES ========== */

.correspondences-overview-view,
.correspondences-view {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Category Cards Grid */
.correspondence-categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.category-card {
    background: linear-gradient(135deg, rgba(106, 13, 173, 0.15), rgba(255, 215, 0, 0.1));
    border: 2px solid rgba(106, 13, 173, 0.3);
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-card:hover {
    border-color: var(--mystic-purple);
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(106, 13, 173, 0.3);
}

.category-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.category-card h3 {
    color: var(--gold);
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.category-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Quick Search Section */
.quick-search-section {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 25px;
    margin-top: 30px;
}

.quick-search-section h2 {
    color: var(--gold);
    margin-bottom: 20px;
    text-align: center;
}

/* Back Button */
.back-btn {
    background: rgba(106, 13, 173, 0.2);
    border: 1px solid rgba(106, 13, 173, 0.3);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: rgba(106, 13, 173, 0.3);
    border-color: var(--mystic-purple);
}

/* Intro Text */
.intro-text {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 1.05rem;
    line-height: 1.7;
}

/* Planet Cards */
.planets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.planet-card {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(106, 13, 173, 0.1));
    border: 2px solid rgba(255, 215, 0, 0.2);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.planet-card:hover {
    border-color: var(--gold);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.2);
}

.planet-symbol {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.planet-card h3 {
    color: var(--gold);
    margin-bottom: 10px;
}

.planet-quick-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.info-tag {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.2);
    padding: 3px 8px;
    border-radius: 10px;
}

/* Element Cards */
.elements-circle {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.element-card {
    background: rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.element-fire { border-color: rgba(255, 100, 50, 0.4); background: linear-gradient(135deg, rgba(255, 100, 50, 0.15), transparent); }
.element-water { border-color: rgba(50, 150, 255, 0.4); background: linear-gradient(135deg, rgba(50, 150, 255, 0.15), transparent); }
.element-air { border-color: rgba(255, 255, 100, 0.4); background: linear-gradient(135deg, rgba(255, 255, 100, 0.15), transparent); }
.element-earth { border-color: rgba(100, 200, 100, 0.4); background: linear-gradient(135deg, rgba(100, 200, 100, 0.15), transparent); }
.element-spirit { border-color: rgba(200, 150, 255, 0.4); background: linear-gradient(135deg, rgba(200, 150, 255, 0.15), transparent); }

.element-card:hover {
    transform: translateY(-3px);
}

.element-symbol {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.element-quick {
    display: flex;
    justify-content: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Zodiac Wheel */
.zodiac-wheel {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 30px;
}

.zodiac-card {
    background: rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255, 215, 0, 0.2);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.zodiac-card.zodiac-fire { border-left: 3px solid #ff6432; }
.zodiac-card.zodiac-water { border-left: 3px solid #3296ff; }
.zodiac-card.zodiac-air { border-left: 3px solid #ffff64; }
.zodiac-card.zodiac-earth { border-left: 3px solid #64c864; }

.zodiac-card:hover {
    border-color: var(--gold);
    transform: translateY(-2px);
}

.zodiac-symbol {
    font-size: 2rem;
    margin-bottom: 8px;
}

.zodiac-dates {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Colors Grid */
.colors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.color-card {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.color-card:hover {
    transform: translateY(-3px);
}

.color-preview {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin: 0 auto 12px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.color-card h3 {
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 5px;
}

.color-planet {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Stones Grid */
.stones-grid,
.herbs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stone-card,
.herb-card {
    background: linear-gradient(135deg, rgba(106, 13, 173, 0.1), rgba(0, 0, 0, 0.2));
    border: 1px solid rgba(106, 13, 173, 0.2);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.stone-card:hover,
.herb-card:hover {
    border-color: var(--mystic-purple);
    transform: translateY(-3px);
}

.stone-icon,
.herb-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.stone-color,
.herb-planet {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 8px;
}

.stone-properties {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Days Grid */
.days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    margin-bottom: 30px;
}

.day-card {
    background: rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255, 215, 0, 0.2);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.day-card:hover {
    border-color: var(--gold);
    transform: translateY(-2px);
}

.day-symbol {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.day-planet {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 8px;
}

.day-colors {
    display: flex;
    justify-content: center;
    gap: 4px;
}

.mini-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

/* Tree of Life Diagram */
.tree-diagram {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-bottom: 40px;
}

.sephirah-row {
    display: flex;
    gap: 100px;
}

.sephirah-card {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid rgba(255, 215, 0, 0.4);
    background: radial-gradient(circle, rgba(106, 13, 173, 0.3), rgba(0, 0, 0, 0.4));
}

.sephirah-card:hover {
    border-color: var(--gold);
    transform: scale(1.1);
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.4);
}

.seph-number {
    font-size: 1.5rem;
    color: var(--gold);
    font-weight: bold;
}

.seph-name {
    font-size: 0.8rem;
    color: var(--text-primary);
}

/* Sephirah Color Coding */
.sephirah-card.kether { background: radial-gradient(circle, rgba(255, 255, 255, 0.4), rgba(0, 0, 0, 0.4)); }
.sephirah-card.chokmah { background: radial-gradient(circle, rgba(128, 128, 128, 0.4), rgba(0, 0, 0, 0.4)); }
.sephirah-card.binah { background: radial-gradient(circle, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.4)); }
.sephirah-card.chesed { background: radial-gradient(circle, rgba(50, 100, 200, 0.4), rgba(0, 0, 0, 0.4)); }
.sephirah-card.geburah { background: radial-gradient(circle, rgba(200, 50, 50, 0.4), rgba(0, 0, 0, 0.4)); }
.sephirah-card.tiphareth { background: radial-gradient(circle, rgba(255, 215, 0, 0.4), rgba(0, 0, 0, 0.4)); }
.sephirah-card.netzach { background: radial-gradient(circle, rgba(50, 200, 100, 0.4), rgba(0, 0, 0, 0.4)); }
.sephirah-card.hod { background: radial-gradient(circle, rgba(255, 150, 50, 0.4), rgba(0, 0, 0, 0.4)); }
.sephirah-card.yesod { background: radial-gradient(circle, rgba(150, 100, 200, 0.4), rgba(0, 0, 0, 0.4)); }
.sephirah-card.malkuth { background: radial-gradient(circle, rgba(100, 80, 50, 0.4), rgba(0, 0, 0, 0.4)); }

/* Correspondence Detail View */
.correspondence-detail {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 25px;
    margin-top: 20px;
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}

.detail-symbol {
    font-size: 3rem;
}

.detail-title h2 {
    color: var(--gold);
    margin-bottom: 5px;
}

.detail-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.detail-section {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 15px;
    border-left: 3px solid var(--mystic-purple);
}

.detail-section h3 {
    color: var(--mystic-purple);
    font-size: 0.95rem;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Correspondence Table */
.correspondence-table {
    width: 100%;
    border-collapse: collapse;
}

.correspondence-table td {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.correspondence-table td:first-child {
    color: var(--text-muted);
    width: 40%;
}

.correspondence-table td:last-child {
    color: var(--text-primary);
}

/* Tags List */
.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.correspondence-tag {
    padding: 5px 12px;
    background: rgba(106, 13, 173, 0.2);
    border: 1px solid rgba(106, 13, 173, 0.3);
    border-radius: 15px;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.stone-tag { background: rgba(100, 150, 200, 0.2); border-color: rgba(100, 150, 200, 0.3); }
.herb-tag { background: rgba(100, 180, 100, 0.2); border-color: rgba(100, 180, 100, 0.3); }
.purpose-tag { background: rgba(255, 215, 0, 0.15); border-color: rgba(255, 215, 0, 0.3); }
.quality-tag { background: rgba(74, 158, 255, 0.15); border-color: rgba(74, 158, 255, 0.3); }
.deity-tag { background: rgba(200, 150, 255, 0.2); border-color: rgba(200, 150, 255, 0.3); }
.zodiac-tag { background: rgba(255, 150, 100, 0.2); border-color: rgba(255, 150, 100, 0.3); }
.challenge-tag { background: rgba(255, 100, 100, 0.15); border-color: rgba(255, 100, 100, 0.3); }
.healing-tag { background: rgba(100, 255, 150, 0.15); border-color: rgba(100, 255, 150, 0.3); }

/* Color Swatches */
.color-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.color-swatch {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Number Grid */
.number-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.number-badge {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 215, 0, 0.15);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 50%;
    font-size: 0.9rem;
    color: var(--gold);
}

/* Warning Section */
.warning-section {
    background: rgba(255, 100, 100, 0.1);
    border-left-color: var(--ember);
}

.warning-section h3 {
    color: var(--ember);
}

.warnings-list {
    list-style: none;
    padding: 0;
}

.warnings-list li {
    padding: 8px 0;
    padding-left: 20px;
    position: relative;
    color: var(--text-secondary);
}

.warnings-list li::before {
    content: '!';
    position: absolute;
    left: 0;
    color: var(--ember);
    font-weight: bold;
}

/* Search Results */
.search-results-grid,
.result-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.search-result-card {
    background: rgba(106, 13, 173, 0.1);
    border: 1px solid rgba(106, 13, 173, 0.2);
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-result-card:hover {
    border-color: var(--mystic-purple);
    background: rgba(106, 13, 173, 0.2);
}

.result-type {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(255, 215, 0, 0.2);
    border-radius: 10px;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 8px;
}

.search-result-card h4 {
    color: var(--text-primary);
    margin-bottom: 5px;
}

.search-result-card p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.result-group {
    margin-bottom: 25px;
}

.result-group h3 {
    color: var(--gold);
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}

/* Search Suggestions */
.search-suggestions {
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.suggestion-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.suggestion-btn {
    padding: 6px 14px;
    background: rgba(106, 13, 173, 0.15);
    border: 1px solid rgba(106, 13, 173, 0.3);
    border-radius: 15px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.suggestion-btn:hover {
    background: rgba(106, 13, 173, 0.3);
    border-color: var(--mystic-purple);
}

.no-results {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

/* Light Theme Adjustments for Correspondence Tables */
[data-theme="light"] .category-card,
[data-theme="light"] .planet-card,
[data-theme="light"] .element-card,
[data-theme="light"] .zodiac-card,
[data-theme="light"] .stone-card,
[data-theme="light"] .herb-card,
[data-theme="light"] .day-card {
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .correspondence-detail,
[data-theme="light"] .detail-section,
[data-theme="light"] .quick-search-section {
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .search-result-card {
    background: rgba(106, 13, 173, 0.05);
}

/* Responsive Correspondence Tables */
@media (max-width: 768px) {
    .correspondence-categories {
        grid-template-columns: repeat(2, 1fr);
    }

    .days-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }

    .sephirah-row {
        gap: 40px;
    }

    .sephirah-card {
        width: 70px;
        height: 70px;
    }

    .seph-number {
        font-size: 1.2rem;
    }

    .seph-name {
        font-size: 0.65rem;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .detail-header {
        flex-direction: column;
        text-align: center;
    }
}

/* ==============================================
   GRIMOIRE & SPELL BOOK STYLES
   ============================================== */

.grimoire-view {
    padding: 20px;
}

.grimoire-header,
.symbol-header,
.deity-header,
.calendar-header {
    text-align: center;
    margin-bottom: 30px;
}

.grimoire-intro,
.symbol-intro,
.deity-intro,
.section-intro {
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
}

.grimoire-stats,
.symbol-stats,
.deity-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--bg-tertiary);
    padding: 20px 30px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid var(--border-glow);
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: var(--gold);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.grimoire-section,
.symbol-section,
.deity-section {
    margin-bottom: 40px;
}

.grimoire-section h3,
.symbol-section h3,
.deity-section h3 {
    color: var(--gold);
    margin-bottom: 20px;
    font-size: 1.3rem;
}

/* Category/Tradition Grids */
.category-grid,
.tradition-grid,
.pantheon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.category-card,
.tradition-card,
.pantheon-card {
    background: var(--bg-tertiary);
    padding: 15px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--border-glow);
}

.category-card:hover,
.tradition-card:hover,
.pantheon-card:hover {
    transform: translateY(-3px);
    border-color: var(--gold);
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.1);
}

.category-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 10px;
}

.category-icon-large {
    font-size: 3rem;
}

.spell-count,
.symbol-count,
.deity-count {
    display: inline-block;
    background: var(--gold);
    color: var(--bg-primary);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    margin-top: 10px;
}

/* Spell Cards */
.spell-grid,
.symbol-grid,
.deity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.spell-card,
.symbol-card,
.deity-card {
    background: var(--bg-tertiary);
    padding: 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--border-glow);
}

.spell-card:hover,
.symbol-card:hover,
.deity-card:hover {
    transform: translateY(-3px);
    border-color: var(--gold);
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.1);
}

.spell-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.spell-icon {
    font-size: 1.5rem;
}

.spell-icon-large {
    font-size: 3rem;
}

.spell-difficulty {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    text-transform: uppercase;
}

.spell-difficulty.beginner { background: var(--emerald); color: white; }
.spell-difficulty.intermediate { background: var(--cosmic-blue); color: white; }
.spell-difficulty.advanced { background: var(--ember); color: white; }
.spell-difficulty.master { background: var(--mystic-purple); color: white; }

.spell-difficulty-badge {
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: bold;
}

.spell-tradition {
    color: var(--cosmic-blue);
    font-size: 0.85rem;
    margin-bottom: 5px;
}

.spell-purpose {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.spell-meta {
    display: flex;
    gap: 15px;
    margin-top: 10px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Spell Detail */
.spell-detail,
.symbol-detail,
.deity-detail {
    max-width: 900px;
    margin: 0 auto;
}

.spell-detail-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-glow);
}

.spell-subtitle {
    color: var(--text-secondary);
}

.spell-detail-meta {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    background: var(--bg-tertiary);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.meta-item {
    font-size: 0.9rem;
}

.spell-section {
    margin-bottom: 25px;
}

.spell-section h3 {
    color: var(--gold);
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.materials-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 5px;
}

.spell-steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.spell-step {
    background: var(--bg-tertiary);
    padding: 15px;
    border-radius: 10px;
    border-left: 3px solid var(--gold);
}

.step-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.step-number {
    background: var(--gold);
    color: var(--bg-primary);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.step-instructions li {
    margin-bottom: 5px;
}

.incantation-section blockquote {
    background: var(--bg-primary);
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid var(--mystic-purple);
    font-style: italic;
    font-family: var(--font-mystical);
    white-space: pre-line;
}

.warning-section {
    background: rgba(255, 107, 53, 0.1);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid var(--ember);
}

.warning-section h3 {
    color: var(--ember) !important;
}

/* Spell Filters */
.spell-filters {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.spell-filters select {
    padding: 10px 15px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-glow);
    border-radius: 5px;
    min-width: 180px;
}

/* ==============================================
   SYMBOL DICTIONARY STYLES
   ============================================== */

.symbol-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
}

.symbol-category-card {
    background: var(--bg-tertiary);
    padding: 15px;
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid var(--border-glow);
}

.symbol-category-card:hover {
    transform: translateY(-3px);
    border-color: var(--gold);
}

.symbol-glyph {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 5px;
}

.symbol-glyph-large {
    font-size: 5rem;
}

.symbol-meanings {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.featured-symbols {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
}

.featured-symbol {
    background: var(--bg-tertiary);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.featured-symbol:hover {
    transform: translateY(-3px);
    border: 1px solid var(--gold);
}

.symbol-name {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 5px;
}

.symbol-detail-header {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-glow);
}

.symbol-unicode {
    color: var(--text-muted);
    font-family: monospace;
}

.symbol-category {
    color: var(--cosmic-blue);
}

.symbol-detail-section {
    margin-bottom: 25px;
}

.symbol-detail-section h3 {
    color: var(--gold);
    margin-bottom: 10px;
}

.meaning-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.meaning-tag {
    background: var(--bg-primary);
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    border: 1px solid var(--border-glow);
}

.related-symbols {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.related-symbol {
    background: var(--bg-tertiary);
    padding: 10px 15px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.related-symbol:hover {
    border: 1px solid var(--gold);
}

/* ==============================================
   DEITY CORRESPONDENCES STYLES
   ============================================== */

.domain-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
}

.domain-card {
    background: var(--bg-tertiary);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--border-glow);
}

.domain-card:hover {
    transform: translateY(-3px);
    border-color: var(--gold);
}

.domain-icon {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 5px;
}

.domain-icon-large {
    font-size: 3rem;
}

.deity-title {
    color: var(--cosmic-blue);
    font-size: 0.9rem;
}

.deity-pantheon {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.deity-domains {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 10px;
}

.domain-tag {
    background: var(--bg-primary);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
}

.domain-tag-large {
    background: var(--bg-primary);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    border: 1px solid var(--border-glow);
}

.deity-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.deity-detail-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-glow);
}

.deity-names {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.deity-detail-section {
    margin-bottom: 25px;
}

.deity-detail-section h3 {
    color: var(--gold);
    margin-bottom: 10px;
}

.deity-domains-large {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.correspondences-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    background: var(--bg-tertiary);
    padding: 15px;
    border-radius: 10px;
}

.deity-correspondences div {
    padding: 5px 0;
}

.invocation-info {
    background: var(--bg-tertiary);
    padding: 15px;
    border-radius: 10px;
}

.invocation-info p {
    margin-bottom: 10px;
}

.related-deities {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.related-deity {
    background: var(--bg-tertiary);
    padding: 15px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.related-deity:hover {
    border: 1px solid var(--gold);
}

.related-deity strong {
    display: block;
    color: var(--gold);
}

.relationship {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

.pantheons-full-grid,
.domains-full-grid,
.traditions-full-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.pantheon-full-card,
.domain-full-card,
.tradition-full-card {
    background: var(--bg-tertiary);
    padding: 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--border-glow);
}

.pantheon-full-card:hover,
.domain-full-card:hover,
.tradition-full-card:hover {
    transform: translateY(-3px);
    border-color: var(--gold);
}

.pantheon-meta {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 10px 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.tradition-principles ul {
    margin-top: 5px;
    padding-left: 20px;
}

.tradition-principles li {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ==============================================
   SACRED CALENDAR STYLES
   ============================================== */

.calendar-view {
    padding: 20px;
}

.today-date {
    font-size: 1.2rem;
    color: var(--cosmic-blue);
}

.today-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.today-card {
    background: var(--bg-tertiary);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid var(--border-glow);
}

.today-card h3 {
    color: var(--gold);
    margin-bottom: 15px;
    font-size: 1rem;
}

.moon-display,
.day-display,
.zodiac-display {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.moon-icon,
.planet-symbol,
.zodiac-symbol {
    font-size: 2.5rem;
}

.moon-icon-large {
    font-size: 3rem;
}

.moon-icon-huge {
    font-size: 5rem;
}

.planet-symbol-large {
    font-size: 4rem;
}

.zodiac-symbol-large {
    font-size: 3rem;
}

.moon-magic,
.day-magic,
.zodiac-magic {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.other-names {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.named-moon-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.next-sabbat-section {
    margin-bottom: 30px;
}

.next-sabbat-section h3 {
    color: var(--gold);
    margin-bottom: 15px;
}

.next-sabbat-card {
    background: var(--bg-tertiary);
    padding: 20px;
    border-radius: 10px;
    max-width: 400px;
    border: 1px solid var(--border-glow);
}

.next-sabbat-card button {
    margin-top: 15px;
    padding: 8px 20px;
    background: var(--gold);
    color: var(--bg-primary);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

.next-sabbat-card button:hover {
    background: var(--gold-dark);
}

.sabbat-date {
    color: var(--cosmic-blue);
}

.current-sabbat-banner {
    background: linear-gradient(135deg, var(--mystic-purple), var(--deep-blue));
    padding: 25px;
    border-radius: 10px;
    text-align: center;
}

.current-sabbat-banner h3 {
    color: var(--gold);
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.current-sabbat-banner button {
    margin-top: 15px;
    padding: 10px 25px;
    background: var(--gold);
    color: var(--bg-primary);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

/* Sabbats Grid */
.sabbat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.sabbat-card {
    background: var(--bg-tertiary);
    padding: 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--border-glow);
}

.sabbat-card:hover {
    transform: translateY(-3px);
    border-color: var(--gold);
}

.sabbat-card.greater {
    border-left: 4px solid var(--gold);
}

.sabbat-card.lesser {
    border-left: 4px solid var(--silver);
}

.sabbat-type {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.sabbat-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.sabbat-themes {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.theme-tag {
    background: var(--bg-primary);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
}

.theme-tags-large {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.theme-tags-large .theme-tag {
    padding: 5px 12px;
    font-size: 0.85rem;
}

/* Sabbat Detail */
.sabbat-detail-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-glow);
}

.sabbat-type-badge {
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.sabbat-type-badge.greater {
    background: var(--gold);
    color: var(--bg-primary);
}

.sabbat-type-badge.lesser {
    background: var(--silver);
    color: var(--bg-primary);
}

.sabbat-other-names {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.sabbat-date-large {
    color: var(--cosmic-blue);
    font-size: 1.2rem;
    font-weight: bold;
}

.sabbat-section {
    margin-bottom: 25px;
}

.sabbat-section h3 {
    color: var(--gold);
    margin-bottom: 10px;
}

.practice-list li {
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
}

.practice-list li::before {
    content: '•';
    color: var(--gold);
    position: absolute;
    left: 0;
}

/* Moon Phases Grid */
.moon-phases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.moon-phase-card {
    background: var(--bg-tertiary);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--border-glow);
}

.moon-phase-card:hover {
    transform: translateY(-3px);
    border-color: var(--gold);
}

.moon-duration {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.moon-energy {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.moon-best {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Moon Detail */
.moon-detail-header {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-glow);
}

.moon-other-names {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.moon-section {
    margin-bottom: 25px;
}

.moon-section h3 {
    color: var(--gold);
    margin-bottom: 10px;
}

.magic-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.magic-tag {
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
}

.magic-tags.good .magic-tag {
    background: rgba(46, 204, 113, 0.2);
    border: 1px solid var(--emerald);
    color: var(--emerald);
}

.magic-tags.avoid .magic-tag {
    background: rgba(255, 107, 53, 0.2);
    border: 1px solid var(--ember);
    color: var(--ember);
}

/* Named Moons */
.named-moons-section h3 {
    color: var(--gold);
    margin-bottom: 20px;
}

.named-moons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
}

.named-moon-card {
    background: var(--bg-tertiary);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid var(--border-glow);
}

.moon-month {
    color: var(--cosmic-blue);
    font-size: 0.85rem;
}

.moon-other-names {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.moon-themes {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 10px;
}

/* Planetary Hours */
.current-hour-banner {
    background: linear-gradient(135deg, var(--deep-blue), var(--mystic-purple));
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.current-hour-banner h3 {
    color: var(--gold);
    margin-bottom: 15px;
}

.current-hour-display {
    display: flex;
    align-items: center;
    gap: 20px;
}

.planetary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.planetary-card {
    background: var(--bg-tertiary);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid var(--border-glow);
    transition: all 0.3s ease;
}

.planetary-card.current {
    border: 2px solid var(--gold);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
}

.planet-day {
    color: var(--cosmic-blue);
    font-size: 0.9rem;
}

.planet-color,
.planet-metal {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.planet-themes {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
    margin: 10px 0;
}

.planet-magic {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.hour-table-section h3 {
    color: var(--gold);
    margin-bottom: 15px;
}

.hour-note {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 20px;
}

.hour-tables {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.hour-table {
    background: var(--bg-tertiary);
    padding: 20px;
    border-radius: 10px;
}

.hour-table h4 {
    color: var(--gold);
    margin-bottom: 15px;
}

.hour-table table {
    width: 100%;
    border-collapse: collapse;
}

.hour-table th,
.hour-table td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid var(--border-glow);
}

.hour-table th {
    color: var(--gold);
    font-size: 0.85rem;
}

.hour-table td {
    font-size: 0.85rem;
}

/* Astro Events */
.astro-section {
    margin-bottom: 40px;
}

.astro-section h3 {
    color: var(--gold);
    margin-bottom: 20px;
}

.zodiac-seasons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.zodiac-season-card {
    background: var(--bg-tertiary);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid var(--border-glow);
}

.zodiac-dates {
    color: var(--cosmic-blue);
    font-size: 0.85rem;
}

.zodiac-info {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-bottom: 10px;
}

.zodiac-focus {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.eclipse-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.eclipse-card {
    background: var(--bg-tertiary);
    padding: 20px;
    border-radius: 10px;
}

.eclipse-card.solar {
    border-left: 4px solid var(--gold);
}

.eclipse-card.lunar {
    border-left: 4px solid var(--silver);
}

.eclipse-card h4 {
    margin-bottom: 10px;
}

.eclipse-card .caution {
    color: var(--ember);
    font-size: 0.85rem;
    margin-top: 10px;
}

.retrograde-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.retrograde-card {
    background: var(--bg-tertiary);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid var(--border-glow);
}

.retrograde-freq {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.retrograde-card .good {
    color: var(--emerald);
}

.retrograde-card .avoid {
    color: var(--ember);
}

.void-moon-card {
    background: var(--bg-tertiary);
    padding: 20px;
    border-radius: 10px;
    max-width: 600px;
}

.void-moon-card .avoid {
    color: var(--ember);
}

.void-moon-card .note {
    color: var(--text-muted);
    font-style: italic;
    margin-top: 15px;
}

/* Search Containers */
.grimoire-search-box,
.symbol-search-box,
.deity-search-box {
    display: flex;
    gap: 10px;
    max-width: 500px;
}

.grimoire-search-box input,
.symbol-search-box input,
.deity-search-box input {
    flex: 1;
    padding: 12px 15px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-glow);
    border-radius: 5px;
    font-size: 1rem;
}

.grimoire-search-box button,
.symbol-search-box button,
.deity-search-box button {
    padding: 12px 25px;
    background: var(--gold);
    color: var(--bg-primary);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

.grimoire-search-box button:hover,
.symbol-search-box button:hover,
.deity-search-box button:hover {
    background: var(--gold-dark);
}

.view-all-btn {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 20px;
    background: transparent;
    color: var(--gold);
    border: 1px solid var(--gold);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-all-btn:hover {
    background: var(--gold);
    color: var(--bg-primary);
}

/* Category/Domain Headers */
.category-header,
.tradition-header,
.pantheon-header,
.domain-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-glow);
}

/* Wheel Visual (Sabbat Wheel) - simplified */
.wheel-visual {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
}

.wheel-container {
    position: relative;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 2px solid var(--gold);
}

.wheel-sabbat {
    position: absolute;
    width: 80px;
    text-align: center;
    cursor: pointer;
    transform-origin: center;
    top: 50%;
    left: 50%;
    transform: rotate(var(--angle)) translateY(-130px) rotate(calc(-1 * var(--angle)));
    margin-left: -40px;
    margin-top: -15px;
}

.wheel-sabbat:hover .sabbat-name {
    color: var(--gold);
}

.sabbat-name {
    font-size: 0.8rem;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

/* Mobile Responsiveness for new features */
@media (max-width: 768px) {
    .grimoire-stats,
    .symbol-stats,
    .deity-stats {
        flex-direction: column;
        align-items: center;
    }

    .spell-detail-header,
    .symbol-detail-header,
    .moon-detail-header {
        flex-direction: column;
        text-align: center;
    }

    .category-header,
    .tradition-header,
    .pantheon-header,
    .domain-header {
        flex-direction: column;
        text-align: center;
    }

    .spell-filters {
        flex-direction: column;
    }

    .spell-filters select {
        width: 100%;
    }

    .grimoire-search-box,
    .symbol-search-box,
    .deity-search-box {
        flex-direction: column;
    }

    .wheel-visual {
        display: none;
    }

    .current-hour-display {
        flex-direction: column;
        text-align: center;
    }

    .hour-tables {
        grid-template-columns: 1fr;
    }
}

/* ========== CRYSTAL DATABASE STYLES ========== */

.crystal-overview-grid {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.overview-section h3 {
    color: var(--gold);
    font-family: var(--font-mystical);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.category-cards,
.chakra-cards,
.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.category-card,
.chakra-card,
.grid-card {
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-card:hover,
.chakra-card:hover,
.grid-card:hover {
    border-color: var(--gold);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.category-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 10px;
}

.category-card h4,
.chakra-card h4,
.grid-card h4 {
    color: var(--text-primary);
    margin-bottom: 8px;
}

.category-card p,
.grid-card p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.chakra-symbol {
    font-size: 1.5rem;
    margin-bottom: 5px;
    display: block;
}

.chakra-sanskrit {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.8rem;
    margin-bottom: 5px;
}

.chakra-themes {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.grid-stones {
    display: inline-block;
    background: rgba(255, 215, 0, 0.1);
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.75rem;
    color: var(--gold);
    margin-top: 10px;
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.action-btn {
    background: var(--bg-tertiary);
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: var(--text-primary);
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.action-btn:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: var(--gold);
}

/* Crystal Cards */
.crystal-item .item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.crystal-header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.crystal-color-swatch {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

/* Crystal thumbnail in card preview */
.crystal-thumbnail {
    width: 100px;
    height: 100px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.crystal-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.crystal-item:hover .crystal-thumbnail img {
    transform: scale(1.1);
}

/* Crystal image container in expanded view */
.crystal-image-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto 20px auto;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.crystal-detail-image {
    width: 100%;
    height: auto;
    max-height: 450px;
    object-fit: contain;
    display: block;
    cursor: pointer;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.crystal-detail-image:hover {
    transform: scale(1.02);
    filter: brightness(1.05);
}

/* Click to enlarge hint */
.crystal-image-container::after {
    content: 'Click to enlarge';
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: rgba(255, 255, 255, 0.9);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 5;
}

.crystal-image-container:hover::after {
    opacity: 1;
}

.crystal-image-container .fullscreen-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0;
    z-index: 10;
}

.crystal-image-container:hover .fullscreen-btn {
    opacity: 1;
}

.crystal-image-container .fullscreen-btn:hover {
    background: rgba(255, 215, 0, 0.4);
    border-color: var(--gold);
    transform: scale(1.15);
    box-shadow: 0 4px 16px rgba(255, 215, 0, 0.3);
}

.image-credit {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 8px;
    background: rgba(0, 0, 0, 0.5);
    margin: 0;
}

.crystal-aliases {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
    margin-top: 3px;
}

.crystal-chakras {
    font-size: 1.2rem;
}

.crystal-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.detail-section {
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 6px;
}

.detail-section h4 {
    color: var(--gold);
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.detail-section ul {
    margin: 0;
    padding-left: 20px;
}

.detail-section li {
    color: var(--text-secondary);
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.detail-section p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.chakra-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chakra-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid;
    border-radius: 15px;
    font-size: 0.85rem;
}

.cleansing-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cleansing-tag {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    color: var(--text-primary);
    cursor: help;
}

.care-notes {
    background: rgba(255, 100, 100, 0.1) !important;
    border-left: 3px solid #ff6b6b;
}

.mythology {
    background: rgba(100, 100, 255, 0.1) !important;
    border-left: 3px solid #6b6bff;
}

.affirmation {
    background: rgba(100, 255, 100, 0.1) !important;
    border-left: 3px solid #6bff6b;
}

.affirmation-text {
    font-style: italic;
    font-size: 1rem !important;
    color: var(--text-primary) !important;
}

/* Cleansing Guide */
.cleansing-guide {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.cleansing-method-card {
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 8px;
    padding: 20px;
}

.cleansing-method-card h3 {
    color: var(--gold);
    margin-bottom: 10px;
}

.method-description {
    color: var(--text-secondary);
    margin-bottom: 15px;
    line-height: 1.6;
}

.method-details p {
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.method-details .caution {
    color: #ff6b6b;
}

.cleansing-tips {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 20px;
}

.cleansing-tips h3 {
    color: var(--gold);
    margin-bottom: 15px;
}

.cleansing-tips ul {
    padding-left: 20px;
}

.cleansing-tips li {
    color: var(--text-secondary);
    margin-bottom: 8px;
}

/* Chakra Guide */
.chakra-guide {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.chakra-section {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 20px;
}

.chakra-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.chakra-symbol-large {
    font-size: 2.5rem;
}

.chakra-section h3 {
    color: var(--text-primary);
    margin: 0;
}

.chakra-section .sanskrit {
    color: var(--text-muted);
    font-style: italic;
    margin: 0;
}

.chakra-info {
    margin-bottom: 15px;
}

.chakra-info p {
    color: var(--text-secondary);
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.chakra-crystals h4 {
    color: var(--gold);
    margin-bottom: 10px;
}

.crystal-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.crystal-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.crystal-chip:hover {
    background: rgba(255, 215, 0, 0.1);
}

.chip-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

/* Crystal Grid Detail */
.grid-detail {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.grid-info {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 20px;
}

.info-item {
    margin-bottom: 15px;
}

.info-item h4 {
    color: var(--gold);
    margin-bottom: 5px;
}

.info-item p,
.info-item ul {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.info-item ul {
    padding-left: 20px;
}

.grid-layout,
.grid-activation {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 20px;
}

.grid-layout h3,
.grid-activation h3 {
    color: var(--gold);
    margin-bottom: 15px;
}

.layout-position {
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.layout-position strong {
    color: var(--text-primary);
}

.back-btn {
    background: var(--bg-tertiary);
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: var(--gold);
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.back-btn:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: var(--gold);
}

/* Crystal Detail View */
.crystal-detail-view {
    margin-top: 20px;
}

.crystal-header-large {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.crystal-color-large {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.2);
}

.crystal-header-large h2 {
    color: var(--gold);
    margin: 0;
}

.crystal-header-large .aliases {
    color: var(--text-muted);
    font-style: italic;
    margin: 5px 0 0;
}
