/* Dark Theme Variables */
:root {
    --bg: #0E1624;
    --bg-dark: #09111D;
    --card: #111B2E;
    --card-hover: #1A2538;
    --muted: #8FA0B8;
    --text: #ECF2F5;
    --text-secondary: #B8C5D6;
    --accent: #7FE8C1;
    --accent2: #7DA6FF;
    --accent3: #A78BFA;
    --glass: rgba(255, 255, 255, 0.06);
    --glass-hover: rgba(255, 255, 255, 0.1);
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-lg: rgba(0, 0, 0, 0.5);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg) 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--text);
    line-height: 1.6;
    padding: 0;
    overflow-x: hidden;
    transition: opacity 0.5s ease;
}

.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
}

/* Top Navigation Bar - Professional Design */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(17, 27, 46, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    display: flex;
    align-items: center;
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 3rem;
    height: 100%;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.back-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-right: 8px;
}

.back-button:hover {
    background: var(--glass-hover);
    border-color: var(--border-hover);
    color: var(--text);
    transform: translateX(-2px);
}

.back-button svg {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.back-button:hover svg {
    transform: translateX(-2px);
}

.back-button span {
    white-space: nowrap;
}

.brand-logo {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
    border-radius: 10px;
    color: var(--bg-dark);
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.brand-subtitle {
    font-size: 11px;
    color: var(--muted);
    line-height: 1.2;
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    justify-content: center;
    margin: 0 2rem;
}

/* Shop Selector */
.shop-selector-nav {
    margin-left: auto;
    margin-right: 1rem;
}

.shop-select-dropdown {
    padding: 8px 16px;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    min-width: 140px;
}

.shop-select-dropdown:hover {
    background: var(--glass-hover);
    border-color: var(--border-hover);
}

.shop-select-dropdown:focus {
    border-color: var(--accent2);
    box-shadow: 0 0 0 3px rgba(125, 166, 255, 0.1);
}

.shop-select-dropdown option {
    background: var(--card);
    color: var(--text);
    padding: 8px;
}

/* Language Switcher */
.language-switcher {
    display: flex;
    align-items: center;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lang-btn:hover {
    background: var(--glass-hover);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

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

.beta-badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 0.5rem;
    vertical-align: middle;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

/* Performance Optimization: Use GPU Acceleration */
.financial-group-card,
.portrait-card {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Optimize Chart Container */
.chart-card canvas {
    max-height: 300px;
}

/* Optimize Animation Performance */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.financial-group-card,
.portrait-card {
    animation: fadeIn 0.3s ease-out;
}

.nav-link {
    padding: 8px 16px;
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--text);
    background: var(--glass);
}

.nav-link.active {
    color: var(--accent);
    background: var(--glass);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 16px;
    right: 16px;
    height: 2px;
    background: var(--accent);
    border-radius: 2px 2px 0 0;
}

/* Removed: Search, notification and account feature related styles (not needed for demo) */

/* Dashboard Header */
.dashboard-header {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 2rem;
    margin-top: 64px;
    position: relative;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.header-content h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.02em;
}

.header-actions {
    display: flex;
    gap: 12px;
}

.btn-primary, .btn-secondary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
    color: var(--bg-dark);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(127, 232, 193, 0.3);
}

.btn-secondary {
    background: var(--glass);
    color: var(--text);
    border-color: var(--border);
}

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

/* Update Settings Area */
.update-settings {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-right: 12px;
}

.auto-update-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.auto-update-selector label {
    color: var(--text-secondary);
    font-size: 14px;
    white-space: nowrap;
}

.update-select {
    padding: 8px 12px;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
}

.update-select:hover {
    background: var(--glass-hover);
    border-color: var(--border-hover);
}

.update-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(127, 232, 193, 0.1);
}

.btn-update {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, var(--accent3) 0%, var(--accent2) 100%);
    color: var(--bg-dark);
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-update:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(167, 139, 250, 0.3);
}

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

.btn-update:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-update.updating {
    position: relative;
    color: transparent;
}

.btn-update.updating::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid var(--bg-dark);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.update-status {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 12px 20px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow-lg);
    z-index: 2000;
    display: none;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.3s ease;
}

