/* ========================================================
   IDN PORTOFOLIO - MODERN GRAFIK & ANALYTICS STYLESHEET
   Design System: Space Grotesk + Inter, Frosted Glass, Micro-Box 4px
   Harmonized with Landing Page Aesthetics
   ======================================================== */

:root {
    --gf-primary: #1d72b8;
    --gf-primary-hover: #155e8a;
    --gf-primary-rgb: 29, 114, 184;
    --gf-accent: #0284c7;
    --gf-accent-glow: rgba(2, 132, 199, 0.25);
    --gf-dark-text: #0f172a;
    --gf-muted-text: #64748b;
    --gf-card-bg: #ffffff;
    --gf-card-border: rgba(226, 232, 240, 0.9);
    --gf-card-shadow: 0 4px 20px -5px rgba(15, 23, 42, 0.05);
    --gf-card-hover-shadow: 0 16px 36px -8px rgba(29, 114, 184, 0.16);
    --gf-chip-bg: rgba(241, 245, 249, 0.85);
    --gf-glass-bg: rgba(255, 255, 255, 0.85);
    --gf-glass-border: rgba(255, 255, 255, 0.7);
}

/* Dark Mode Tokens */
html.theme-dark,
body.theme-dark,
[data-bs-theme="dark"] {
    --gf-primary: #38bdf8;
    --gf-primary-hover: #7dd3fc;
    --gf-primary-rgb: 56, 189, 248;
    --gf-accent: #38bdf8;
    --gf-accent-glow: rgba(56, 189, 248, 0.3);
    --gf-dark-text: #f8fafc;
    --gf-muted-text: #94a3b8;
    --gf-card-bg: #161d2c;
    --gf-card-border: rgba(255, 255, 255, 0.08);
    --gf-card-shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.7);
    --gf-card-hover-shadow: 0 20px 45px -8px rgba(0, 0, 0, 0.9), 0 0 25px rgba(56, 189, 248, 0.2);
    --gf-chip-bg: rgba(22, 29, 44, 0.75);
    --gf-glass-bg: rgba(22, 29, 44, 0.8);
    --gf-glass-border: rgba(255, 255, 255, 0.08);
}

/* --------------------------------------------------------
   HERO ANALYTICS SECTION
   -------------------------------------------------------- */
.hero-wrapper {
    position: relative;
    padding: 3.5rem 1rem 3rem;
    text-align: center;
    overflow: hidden;
}

.hero-glow-1 {
    position: absolute;
    top: -80px;
    left: 20%;
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(29, 114, 184, 0.18), transparent 70%);
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
}

.hero-glow-2 {
    position: absolute;
    top: 20px;
    right: 15%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(2, 132, 199, 0.15), transparent 70%);
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
}

.hero-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: 4px;
    background: rgba(29, 114, 184, 0.08);
    border: 1px solid rgba(29, 114, 184, 0.2);
    color: var(--gf-primary);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.82rem !important;
    font-weight: 700;
    margin-bottom: 1.25rem;
    letter-spacing: 0.03em;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.8);
    animation: pulseDotAnim 2s infinite ease-in-out;
}

@keyframes pulseDotAnim {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.6; }
}

.hero-title {
    font-family: 'Space Grotesk', sans-serif !important;
    font-size: clamp(2rem, 4.5vw, 2.9rem) !important;
    font-weight: 800 !important;
    line-height: 1.15 !important;
    letter-spacing: -0.03em !important;
    color: var(--gf-dark-text);
    margin-bottom: 1.15rem;
}

