/* ============================================================
   gabs.cx -- Glassmorphism Frosted SaaS Dashboard
   Colors: #667eea, #4facfe, #00f2fe, #10b981, #f59e0b, #1a1a2e, #ffffff
   Fonts: Plus Jakarta Sans, Noto Sans KR, JetBrains Mono
   ============================================================ */

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

:root {
    --gradient-start: #667eea;
    --gradient-mid: #4facfe;
    --gradient-end: #00f2fe;
    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.25);
    --glass-hover: rgba(255, 255, 255, 0.22);
    --text-white: #ffffff;
    --text-dark: #1a1a2e;
    --success: #10b981;
    --warning: #f59e0b;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    --font-kr: 'Noto Sans KR', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

html {
    height: 100%;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-white);
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #1a1a2e 100%);
    overflow-x: hidden;
    position: relative;
}

/* Monospace utility */
.mono {
    font-family: var(--font-mono);
    font-weight: 500;
}

/* ============================================================
   Floating Gradient Blobs
   ============================================================ */
.gradient-blobs {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    will-change: transform;
    animation: blobFloat 20s ease-in-out infinite;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: #667eea;
    top: -100px;
    left: -50px;
    animation-delay: 0s;
}

.blob-2 {
    width: 350px;
    height: 350px;
    background: #4facfe;
    top: 30%;
    right: -80px;
    animation-delay: -5s;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background: #00f2fe;
    bottom: 10%;
    left: 30%;
    animation-delay: -10s;
}

.blob-4 {
    width: 250px;
    height: 250px;
    background: #10b981;
    bottom: -60px;
    right: 20%;
    animation-delay: -15s;
}

@keyframes blobFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -40px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(15px, 30px) scale(1.02); }
}

/* ============================================================
   Dashboard Layout
   ============================================================ */
.dashboard {
    display: grid;
    grid-template-columns: 200px 1fr 280px;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* ============================================================
   Sidebar Navigation
   ============================================================ */
.sidebar {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-logo {
    display: flex;
    flex-direction: column;
    padding: 0 0.5rem;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-white);
    letter-spacing: -0.02em;
}

.logo-dot {
    color: var(--gradient-end);
}

.logo-sub {
    font-family: var(--font-kr);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 0.125rem;
}

.nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 12px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.25s ease;
    font-size: 0.9rem;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-white);
}

.nav-item.active {
    background: var(--glass-bg);
    color: var(--text-white);
    border: 1px solid var(--glass-border);
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ============================================================
   Main Content Area
   ============================================================ */
.main-content {
    padding: 2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* ============================================================
   Glass Card Base
   ============================================================ */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
    background: var(--glass-hover);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

/* ============================================================
   Hero Section
   ============================================================ */
.hero {
    text-align: center;
    padding: 2.5rem 1.5rem 1.5rem;
    position: relative;
}

.hero-title {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 700;
    color: var(--text-white);
    letter-spacing: -0.03em;
}

.hero-dot {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 0.25rem;
}

/* Hero Metric Card */
.hero-metric {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 2rem;
    margin-top: 1.5rem;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

.metric-ring-container {
    position: relative;
    width: 120px;
    height: 120px;
    flex-shrink: 0;
}

.progress-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.ring-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 8;
}

.ring-fill {
    fill: none;
    stroke: var(--success);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 251.2;
    stroke-dashoffset: 251.2;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1), stroke 0.5s ease;
}

.ring-label {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ring-value {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 1.75rem;
    color: var(--text-white);
}

.ring-unit {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hero-metric-detail {
    text-align: left;
}

.hero-metric-detail h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: 0.25rem;
}

.metric-kr {
    font-family: var(--font-kr);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 0.5rem;
}

.metric-desc {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.5;
}

/* ============================================================
   Metrics Bento Grid
   ============================================================ */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.metric-card {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    cursor: default;
}

.metric-card:hover {
    transform: translateY(-2px);
}

.metric-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.metric-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
}

.sparkline {
    width: 60px;
    height: 24px;
}

.sparkline-line {
    fill: none;
    stroke: var(--gradient-mid);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

.sparkline-line.warning-line {
    stroke: var(--warning);
}

.metric-value {
    font-size: 2rem;
    font-weight: 500;
    color: var(--text-white);
    line-height: 1.1;
}

.metric-unit {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.5);
}

.metric-change {
    font-size: 0.75rem;
    font-weight: 700;
}

.metric-change.positive {
    color: var(--success);
}

.metric-change.warning {
    color: var(--warning);
}

.warning-text {
    color: var(--warning);
}

/* ============================================================
   Customer Journey Section
   ============================================================ */
.journey-section {
    padding-top: 1rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-white);
}

.section-subtitle {
    font-family: var(--font-kr);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 1.25rem;
}

.journey-map {
    display: flex;
    align-items: center;
    gap: 0;
    overflow-x: auto;
    padding: 1rem 0;
}

.journey-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem 1rem;
    min-width: 120px;
    flex-shrink: 0;
    text-align: center;
}

.journey-node:hover {
    transform: translateY(-4px);
}

.node-ring-container {
    position: relative;
    width: 60px;
    height: 60px;
}

.mini-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.mini-ring-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 4;
}