.update-status.show {
    display: flex;
}

.update-status.success {
    border-color: var(--accent);
    background: rgba(127, 232, 193, 0.1);
}

.update-status.error {
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
}

.update-status.info {
    border-color: var(--accent2);
    background: rgba(125, 166, 255, 0.1);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* View Toggle Buttons */
.view-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.view-toggle-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.view-toggle-btn {
    padding: 0.5rem 1rem;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-toggle-btn:hover {
    background: var(--glass-hover);
    border-color: var(--border-hover);
    color: var(--text);
}

.view-toggle-btn.active {
    background: linear-gradient(135deg, rgba(127, 232, 193, 0.2) 0%, rgba(125, 166, 255, 0.2) 100%);
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
}

.time-range-selector {
    margin-left: auto;
}

.time-range-selector select {
    padding: 0.5rem 1rem;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.time-range-selector select:hover {
    background: var(--glass-hover);
    border-color: var(--border-hover);
}

.time-range-selector select:focus {
    outline: none;
    border-color: var(--accent);
}

/* Time Distribution Chart Container */
.timeline-summary {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--card);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.header-content h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 0.95rem;
    color: var(--muted);
    margin-bottom: 1.5rem;
}

.header-stats {
    display: flex;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.stat-card {
    background: var(--card);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: 12px;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.stat-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass);
    border-radius: 10px;
    color: var(--accent);
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.stat-card:hover::before {
    left: 100%;
}

.stat-card:hover {
    transform: translateY(-5px);
    background: var(--glass-hover);
    border-color: var(--border-hover);
    box-shadow: 0 8px 24px var(--shadow);
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--text);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--muted);
    font-weight: 500;
}

/* Removed old tab navigation, using top navigation bar */

/* Main Content Area */
.dashboard-main {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.tab-content {
    display: none;
    animation: fadeInUp 0.4s ease;
}

.tab-content.active {
    display: block;
}

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

.section-title {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.section-title h2 {
    font-size: 1.5rem;
    color: var(--text);
    margin-bottom: 0.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.section-title p {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 400;
}

/* Chart Grid - Dark Cards */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 16px var(--shadow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.chart-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent2), var(--accent3));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.chart-card:hover::before {
    transform: scaleX(1);
}

.chart-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px var(--shadow-lg);
    border-color: var(--border-hover);
    background: var(--card-hover);
}

.chart-card h3 {
    font-size: 1.2rem;
    color: var(--text);
    margin-bottom: 1rem;
    font-weight: 600;
}

.chart-card.full-width {
    grid-column: 1 / -1;
}

/* Accordion Card Component */
.accordion {
    margin-top: 2rem;
}

.acc-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.acc-item:hover {
    border-color: var(--border-hover);
    background: var(--card-hover);
}

.acc-header {
    padding: 16px 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text);
    transition: all 0.3s ease;
}

.acc-header:hover {
    background: var(--glass);
}

.acc-header .arrow {
    transition: transform 0.3s ease;
    color: var(--accent);
    font-size: 12px;
}

.acc-item.active .arrow {
    transform: rotate(90deg);
}

.acc-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
    padding: 0 20px;
}

.acc-content-inner {
    padding: 12px 0 18px;
    color: var(--muted);
    line-height: 1.65;
    font-size: 15px;
}

/* Insights Summary */
.insights-summary {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--card);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.section-header h3 {
    font-size: 1.25rem;
    color: var(--text);
    font-weight: 600;
    margin: 0;
}

.section-badge {
    font-size: 11px;
    padding: 4px 10px;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--accent);
    font-weight: 500;
}

.insights-summary h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text);
    font-weight: 600;
}

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

.insight-card {
    background: var(--glass);
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid var(--accent);
    box-shadow: 0 2px 8px var(--shadow);
    transition: all 0.3s ease;
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
}