.text-gradient {
    background: linear-gradient(135deg, #1d72b8 0%, #0284c7 50%, #38bdf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

html.theme-dark .text-gradient,
body.theme-dark .text-gradient,
[data-bs-theme="dark"] .text-gradient {
    background: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-desc {
    font-family: 'Inter', sans-serif;
    font-size: clamp(0.95rem, 1.8vw, 1.125rem) !important;
    color: var(--gf-muted-text);
    line-height: 1.6 !important;
    max-width: 720px;
    margin: 0 auto 2rem;
}

/* --------------------------------------------------------
   METRIC SUMMARY STAT CARDS (MICRO-BOX 4px)
   -------------------------------------------------------- */
.metric-summary-row {
    margin-bottom: 2.5rem;
}

.metric-card-modern {
    background: var(--gf-card-bg);
    border: 1px solid var(--gf-card-border);
    border-radius: 4px;
    padding: 1.35rem 1.5rem;
    box-shadow: var(--gf-card-shadow);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.metric-card-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gf-primary), var(--gf-accent));
    opacity: 0.8;
}

.metric-card-modern:hover {
    transform: translateY(-4px);
    box-shadow: var(--gf-card-hover-shadow);
    border-color: rgba(var(--gf-primary-rgb), 0.4);
}

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

.metric-title {
    font-family: 'Space Grotesk', sans-serif !important;
    font-size: 0.82rem !important;
    font-weight: 700 !important;
    color: var(--gf-muted-text);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0;
}

.metric-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: 3px;
    background: rgba(var(--gf-primary-rgb), 0.1);
    color: var(--gf-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.metric-value {
    font-family: 'Space Grotesk', sans-serif !important;
    font-size: 1.95rem !important;
    font-weight: 800 !important;
    color: var(--gf-dark-text);
    line-height: 1.15;
    margin-bottom: 0.35rem;
}

.metric-subtext {
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem !important;
    color: var(--gf-muted-text);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
}

/* --------------------------------------------------------
   CHART CONTAINERS (MICRO-BOX 4px)
   -------------------------------------------------------- */
.chart-card-modern {
    background: var(--gf-card-bg);
    border: 1px solid var(--gf-card-border);
    border-radius: 4px;
    box-shadow: var(--gf-card-shadow);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chart-card-modern:hover {
    transform: translateY(-4px);
    box-shadow: var(--gf-card-hover-shadow);
    border-color: rgba(var(--gf-primary-rgb), 0.35);
}

.chart-card-header {
    padding: 1.25rem 1.5rem 0.85rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.chart-title-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.chart-main-title {
    font-family: 'Space Grotesk', sans-serif !important;
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    color: var(--gf-dark-text);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.015em;
}

.chart-main-title i {
    color: var(--gf-primary);
    font-size: 0.95rem;
}

.chart-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem !important;
    color: var(--gf-muted-text);
    margin: 0;
}

.chart-badge-tag {
    padding: 3px 8px;
    border-radius: 2px;
    font-family: 'Space Grotesk', monospace;
    font-size: 0.72rem !important;
    font-weight: 700;
    letter-spacing: 0.03em;
    background: var(--gf-chip-bg);
    border: 1px solid var(--gf-card-border);
    color: var(--gf-muted-text);
    white-space: nowrap;
}

.chart-card-body {
    padding: 1.25rem 1.5rem 1.5rem;
    flex-grow: 1;
    position: relative;
    min-height: 310px;
}

/* --------------------------------------------------------
   APEXCHARTS THEME ENHANCEMENTS & NORMALIZATION
   -------------------------------------------------------- */
.apexcharts-canvas {
    font-family: 'Inter', sans-serif !important;
}

.apexcharts-tooltip {
    border-radius: 4px !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2) !important;
    font-family: 'Inter', sans-serif !important;
    border: 1px solid rgba(226, 232, 240, 0.9) !important;
}

.apexcharts-tooltip-title {
    font-family: 'Space Grotesk', sans-serif !important;
    font-weight: 700 !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
}

/* Dark mode tooltips */
html.theme-dark .apexcharts-tooltip,
body.theme-dark .apexcharts-tooltip,
[data-bs-theme="dark"] .apexcharts-tooltip {
    background: #161d2c !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    color: #f8fafc !important;
}

html.theme-dark .apexcharts-tooltip-title,
body.theme-dark .apexcharts-tooltip-title,
[data-bs-theme="dark"] .apexcharts-tooltip-title {
    background: #1e293b !important;
    border-bottom-color: rgba(255, 255, 255, 0.1) !important;
    color: #f8fafc !important;
}

/* --------------------------------------------------------
   DARK MODE NORMALIZATION (ZERO FONT INFLATION)
   -------------------------------------------------------- */
html.theme-dark,
body.theme-dark,
[data-bs-theme="dark"] {
    font-size: 16px !important;
}

html.theme-dark .chart-card-modern,
body.theme-dark .chart-card-modern,
[data-bs-theme="dark"] .chart-card-modern {
    background: var(--gf-card-bg);
    border-color: var(--gf-card-border);
}

html.theme-dark .chart-card-header,
body.theme-dark .chart-card-header,
[data-bs-theme="dark"] .chart-card-header {
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

html.theme-dark .hero-glow-1,
body.theme-dark .hero-glow-1,
[data-bs-theme="dark"] .hero-glow-1 {
    background: radial-gradient(circle, rgba(56, 189, 248, 0.28), transparent 70%);
}

html.theme-dark .hero-glow-2,
body.theme-dark .hero-glow-2,
[data-bs-theme="dark"] .hero-glow-2 {
    background: radial-gradient(circle, rgba(129, 140, 248, 0.22), transparent 70%);
}

/* Responsive Grid spacing */
@media (max-width: 768px) {
    .chart-card-header {
        padding: 1rem 1.25rem 0.75rem;
    }
    
    .chart-card-body {
        padding: 1rem 1.25rem 1.25rem;
    }
}
