/* -------------------------------------------------------------
   Core Design System - SanXiangApp (Style Guide)
   ------------------------------------------------------------- */

:root {
    --bg-dark: #06060a;
    --card-bg: rgba(13, 13, 23, 0.65);
    --border-glass: rgba(255, 255, 255, 0.07);
    --border-glass-hover: rgba(255, 255, 255, 0.15);
    
    /* Cosmic Palette Accents */
    --accent-indigo: #6366f1;
    --accent-purple: #8b5cf6;
    --accent-cyan: #06b6d4;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Five Element Colors (Wuxing) */
    --color-wood: #10b981;    /* Emerald Green */
    --color-fire: #ef4444;    /* Vibrant Red */
    --color-earth: #d97706;   /* Rich Amber */
    --color-metal: #e2e8f0;   /* Platinum / Off-White */
    --color-water: #3b82f6;   /* Royal Blue */
    
    /* Glow Shadows */
    --glow-indigo: 0 0 20px rgba(99, 102, 241, 0.25);
    --glow-cyan: 0 0 20px rgba(6, 182, 212, 0.25);
    --glow-card: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset and Globals */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Ethereal Mouse Follower Glow */
.mouse-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.06) 0%, rgba(6, 182, 212, 0.01) 50%, rgba(0,0,0,0) 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 1;
    transition: transform 0.1s ease-out;
}

/* Typography Headings */
h1, h2, h3, h4 {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* App Header Styling */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2.5rem;
    background: rgba(8, 8, 16, 0.7);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-glass);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.logo-image {
    height: 42px;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.3s ease;
}

.logo:hover .logo-image {
    transform: scale(1.08) rotate(1deg);
    filter: drop-shadow(0 0 12px rgba(6, 182, 212, 0.4));
}

.logo-text h1 {
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1;
}

.logo-text p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

/* Nav Tabs Switcher */
.nav-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 9999px;
    padding: 0.25rem;
    border: 1px solid var(--border-glass);
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.6rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 9999px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition-smooth);
}

.tab-btn i {
    width: 16px;
    height: 16px;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    color: #fff;
    background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple));
    box-shadow: var(--glow-indigo);
}

/* User Controls Section */
.user-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.role-selector-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.role-selector-wrapper i {
    width: 14px;
    height: 14px;
}

/* Main Container Layout */
.app-main {
    max-width: 1600px;
    margin: 2rem auto;
    padding: 0 2rem;
    position: relative;
    z-index: 10;
}

/* Tab Switch Logic visibility */
.tab-content {
    display: none;
    position: relative;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Glassmorphic Panel Card */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--glow-card);
    transition: var(--transition-smooth);
    margin-bottom: 1.5rem;
}

.glass-card:hover {
    border-color: var(--border-glass-hover);
}

.glass-card h3 {
    font-size: 1.15rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
}

.glass-card h3 i {
    color: var(--accent-cyan);
}

.subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: -0.75rem;
    margin-bottom: 1.5rem;
}

.desc-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.4;
}

/* Form Styling */
.bazi-form .form-group {
    margin-bottom: 1.25rem;
}

.bazi-form label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.glass-input, .glass-select {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 0.75rem;
    color: #fff;
    font-family: inherit;
    font-size: 0.9rem;
    transition: var(--transition-smooth);
}

.glass-input:focus, .glass-select:focus {
    outline: none;
    border-color: var(--accent-cyan);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.15);
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .col {
    flex: 1;
}

/* Buttons */
.primary-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple));
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: var(--glow-indigo);
    transition: var(--transition-smooth);
}

.primary-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 24px rgba(99, 102, 241, 0.45);
}

.primary-btn:disabled {
    background: var(--text-muted);
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition-smooth);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-glass-hover);
}

.btn-group-row {
    display: flex;
    gap: 0.75rem;
}

.btn-group-row button {
    flex: 1;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.icon-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-glass-hover);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.1);
}

/* Guard Locked Screen Overlay */
.plugin-guard {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-height: 400px;
    background: rgba(6, 6, 10, 0.75);
    backdrop-filter: blur(14px);
    z-index: 50;
    border-radius: 16px;
    justify-content: center;
    align-items: center;
}

.plugin-guard.locked {
    display: flex;
}

.lock-card {
    background: rgba(20, 20, 35, 0.85);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 20px;
    padding: 2.5rem;
    text-align: center;
    max-width: 480px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    animation: pulseLock 3s infinite alternate;
}