.mini-ring-fill {
    fill: none;
    stroke: var(--success);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 150.8;
    stroke-dashoffset: 150.8;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1), stroke 0.5s ease;
}

.mini-ring-value {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: var(--text-white);
}

.node-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-white);
}

.node-label-kr {
    font-family: var(--font-kr);
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
}

/* Journey Arrows */
.journey-arrow {
    width: 60px;
    height: 20px;
    flex-shrink: 0;
}

.arrow-line {
    stroke: rgba(255, 255, 255, 0.3);
    stroke-width: 2;
    stroke-dasharray: 8, 4;
    animation: arrowFlow 1.5s linear infinite;
}

.arrow-head {
    fill: rgba(255, 255, 255, 0.3);
}

@keyframes arrowFlow {
    from { stroke-dashoffset: 0; }
    to { stroke-dashoffset: -12; }
}

/* ============================================================
   Right Insights Panel
   ============================================================ */
.insights-panel {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid var(--glass-border);
    padding: 2rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.insights-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-white);
}

.insights-subtitle {
    font-family: var(--font-kr);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.45);
    margin-top: -0.75rem;
}

.insight-card {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    align-items: flex-start;
}

.insight-card:hover {
    transform: translateY(-1px);
}

.insight-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.insight-icon svg {
    width: 18px;
    height: 18px;
}

.positive-bg {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.warning-bg {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.neutral-bg {
    background: rgba(79, 172, 254, 0.2);
    color: var(--gradient-mid);
}

.insight-content h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: 0.2rem;
}

.insight-content p {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.5;
}

/* ============================================================
   Mobile Nav Toggle
   ============================================================ */
.mobile-nav-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 100;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 12px;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    color: var(--text-white);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.mobile-nav-toggle svg {
    width: 22px;
    height: 22px;
}

/* ============================================================
   Scrollbar
   ============================================================ */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ============================================================
   Animations -- Entry
   ============================================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero {
    animation: fadeInUp 0.6s ease both;
}

.metric-card {
    animation: fadeInUp 0.6s ease both;
}

.metric-card:nth-child(1) { animation-delay: 0.1s; }
.metric-card:nth-child(2) { animation-delay: 0.15s; }
.metric-card:nth-child(3) { animation-delay: 0.2s; }
.metric-card:nth-child(4) { animation-delay: 0.25s; }
.metric-card:nth-child(5) { animation-delay: 0.3s; }
.metric-card:nth-child(6) { animation-delay: 0.35s; }

.journey-node {
    animation: fadeInUp 0.6s ease both;
}

.journey-node:nth-child(1) { animation-delay: 0.4s; }
.journey-node:nth-child(3) { animation-delay: 0.5s; }
.journey-node:nth-child(5) { animation-delay: 0.6s; }
.journey-node:nth-child(7) { animation-delay: 0.7s; }
.journey-node:nth-child(9) { animation-delay: 0.8s; }

.insight-card {
    animation: fadeInUp 0.5s ease both;
}

.insight-card:nth-child(3) { animation-delay: 0.1s; }
.insight-card:nth-child(4) { animation-delay: 0.2s; }
.insight-card:nth-child(5) { animation-delay: 0.3s; }
.insight-card:nth-child(6) { animation-delay: 0.4s; }
.insight-card:nth-child(7) { animation-delay: 0.5s; }

/* ============================================================
   Responsive -- Tablet
   ============================================================ */
@media (max-width: 1024px) {
    .dashboard {
        grid-template-columns: 200px 1fr;
    }

    .insights-panel {
        position: fixed;
        bottom: 0;
        left: 200px;
        right: 0;
        height: auto;
        max-height: 40vh;
        border-left: none;
        border-top: 1px solid var(--glass-border);
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.75rem;
        padding: 1.25rem;
        z-index: 50;
        background: rgba(26, 26, 46, 0.9);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        transform: translateY(calc(100% - 3rem));
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .insights-panel:hover,
    .insights-panel.expanded {
        transform: translateY(0);
    }

    .insights-title {
        width: 100%;
    }

    .insights-subtitle {
        width: 100%;
        margin-top: -0.5rem;
    }

    .insight-card {
        flex: 1 1 calc(50% - 0.75rem);
        min-width: 220px;
    }

    .main-content {
        padding-bottom: 4rem;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================================
   Responsive -- Mobile
   ============================================================ */
@media (max-width: 768px) {
    .dashboard {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        width: 260px;
        height: 100vh;
        z-index: 90;
        transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        background: rgba(26, 26, 46, 0.95);
    }

    .sidebar.open {
        left: 0;
    }

    .mobile-nav-toggle {
        display: flex;
    }

    .main-content {
        padding: 1.25rem;
        padding-top: 4rem;
    }

    .hero-metric {
        flex-direction: column;
        text-align: center;
    }

    .hero-metric-detail {
        text-align: center;
    }

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

    .journey-map {
        gap: 0;
        padding: 0.5rem 0;
    }

    .journey-node {
        min-width: 100px;
        padding: 1rem 0.75rem;
    }

    .insights-panel {
        left: 0;
        flex-direction: column;
        max-height: 50vh;
    }

    .insight-card {
        flex: 1 1 100%;
    }
}

/* Sidebar overlay on mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 80;
}

.sidebar-overlay.visible {
    display: block;
}