.insight-card:hover {
    transform: translateX(5px);
    background: var(--glass-hover);
    box-shadow: 0 4px 12px var(--shadow);
}

.insight-card h4 {
    color: var(--accent);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.insight-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 0.5rem;
}

/* Cluster Selector */
.cluster-selector {
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--card);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.cluster-selector label {
    font-weight: 600;
    margin-right: 1rem;
    color: var(--text);
}

.cluster-selector select {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 1rem;
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    min-width: 200px;
    transition: all 0.3s ease;
}

.cluster-selector select:hover {
    border-color: var(--border-hover);
    background: var(--card-hover);
}

.cluster-selector select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(127, 232, 193, 0.1);
}

/* Cluster Details */
.cluster-details {
    display: none;
    animation: fadeInUp 0.4s ease;
}

.cluster-details.active {
    display: block;
}

.cluster-info-card {
    background: var(--card);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 16px var(--shadow);
    border: 1px solid var(--border);
}

.cluster-info-card h3 {
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    font-weight: 700;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.info-item {
    padding: 1rem;
    background: var(--glass);
    border-radius: 10px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.info-item:hover {
    background: var(--glass-hover);
    border-color: var(--border-hover);
}

.info-item strong {
    color: var(--accent);
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.info-item span {
    color: var(--text-secondary);
}

.strategy-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.strategy-section h4 {
    color: var(--text);
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.strategy-list {
    list-style: none;
}

.strategy-list li {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: var(--glass);
    border-radius: 8px;
    border-left: 3px solid var(--accent);
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.strategy-list li:hover {
    background: var(--glass-hover);
    transform: translateX(5px);
    border-left-color: var(--accent2);
}

/* Portrait Card */
.portrait-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 2rem;
}

/* Enhanced User Portrait Card */
.portrait-card-enhanced {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 16px var(--shadow);
}

.portrait-card-enhanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.portrait-card-enhanced:hover::before {
    transform: scaleX(1);
}

.portrait-card-enhanced:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px var(--shadow-lg);
    border-color: var(--border-hover);
}

.portrait-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border);
}

.portrait-title-section h3 {
    font-size: 0.9rem;
    color: var(--muted);
    font-weight: 500;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.portrait-title-section h2 {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.5rem;
    margin: 0;
    font-weight: 700;
    line-height: 1.3;
}

.portrait-stats-mini {
    display: flex;
    gap: 1rem;
}

.stat-mini {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: var(--glass);
    border-radius: 8px;
    border: 1px solid var(--border);
    min-width: 60px;
}

.stat-mini-value {
    font-size: 1.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.stat-mini-label {
    font-size: 0.7rem;
    color: var(--muted);
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.portrait-visualizations {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    grid-auto-rows: min-content;
}

/* Compact Visualization Area (Word Cloud, Price Preference, etc.) */
.visualization-compact {
    grid-column: span 1;
}

/* Full-width Visualization Area (Heatmap, Radar Chart) */
.visualization-fullwidth {
    grid-column: 1 / -1;
}

.visualization-section {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.75rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.visualization-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent2), var(--accent3));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.visualization-section:hover::before {
    transform: scaleX(1);
}

.visualization-section:hover {
    background: var(--glass-hover);
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.visualization-header {
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.visualization-section h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 0.25rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.visualization-subtitle {
    font-size: 0.85rem;
    color: var(--muted);
    margin: 0;
    font-weight: 400;
}

.visualization-content {
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

/* Ensure compact visualization areas maintain consistent dimensions */
.visualization-compact .visualization-content {
    min-height: 240px;
    height: 240px;
}

.visualization-heatmap {
    min-height: 450px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wordcloud-canvas {
    width: 100% !important;
    height: 240px !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    border-radius: 8px;
    object-fit: contain;
}

/* Ensure word cloud container maintains correct aspect ratio */
.visualization-section:has(.wordcloud-canvas) .visualization-content {
    width: 100%;
    height: 240px;
    position: relative;
    overflow: hidden;
}

.chart-canvas {
    width: 100% !important;
    height: 240px !important;
}

.chart-compact {
    height: 240px !important;
}

.chart-radar {
    height: 400px !important;
    max-width: 400px !important;
    margin: 0 auto;
    aspect-ratio: 1 / 1;
}

/* Ensure radar chart container remains square */
.visualization-section:has(.chart-radar) .visualization-content {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

/* Heatmap canvas special styles - allow adaptive height */
.heatmap-canvas {
    width: 100% !important;
    height: auto !important;
    min-height: 450px !important;
    max-height: none !important;
    display: block !important;
    border-radius: 8px;
}

/* Price Preference Display Styles */
.price-preference-content {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 240px;
    height: 240px;
    padding: 1rem;
    width: 100%;
    box-sizing: border-box;
}

.price-preference-card {
    width: 100%;
    max-width: 100%;
    background: var(--glass);
    border: 1px solid var(--border);
    border-top: 4px solid;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
    text-align: center;
}

.price-preference-card:hover {
    background: var(--glass-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.price-preference-icon {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-bottom: 0.5rem;
}

.price-preference-icon svg {
    width: 32px;
    height: 32px;
}

.price-preference-info {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.price-preference-label {
    font-size: 0.75rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.price-preference-value {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.price-preference-count {
    font-size: 0.85rem;
    color: var(--muted);
}

.price-preference-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
    font-size: 0.9rem;
}

.price-preference-item {
    background: var(--glass);
    border: 1px solid var(--border);
    border-left: 3px solid;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.price-preference-item:last-child {
    margin-bottom: 0;
}

.price-preference-item:hover {
    background: var(--glass-hover);
    transform: translateX(4px);
}

.price-preference-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.price-preference-item-icon svg {
    width: 20px;
    height: 20px;
}

.price-preference-item-info {
    flex: 1;
}

.price-preference-item-label {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.price-preference-item-count {
    font-size: 0.8rem;
    color: var(--muted);
}

.portrait-card {
    background: var(--card);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 16px var(--shadow);
    transition: all 0.3s ease;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.portrait-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.portrait-card:hover::before {
    transform: scaleX(1);
}

.portrait-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px var(--shadow-lg);
    border-color: var(--border-hover);
    background: var(--card-hover);
}

.portrait-card h3 {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    font-size: 1.3rem;
    font-weight: 700;
}

.portrait-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.portrait-stat {
    flex: 1;
    text-align: center;
    padding: 0.75rem;
    background: var(--glass);
    border-radius: 10px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.portrait-stat:hover {
    background: var(--glass-hover);
    transform: scale(1.05);
}

.portrait-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.portrait-stat-label {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 0.25rem;
}

/* Business Insights Container */
.insights-container {
    display: grid;
    gap: 1.5rem;
}

.insights-section {
    margin-bottom: 3rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid var(--border);
}

.insights-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.insights-section .section-header {
    margin-bottom: 2rem;
}

.insights-section .section-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.insights-section .section-description {
    font-size: 0.95rem;
    color: var(--muted);
    margin: 0;
}

.insight-card-large {
    background: var(--card);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 16px var(--shadow);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.insight-card-large:hover {
    box-shadow: 0 8px 24px var(--shadow-lg);
    border-color: var(--border-hover);
    transform: translateY(-3px);
}

.insight-card-large h3 {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
}

.insight-section {
    margin-bottom: 1.5rem;
}

.insight-section h4 {
    color: var(--text);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.insight-section ul {
    list-style: none;
    padding-left: 0;
}

.insight-section li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    transition: all 0.3s ease;
    padding-left: 1.5rem;
    position: relative;
}

.insight-section li:hover {
    color: var(--text);
    padding-left: 2rem;
}

.insight-section li:last-child {
    border-bottom: none;
}

.insight-section li::before {
    content: "→";
    color: var(--accent);
    font-weight: bold;
    margin-right: 0.5rem;
    position: absolute;
    left: 0;
    transition: transform 0.3s ease;
}

.insight-section li:hover::before {
    transform: translateX(5px);
}

/* Product Details */
.product-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.product-card {
    background: var(--card);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 16px var(--shadow);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px var(--shadow-lg);
    border-color: var(--border-hover);
}

.product-card h4 {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.product-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.product-stat {
    text-align: center;
}

.product-stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.product-stat-label {
    font-size: 0.85rem;
    color: var(--muted);
}

/* Tag Styles */
.pill {
    display: inline-block;
    padding: 6px 12px;
    background: var(--glass);
    border-radius: 10px;
    margin: 4px 4px 0 0;
    font-size: 12px;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.pill:hover {
    background: var(--glass-hover);
    color: var(--text);
    border-color: var(--accent);
    transform: translateY(-2px);
}

/* Footer */
.dashboard-footer {
    background: var(--card);
    padding: 1.5rem 2rem;
    color: var(--muted);
    border-top: 1px solid var(--border);
    margin-top: 3rem;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-left p {
    margin: 0;
    font-size: 13px;
}

.footer-right {
    display: flex;
    gap: 24px;
}

.footer-right a {
    color: var(--muted);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s ease;
}

.footer-right a:hover {
    color: var(--text);
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--card);
}

::-webkit-scrollbar-thumb {
    background: var(--glass);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--glass-hover);
}

/* Homepage Styles */
.homepage-hero {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 4rem 3rem;
    margin-bottom: 3rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.homepage-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(127, 232, 193, 0.05) 0%, rgba(125, 166, 255, 0.05) 100%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.homepage-hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--text) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--muted);
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2rem;
}

.hero-stat {
    text-align: center;
}

.hero-stat-value {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.hero-stat-label {
    font-size: 0.9rem;
    color: var(--muted);
    font-weight: 500;
}

.clustering-intro {
    margin-bottom: 4rem;
}

.intro-header {
    text-align: center;
    margin-bottom: 3rem;
}

.intro-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.intro-header p {
    font-size: 1.05rem;
    color: var(--muted);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

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

.dimension-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.dimension-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.dimension-card:hover::before {
    transform: scaleX(1);
}

.dimension-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 8px 24px var(--shadow);
    transform: translateY(-4px);
}

.dimension-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--accent);
    margin-bottom: 1.5rem;
}

.dimension-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.75rem;
}

.dimension-card > p {
    font-size: 0.95rem;
    color: var(--muted);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.dimension-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.dimension-tag {
    display: inline-block;
    padding: 6px 12px;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.dimension-tag:hover {
    background: var(--glass-hover);
    border-color: var(--accent);
    color: var(--text);
}

.clustering-benefits {
    margin-bottom: 4rem;
}

.benefits-header {
    text-align: center;
    margin-bottom: 3rem;
}

.benefits-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.benefits-header p {
    font-size: 1.05rem;
    color: var(--muted);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.benefit-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.3s ease;
    position: relative;
}

.benefit-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 8px 24px var(--shadow);
    transform: translateY(-4px);
}

.benefit-number {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0.1;
    line-height: 1;
}

.benefit-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.75rem;
    margin-top: 0.5rem;
}

.benefit-card p {
    font-size: 0.95rem;
    color: var(--muted);
    line-height: 1.6;
}

.quick-actions {
    margin-top: 4rem;
}

.quick-actions h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2rem;
    text-align: center;
    letter-spacing: -0.02em;
}

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

.action-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    display: block;
    position: relative;
    overflow: hidden;
}

.action-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.action-card:hover::before {
    transform: scaleX(1);
}

.action-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 8px 24px var(--shadow);
    transform: translateY(-4px);
}

.action-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--accent);
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.action-card:hover .action-icon {
    background: linear-gradient(135deg, rgba(127, 232, 193, 0.2) 0%, rgba(125, 166, 255, 0.2) 100%);
    border-color: var(--accent);
    transform: scale(1.1);
}

.action-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.75rem;
}

.action-card p {
    font-size: 0.95rem;
    color: var(--muted);
    line-height: 1.6;
    margin: 0;
}

/* Business Insights Card Special Styles */
.business-insights-card {
    border: 2px solid rgba(102, 126, 234, 0.3);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
}

.business-insights-card:hover {
    border-color: rgba(102, 126, 234, 0.6);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
}

.business-insights-card .action-icon {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    border-color: rgba(102, 126, 234, 0.4);
    color: #667eea;
}

.business-insights-card:hover .action-icon {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.3) 100%);
    border-color: rgba(102, 126, 234, 0.6);
    transform: scale(1.1) rotate(5deg);
}

/* User Journey Map Styles */
/* Removed: Usage guide related styles */

/* Responsive Design */
@media (max-width: 1024px) {
    .navbar-menu {
        display: none;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .header-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .header-stats {
        flex-direction: column;
    }
    
    .dashboard-main {
        padding: 1rem;
    }
    
    .portrait-cards {
        grid-template-columns: 1fr;
    }
    
    .portrait-visualizations {
        grid-template-columns: 1fr;
    }
    
    .portrait-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .portrait-stats-mini {
        width: 100%;
        justify-content: space-around;
    }
    
    .navbar-container {
        padding: 0 1rem;
    }
    
    .brand-subtitle {
        display: none;
    }
    
    
    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    
    .homepage-hero {
        padding: 2rem 1.5rem;
    }
    
    .homepage-hero h1 {
        font-size: 1.75rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .clustering-dimensions {
        grid-template-columns: 1fr;
    }
    
    .benefits-grid {
        grid-template-columns: 1fr;
    }
    
    .actions-grid {
        grid-template-columns: 1fr;
    }
}

/* Loading Animation */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--muted);
}

.loading::after {
    content: "...";
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: "."; }
    40% { content: ".."; }
    60%, 100% { content: "..."; }
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* Gradient Text Animation */
@keyframes gradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.gradient-text {
    background: linear-gradient(-45deg, var(--accent), var(--accent2), var(--accent3), var(--accent));
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient 3s ease infinite;
}

/* Conversion Path Visualization Styles */
.journey-hero {
    text-align: center;
    padding: 3rem 2rem;
    margin-bottom: 3rem;
}

.journey-hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.journey-hero p {
    font-size: 1.1rem;
    color: var(--muted);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

.journey-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Conversion Visualization Container */
.journey-visualization-container {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.journey-funnel-section,
.journey-flow-section {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
}

.journey-funnel-section h3,
.journey-flow-section h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.section-subtitle {
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 1.5rem;
}

.funnel-container,
.flow-diagram-container {
    width: 100%;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(17, 27, 46, 0.3);
    border-radius: 12px;
    padding: 2rem;
}

.journey-clusters-section {
    margin-top: 2rem;
}

.journey-path {
    display: flex;
    flex-direction: column;
    gap: 4rem;
    position: relative;
}

.journey-stage {
    position: relative;
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

.journey-stage:nth-child(1) { animation-delay: 0.1s; }
.journey-stage:nth-child(2) { animation-delay: 0.3s; }
.journey-stage:nth-child(3) { animation-delay: 0.5s; }

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

.stage-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 2rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.stage-header:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px var(--shadow-lg);
    border-color: var(--border-hover);
}

.stage-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.stage-icon svg {
    width: 40px;
    height: 40px;
}

.stage-info {
    flex: 1;
}

.stage-info h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.stage-info p {
    font-size: 1rem;
    color: var(--muted);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.stage-stats {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.stat-item strong {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent);
}

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

.cluster-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    animation: slideIn 0.5s ease forwards;
    opacity: 0;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.cluster-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.cluster-card:hover::before {
    transform: scaleX(1);
}

.cluster-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 32px var(--shadow-lg);
    border-color: var(--border-hover);
    background: var(--card-hover);
}

.cluster-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.cluster-badge {
    padding: 0.4rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.cluster-size {
    font-size: 0.9rem;
    color: var(--muted);
    font-weight: 500;
}

.cluster-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 1rem;
    line-height: 1.4;
}

.cluster-progress {
    position: relative;
    height: 8px;
    background: var(--glass);
    border-radius: 4px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
    box-shadow: 0 0 10px rgba(127, 232, 193, 0.5);
}

.progress-text {
    position: absolute;
    right: 0;
    top: -20px;
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 500;
}

.cluster-characteristics {
    margin-bottom: 1rem;
}

.char-item {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    line-height: 1.5;
}

.char-key {
    color: var(--muted);
    font-weight: 500;
    min-width: 80px;
}

.char-value {
    color: var(--text-secondary);
    flex: 1;
}

.cluster-actions {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.btn-view-details {
    width: 100%;
    padding: 0.875rem 1.25rem;
    background: linear-gradient(135deg, rgba(127, 232, 193, 0.15) 0%, rgba(125, 166, 255, 0.15) 100%);
    border: 1.5px solid var(--accent);
    border-radius: 10px;
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.btn-view-details::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-view-details:hover::before {
    left: 100%;
}

.btn-view-details:hover {
    background: linear-gradient(135deg, rgba(127, 232, 193, 0.25) 0%, rgba(125, 166, 255, 0.25) 100%);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(127, 232, 193, 0.3);
}

.btn-view-details:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(127, 232, 193, 0.2);
}

.btn-view-details .btn-icon {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.btn-view-details:hover .btn-icon {
    transform: scale(1.2) rotate(10deg);
}

.btn-view-details .btn-text {
    flex: 1;
    text-align: center;
}

.btn-view-details .btn-arrow {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
    font-weight: 700;
}

.btn-view-details:hover .btn-arrow {
    transform: translateX(4px);
}

.stage-connector {
    height: 60px;
    margin: 2rem 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stage-connector svg {
    width: 100%;
    max-width: 400px;
    height: 100%;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .clusters-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
    
    .stage-header {
        flex-direction: column;
        text-align: center;
    }
    
    .stage-icon {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .journey-hero h1 {
        font-size: 2rem;
    }
    
    .clusters-grid {
        grid-template-columns: 1fr;
    }
    
    .stage-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .btn-view-details {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }
    
    .btn-view-details .btn-icon {
        font-size: 0.9rem;
    }
    
    .btn-view-details .btn-arrow {
        font-size: 1rem;
    }
}

/* User Trajectory Styles */
.user-filters {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.user-filters input,
.user-filters select {
    transition: all 0.3s ease;
}

.user-filters input:focus,
.user-filters select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(127, 232, 193, 0.1);
}

.user-trajectories {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* User Trajectory Timeline */
.user-trajectory-timeline {
    width: 100%;
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 12px;
}

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

.timeline-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.timeline-legend {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.timeline-container {
    position: relative;
    width: 100%;
    z-index: 1;
}

.trajectory-timeline-canvas {
    width: 100% !important;
    height: 400px !important;
    display: block;
    cursor: pointer;
}

.timeline-tooltips {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

.timeline-segment-tooltip {
    position: absolute;
    width: 280px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 8px 24px var(--shadow-lg);
    pointer-events: auto;
    z-index: 1001 !important;
    opacity: 0;
    transition: opacity 0.2s ease;
    will-change: opacity, transform;
}

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

.tooltip-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
}

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

.tooltip-cluster {
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    margin-bottom: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.tooltip-cluster .cluster-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}

.tooltip-cluster .cluster-name {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.tooltip-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tooltip-detail-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    gap: 0.5rem;
}

.tooltip-detail-item.intent-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.tooltip-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.tooltip-value {
    color: var(--text);
    font-weight: 600;
    font-size: 0.85rem;
}

/* User Overview Card */
.user-overview-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.overview-card {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    transition: all 0.3s ease;
}

.overview-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--shadow);
}

.overview-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

.overview-icon {
    font-size: 1.2rem;
}

.overview-title {
    flex: 1;
}

/* Stage Distribution */
.stage-bars {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.stage-bar-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stage-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.stage-bar-value {
    font-weight: 600;
    color: var(--text);
}

.stage-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(143, 160, 184, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.stage-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* Path Visualization */
.path-visualization {
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.path-canvas {
    width: 100% !important;
    height: 120px !important;
    display: block;
}

/* Bottleneck Analysis Card */
.stuck-point-card {
    background: linear-gradient(135deg, rgba(251, 113, 133, 0.05) 0%, rgba(251, 191, 36, 0.05) 100%);
}

.stuck-point-message {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Intent Strength Badge */
.intent-badge {
    background: linear-gradient(135deg, rgba(127, 232, 193, 0.1) 0%, rgba(125, 166, 255, 0.1) 100%);
    border-color: rgba(127, 232, 193, 0.3);
}

.user-stuck-point {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
}

.user-trajectory-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.3s ease;
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
    position: relative;
    z-index: 1;
}

.user-trajectory-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px var(--shadow-lg);
    border-color: var(--border-hover);
}

.user-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.user-id-section {
    margin-bottom: 1rem;
}

.user-id {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.75rem;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    letter-spacing: 0.5px;
}

.user-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.4rem 0.75rem;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.stat-badge strong {
    color: var(--accent);
    font-weight: 600;
}

.user-clusters-summary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.user-clusters-summary strong {
    color: var(--text);
}

.cluster-tag {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--accent);
    cursor: pointer;
    transition: all 0.3s ease;
}

.cluster-tag:hover {
    background: linear-gradient(135deg, rgba(127, 232, 193, 0.1) 0%, rgba(125, 166, 255, 0.1) 100%);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.user-segments {
    position: relative;
    padding-left: 2rem;
}

.segment-item {
    position: relative;
    margin-bottom: 1.5rem;
    animation: slideInLeft 0.4s ease forwards;
    opacity: 0;
}

.segment-item:last-child {
    margin-bottom: 0;
}

.segment-item:last-child .timeline-line {
    display: none;
}

.segment-timeline {
    position: absolute;
    left: -2rem;
    top: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.timeline-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--bg);
    box-shadow: 0 0 0 2px currentColor;
    z-index: 2;
    flex-shrink: 0;
}

.timeline-line {
    width: 2px;
    flex: 1;
    background: var(--border);
    margin: 4px 0;
    min-height: 40px;
}

.segment-content {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    transition: all 0.3s ease;
}

.segment-content:hover {
    background: var(--card-hover);
    border-color: var(--border-hover);
    transform: translateX(4px);
    box-shadow: 0 4px 12px var(--shadow);
}

.segment-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.segment-time {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.segment-time strong {
    font-size: 0.95rem;
    color: var(--text);
    font-weight: 600;
}

.segment-time span {
    font-size: 0.85rem;
    color: var(--muted);
}

.segment-cluster {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 200px;
}

.cluster-label {
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 500;
}

.cluster-name {
    font-size: 0.9rem;
    color: var(--text);
    font-weight: 600;
}

.segment-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-item.intent-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.detail-label {
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 500;
}

.detail-value {
    font-size: 0.9rem;
    color: var(--text);
    font-weight: 600;
}

.stage-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.85rem;
    display: inline-block;
}

.intent-progress {
    width: 100%;
    position: relative;
    height: 24px;
    background: rgba(143, 160, 184, 0.1);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.intent-progress-bar {
    height: 100%;
    border-radius: 12px;
    transition: width 0.5s ease;
    position: relative;
}

.intent-progress-value {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    z-index: 1;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@media (max-width: 768px) {
    .user-segments {
        padding-left: 1.5rem;
    }
    
    .segment-header {
        flex-direction: column;
    }
    
    .segment-cluster {
        width: 100%;
    }
    
    .segment-details {
        grid-template-columns: 1fr;
    }
}

/* Sub-tab Styles */
.sub-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
}

.sub-tab-btn {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    margin-bottom: -1px;
}

.sub-tab-btn:hover {
    color: var(--text);
    background: var(--glass);
}

.sub-tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: transparent;
}

.sub-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
}

.sub-tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.sub-tab-content.active {
    display: block;
}

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