@keyframes pulseLock {
    0% { border-color: rgba(239, 68, 68, 0.15); box-shadow: 0 10px 40px rgba(0,0,0,0.5); }
    100% { border-color: rgba(239, 68, 68, 0.35); box-shadow: 0 10px 40px rgba(239, 68, 68, 0.05); }
}

.lock-icon {
    font-size: 2.5rem;
    color: #ef4444;
    margin-bottom: 1.25rem;
    animation: float 2.5s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.lock-card h2 {
    font-size: 1.35rem;
    margin-bottom: 0.75rem;
    color: #fff;
}

.lock-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Workspace Layout (Sidebar + Body Grid) */
.plugin-workspace {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 2rem;
    transition: grid-template-columns 0.35s cubic-bezier(0.4, 0, 0.2, 1), gap 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.plugin-workspace.sidebar-collapsed {
    grid-template-columns: 0px 1fr;
    gap: 0;
}

.workspace-sidebar {
    display: flex;
    flex-direction: column;
    transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    transform: translateX(0);
    width: 100%;
}

.plugin-workspace.sidebar-collapsed .workspace-sidebar {
    opacity: 0;
    transform: translateX(-350px);
    pointer-events: none;
    overflow: hidden;
}

.workspace-body {
    flex: 1;
    position: relative;
}

/* Floating Sidebar Toggle Button Styles */
.toggle-sidebar-btn {
    position: absolute;
    left: -1rem;
    top: 1rem;
    z-index: 99;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid var(--accent-cyan);
    color: var(--accent-cyan);
    cursor: pointer;
    transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1), background 0.2s, border-color 0.2s, transform 0.2s;
    backdrop-filter: blur(8px);
}

.toggle-sidebar-btn:hover {
    background: rgba(13, 148, 136, 0.9); /* teal-600 */
    border-color: #2dd4bf; /* teal-400 */
    color: #fff;
    transform: scale(1.05);
}

.plugin-workspace.sidebar-collapsed .toggle-sidebar-btn {
    left: 1rem;
}

.plugin-workspace.sidebar-collapsed #baziSidebarToggleIcon,
.plugin-workspace.sidebar-collapsed #dateSidebarToggleIcon,
.plugin-workspace.sidebar-collapsed #fengshuiSidebarToggleIcon {
    transform: rotate(180deg);
}

/* Empty states */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5rem 2rem;
    text-align: center;
    color: var(--text-muted);
}

.empty-state i {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.empty-state p {
    font-size: 0.9rem;
    max-width: 320px;
    line-height: 1.4;
}

.empty-state-small {
    padding: 3rem 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Element color references */
.color-legend {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.legend-item {
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    display: inline-block;
}

.wuxing-wood { background: rgba(16, 185, 129, 0.12); color: var(--color-wood); border: 1px solid rgba(16, 185, 129, 0.2); }
.wuxing-fire { background: rgba(239, 68, 68, 0.12); color: var(--color-fire); border: 1px solid rgba(239, 68, 68, 0.2); }
.wuxing-earth { background: rgba(217, 119, 6, 0.12); color: var(--color-earth); border: 1px solid rgba(217, 119, 6, 0.2); }
.wuxing-metal { background: rgba(226, 232, 240, 0.08); color: var(--color-metal); border: 1px solid rgba(226, 232, 240, 0.15); }
.wuxing-water { background: rgba(59, 130, 246, 0.12); color: var(--color-water); border: 1px solid rgba(59, 130, 246, 0.2); }

/* BAZI CHART RESULTS VISUALIZATION */
.chart-result-container {
    padding: 2rem;
    min-height: 500px;
}

.chart-header-info {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.chart-header-info span strong {
    color: var(--accent-cyan);
}

.four-pillars-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}
@media (max-width: 1200px) {
    .four-pillars-grid {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    }
}

.pillar-column {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
}

.pillar-column:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--accent-indigo);
    transform: translateY(-2px);
}

.pillar-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    letter-spacing: 0.1em;
}

.shishen-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.5rem;
    height: 18px;
}

.character-card {
    font-family: 'Playfair Display', serif;
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.1;
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.4));
    position: relative;
}

.character-card.void-active {
    border: 1.5px dashed var(--color-fire) !important;
    border-radius: 8px;
}

.void-marker {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--color-fire);
    color: #fff;
    font-size: 0.55rem;
    padding: 1px 3px;
    border-radius: 3px;
    font-weight: 700;
    line-height: 1;
    font-family: 'Inter', sans-serif;
    text-shadow: none !important;
}

.character-card.wood { color: var(--color-wood); text-shadow: 0 0 15px rgba(16, 185, 129, 0.35); }
.character-card.fire { color: var(--color-fire); text-shadow: 0 0 15px rgba(239, 68, 68, 0.35); }
.character-card.earth { color: var(--color-earth); text-shadow: 0 0 15px rgba(217, 119, 6, 0.35); }
.character-card.metal { color: var(--color-metal); text-shadow: 0 0 15px rgba(255, 255, 255, 0.25); }
.character-card.water { color: var(--color-water); text-shadow: 0 0 15px rgba(59, 130, 246, 0.35); }

.element-tag {
    font-size: 0.7rem;
    color: var(--text-secondary);
    background: rgba(255,255,255,0.05);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 1.25rem;
}

/* Hidden Stems Box */
.hidden-stems-container {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 0.75rem;
    margin-top: auto;
    border: 1px solid var(--border-glass);
}

.hidden-title {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.4rem;
}

.hidden-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.hidden-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
}

.hidden-stem-char {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
}
.hidden-stem-char.wood { color: var(--color-wood); }
.hidden-stem-char.fire { color: var(--color-fire); }
.hidden-stem-char.earth { color: var(--color-earth); }
.hidden-stem-char.metal { color: var(--color-metal); }
.hidden-stem-char.water { color: var(--color-water); }

.hidden-shishen {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* Pillar metadata footer */
.pillar-footer-meta {
    margin-top: 1rem;
    border-top: 1px solid var(--border-glass);
    padding-top: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.pillar-footer-meta strong {
    color: var(--text-primary);
}

/* LUCK PILLARS (DA YUN) GRID */
.luck-section-title {
    font-size: 1.1rem;
    border-top: 1px solid var(--border-glass);
    padding-top: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.luck-pillars-row {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-indigo) var(--bg-dark);
}

.luck-pillars-row::-webkit-scrollbar {
    height: 6px;
}

.luck-pillars-row::-webkit-scrollbar-thumb {
    background-color: var(--accent-indigo);
    border-radius: 4px;
}

.luck-pillar-card {
    min-width: 110px;
    flex: 1;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    padding: 0.75rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.luck-pillar-card:hover, .luck-pillar-card.active {
    background: rgba(99, 102, 241, 0.06);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.15);
    transform: translateY(-2px);
}

.luck-age {
    font-size: 0.75rem;
    color: var(--accent-cyan);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.luck-years {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.luck-chars {
    font-family: 'Playfair Display', serif;
    font-size: 1.35rem;
    font-weight: 700;
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    margin-bottom: 0.5rem;
}

.luck-char.wood { color: var(--color-wood); }
.luck-char.fire { color: var(--color-fire); }
.luck-char.earth { color: var(--color-earth); }
.luck-char.metal { color: var(--color-metal); }
.luck-char.water { color: var(--color-water); }

.luck-shishen {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* LIU NIAN (ANNUAL luck years) */
.liunian-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 0.5rem;
    margin-top: 1.25rem;
    background: rgba(0,0,0,0.15);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-glass);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.liunian-card {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    padding: 0.4rem;
    text-align: center;
    font-size: 0.75rem;
}

.liunian-card.active-year {
    border-color: var(--accent-cyan);
    background: rgba(6, 182, 212, 0.03);
}

.liunian-year {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.liunian-chars {
    font-family: 'Playfair Display', serif;
    font-size: 0.85rem;
    font-weight: 700;
    margin: 0.15rem 0;
}

.liunian-age {
    font-size: 0.65rem;
    color: var(--accent-purple);
}

/* DATE SELECTION (ZE RI) STYLING */
.inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 2rem;
    background: rgba(0, 0, 0, 0.15);
    padding: 1.25rem;
    border-radius: 10px;
    border: 1px solid var(--border-glass);
}

.inline-form .form-group {
    margin-bottom: 0;
    flex: 1;
    min-width: 150px;
}

.inline-form button {
    height: 42px;
    width: auto;
}

.date-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.date-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 1.25rem;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.date-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

/* Date Selection Ratings */
.date-card.rate-excellent { border-color: rgba(16, 185, 129, 0.3); background: rgba(16, 185, 129, 0.02); }
.date-card.rate-excellent::before { background: var(--color-wood); }
.date-card.rate-excellent .date-rating { color: var(--color-wood); }

.date-card.rate-good { border-color: rgba(6, 182, 212, 0.3); background: rgba(6, 182, 212, 0.02); }
.date-card.rate-good::before { background: var(--accent-cyan); }
.date-card.rate-good .date-rating { color: var(--accent-cyan); }

.date-card.rate-clash { border-color: rgba(239, 68, 68, 0.3); background: rgba(239, 68, 68, 0.02); }
.date-card.rate-clash::before { background: var(--color-fire); }
.date-card.rate-clash .date-rating { color: var(--color-fire); }

.date-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.date-stamp {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: #fff;
}

.date-ganzhi {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.date-rating {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.date-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* FENGSHUI / LUO PAN OVERLAY SYSTEM */
.fs-workspace {
    grid-template-columns: 350px 1fr;
}

.upload-area {
    border: 2px dashed var(--border-glass);
    border-radius: 12px;
    padding: 2rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    background: rgba(255, 255, 255, 0.01);
}

.upload-area:hover {
    border-color: var(--accent-cyan);
    background: rgba(6, 182, 212, 0.02);
}

.upload-icon {
    width: 32px;
    height: 32px;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.upload-area p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.file-hidden {
    display: none;
}

.uploaded-info {
    margin-top: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border-glass);
}

.uploaded-info .file-name {
    font-size: 0.75rem;
    font-family: monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 160px;
}

.danger-btn-small {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: var(--transition-smooth);
}

.danger-btn-small:hover {
    background: rgba(239, 68, 68, 0.25);
}

/* Sliders and checkboxes */
.glass-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    transition: var(--transition-smooth);
}

.glass-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-cyan);
    cursor: pointer;
    box-shadow: 0 0 8px var(--accent-cyan);
    transition: var(--transition-smooth);
}

.glass-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.checkbox-group {
    margin-top: 1.25rem;
}

.checkbox-group h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.glass-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.65rem;
    cursor: pointer;
    user-select: none;
}

.glass-checkbox input[type="checkbox"] {
    accent-color: var(--accent-cyan);
}

/* Floorplan canvas container */
.canvas-body {
    display: flex;
    justify-content: center;
    align-items: center;
}

.canvas-container {
    width: 100%;
    min-height: 600px;
    border: 1px solid var(--border-glass);
    background: rgba(0,0,0,0.3);
    border-radius: 16px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#floorplanCanvas {
    max-width: 100%;
    max-height: 80vh;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    display: none;
    cursor: crosshair;
}

.canvas-instructions {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
}

.canvas-instructions i {
    width: 32px;
    height: 32px;
    margin-bottom: 0.5rem;
    color: var(--accent-indigo);
}

/* ADMIN PANEL BACKDROP & CARD */
.modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 200;
    justify-content: center;
    align-items: center;
}

.modal-backdrop.open {
    display: flex;
}

.modal-card {
    background: rgba(10, 10, 20, 0.95);
    border: 1px solid var(--border-glass-hover);
    border-radius: 20px;
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0,0,0,0.9);
    animation: modalScale 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalScale {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
}

.modal-header h2 i {
    color: var(--color-wood);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
}

.admin-sections {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.admin-panel-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 1.25rem;
}

/* Glass Tables */
.table-wrapper {
    margin-top: 1rem;
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    overflow: hidden;
}

.glass-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.85rem;
}

.glass-table th, .glass-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-glass);
}

.glass-table th {
    background: rgba(255,255,255,0.03);
    color: var(--text-secondary);
    font-weight: 600;
}

.glass-table td {
    color: var(--text-primary);
}

.glass-table tr:last-child td {
    border-bottom: none;
}

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

/* Add User Form */
.add-user-form {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.add-user-form input, .add-user-form select {
    flex: 1;
}

.add-user-form button {
    width: auto;
}

/* Sub-Tab Navigation inside Date Selection */
.sub-tab-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sub-tab-btn {
    background: transparent;
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    text-align: left;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition-smooth);
}

.sub-tab-btn:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

.sub-tab-btn.active {
    background: rgba(6, 182, 212, 0.08);
    border-color: var(--accent-cyan);
    color: #fff;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.1);
}

.sub-tab-content {
    display: none;
}

.sub-tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

/* Close button inside modal */
.close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
}

.close-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

/* Red button */
.danger-btn {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    border-radius: 6px;
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.danger-btn:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #fff;
}

/* -------------------------------------------------------------
   He Luo 2-Hour Result Card and Grid Layouts
   ------------------------------------------------------------- */
.hl-result-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem;
    background: rgba(13, 13, 23, 0.7);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
}

.hl-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 0.5rem;
}

.hl-time {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent-cyan);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.hl-term {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent-purple);
    background: rgba(139, 92, 246, 0.12);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.hl-card-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    align-items: center;
}

.hl-pillars-wrapper {
    flex: 1;
}

.hl-pillars-table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
    font-size: 0.75rem;
}

.hl-pillars-table th {
    font-size: 0.7rem;
    color: var(--text-secondary);
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border-glass);
}

.hl-pillars-table td {
    padding: 0.5rem 0.25rem;
    font-weight: 700;
    font-size: 0.95rem;
    font-family: 'Playfair Display', serif;
}

.hl-pillars-table td.wood { color: var(--color-wood); }
.hl-pillars-table td.fire { color: var(--color-fire); }
.hl-pillars-table td.earth { color: var(--color-earth); }
.hl-pillars-table td.metal { color: var(--color-metal); }
.hl-pillars-table td.water { color: var(--color-water); }

.hl-pillars-table td.hide-stem {
    font-size: 0.65rem;
    font-family: inherit;
    font-weight: normal;
    color: var(--text-muted);
}

.hl-grid-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hl-grid-table {
    border-collapse: collapse;
    border: 1px solid var(--border-glass);
}

.hl-grid-table td.hl-cell {
    width: 80px;
    height: 38px;
    text-align: center;
    vertical-align: middle;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.01);
    transition: var(--transition-smooth);
    white-space: nowrap;
}

.hl-grid-table td.hl-cell.match {
    color: #fff;
    font-weight: 700;
    border: 1px dashed var(--accent-cyan);
    background: rgba(6, 182, 212, 0.15) !important;
    box-shadow: inset 0 0 8px rgba(6, 182, 212, 0.25);
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    animation: cellPulse 2s infinite alternate;
}

@keyframes cellPulse {
    0% { background: rgba(6, 182, 212, 0.1); }
    100% { background: rgba(6, 182, 212, 0.22); }
}

.hl-card-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.4rem;
    font-size: 0.72rem;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.15);
    padding: 0.6rem;
    border-radius: 6px;
}

.hl-card-meta div strong {
    color: var(--text-primary);
}

.hl-stars-summary {
    display: flex;
    gap: 0.5rem;
}

.star-pill {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
}

.star-pill span {
    font-size: 0.72rem;
    font-weight: 600;
}

.star-pill.suns-pill span { color: #f59e0b; }
.star-pill.moons-pill span { color: #818cf8; }

.star-pill small {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

/* Wuxing element plain text color classes */
.text-wood { color: var(--color-wood) !important; }
.text-fire { color: var(--color-fire) !important; }
.text-earth { color: var(--color-earth) !important; }
.text-metal { color: var(--color-metal) !important; }
.text-water { color: var(--color-water) !important; }

/* Category badges */
.category-badge {
    background: rgba(0, 242, 254, 0.12);
    color: var(--accent-cyan);
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(0, 242, 254, 0.2);
}

.saved-item-card:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(0, 242, 254, 0.3) !important;
}

/* Login System Styles */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(8, 10, 18, 0.88);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-card {
    width: 380px;
    padding: 2.5rem 2.25rem;
    text-align: center;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    animation: loginSlideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

@keyframes loginSlideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-logo {
    margin-bottom: 1.25rem;
    display: flex;
    justify-content: center;
}

.login-logo img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(0, 242, 254, 0.4));
    animation: logoFloat 4s ease-in-out infinite alternate;
}

@keyframes logoFloat {
    0% { transform: translateY(0); }
    100% { transform: translateY(-8px); }
}

.login-card h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    background: linear-gradient(135deg, #fff 30%, var(--accent-cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 2.25rem;
}

.login-form {
    text-align: left;
}

.login-form .form-group label {
    margin-bottom: 0.5rem;
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
}

.login-btn {
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.25);
    transition: all 0.3s;
}

.login-btn:hover {
    box-shadow: 0 0 25px rgba(0, 242, 254, 0.5);
    transform: translateY(-2px);
}

.login-error-msg {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #f87171;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    font-size: 0.8rem;
    line-height: 1.4;
    animation: loginErrorShake 0.4s ease-in-out;
}

@keyframes loginErrorShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}
