:root {
    --bg-color: #111217;
    --panel-bg: #181b1f;
    --text-primary: #ccccdc;
    --text-secondary: #8e8e8e;
    --border-color: #22252b;
    --accent-blue: #5794f2;
    --accent-orange: #FF9830;
    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
}

.grid,
.panel,
.chart-container {
    max-width: 100vw;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* --- Shared Navigation --- */
.nav-container {
    max-width: 100%;
    margin: 0;
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-links {
    display: flex;
    gap: 24px;
    height: 100%;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    height: 100%;
    display: flex;          
    align-items: center;    
    border-bottom: 2px solid transparent; 
    transition: all 0.2s;
    font-size: 0.95rem;
}

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

.nav-link.active {
    color: #fff;
    border-bottom-color: var(--accent-blue);
}

/* --- Dashboard Layout --- */
.container {
    width: 100%;
    margin: 0;
    padding: 24px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 24px;
}

h1 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 500;
    color: #fff;
}

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

select {
    background-color: var(--panel-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 2px;
    font-size: 0.9rem;
    outline: none;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
}

select:hover { border-color: #444; }

/* Default Grid (Mobile/Tablet) */
.grid {
    display: grid;
    grid-template-columns: repeat(24, 1fr);
    gap: 16px;
}

.panel {
    background-color: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 2px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    
    position: relative; 
    transition: z-index 0s; 
}

.panel:hover {
    z-index: 50; 
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding-left: 10px;
    flex-shrink: 0; 
}

.panel-header h2 {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.chart-container {
    flex-grow: 1;
    width: 100%;
    min-height: 0;
}

#chart-main { grid-column: span 16; height: 400px; }
#chart-pie { grid-column: span 8; height: 400px; }
#chart-aggregated { grid-column: span 16; height: 350px; }
#chart-gauge { grid-column: span 8; height: 350px; }

/* --- Tooltips --- */
.info-icon {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid #6e7681;
    color: #6e7681;
    font-size: 10px;
    font-family: sans-serif;
    line-height: 1;
    cursor: help;
    position: relative;
    transition: all 0.2s;
}

.info-icon:hover {
    color: #ccccdc;
    border-color: #ccccdc;
}

.info-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    top: 140%;
    left: 70%;
    transform: translateX(-50%);
    width: max-content;
    max-width: min(360px, 90vw);
    white-space: normal;
    font-size: .75rem;
    font-weight: 400;
    padding: 10px 8px;
    background-color: #181b1f;
    border: 1px solid #2c3235;
    color: #ccccdc;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.6);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s;
    pointer-events: none;
}

.info-icon.right-side::after {
    left: auto;
    right: -10px;
    transform: none;
}

.info-icon:hover::after {
    opacity: 1;
    visibility: visible;
}

/* --- Scrollbars (Shared) --- */
.scroll-wrapper, .landing-container {
    flex-grow: 1;
    width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #565b66 transparent;
}

.scroll-wrapper::-webkit-scrollbar, .landing-container::-webkit-scrollbar { width: 8px; }
.scroll-wrapper::-webkit-scrollbar-track, .landing-container::-webkit-scrollbar-track { background: transparent; }
.scroll-wrapper::-webkit-scrollbar-thumb, .landing-container::-webkit-scrollbar-thumb {
    background-color: #565b66;
    border-radius: 4px;
    border: 2px solid transparent;
    background-clip: content-box;
}
.scroll-wrapper::-webkit-scrollbar-thumb:hover, .landing-container::-webkit-scrollbar-thumb:hover { background-color: #6e7681; }

.separator { color: #444; }

/* Landing Page */
body.landing-page {
    height: 100vh !important;     
    overflow: hidden !important;  
    display: flex !important;     
    flex-direction: column !important;
}

.landing-container {
    flex-grow: 1;                 
    width: 100%;                  
    overflow-y: auto;
}

.landing-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.hero-section {
    padding: 80px 20px;
    text-align: center;
    background: radial-gradient(circle at center, rgba(87, 148, 242, 0.1) 0%, rgba(17, 18, 23, 0) 70%);
    margin: 0 -24px 24px -24px;
    padding-left: 24px;
    padding-right: 24px;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    background: linear-gradient(90deg, #ffffff 30%, var(--accent-orange) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 32px auto;
    line-height: 1.6;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 40px;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 4px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--accent-blue);
    color: #fff;
    border: 1px solid var(--accent-blue);
}

.btn-primary:hover { background-color: #4a7ecc; }

.btn-secondary {
    background-color: transparent;
    color: var(--accent-orange);
    border: 1px solid var(--accent-orange);
}

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

.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); 
    gap: 24px;
    margin-top: 24px;
    padding-bottom: 40px;
}

.tech-card {
    background-color: var(--panel-bg);
    border: 1px solid var(--border-color);
    padding: 32px 24px; 
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.2s, border-color 0.2s;
}

.tech-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-orange);
}

.tech-icon {
    font-size: 24px;
    margin-bottom: 16px;
    color: var(--accent-orange);
}

.tech-title {
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
}

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

/* Process page */
.blog-content {
    max-width: 800px;
    margin: 0 auto;
}
.blog-content h2 { color: #fff; margin-top: 40px; }
.blog-content h3 { color: #fff; margin-top: 24px; font-size: 1.1rem; }
.blog-content p { line-height: 1.8; color: #ccccdc; margin-bottom: 20px; }
.blog-content ul { color: #ccccdc; line-height: 1.6; margin-bottom: 24px; }
.blog-content li { margin-bottom: 10px; }

.blog-img-container {
    margin: 32px 0;
    border: 1px solid #2c3235;
    border-radius: 4px;
    overflow: hidden;
}
.blog-img {
    width: 100%;
    height: auto;
    display: block;
}
.img-caption {
    background-color: #111217;
    padding: 8px 12px;
    font-size: 0.85rem;
    color: #8e8e8e;
    text-align: center;
    border-top: 1px solid #2c3235;
}

.blog-header {
    max-width: 800px;
    margin: 48px auto 32px auto;
    padding-bottom: 24px;
    border-bottom: 1px solid #2c3235;
    text-align: center;
}
.blog-header h1 {
    margin: 0 0 12px 0;
    color: #fff;
    font-size: 2.2rem;
    letter-spacing: -0.02em;
    line-height: 1.2;
}
.blog-header p {
    color: #8e8e8e;
    font-size: 1.1rem;
    margin: 0;
}


/* Mobile/tablet */
@media (max-width: 1200px) {
    .grid {
        display: flex;
        flex-direction: column;
        gap: 0;
    }

    #chart-main, #chart-pie, #chart-aggregated, #chart-gauge {
        width: 100%;
        margin-bottom: 16px;
    }

    .info-icon.right-side::after {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }
}

@media (max-width: 768px) {
    .container { padding: 12px; }
    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    .controls {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    select { width: 100%; }
    .info-icon::after {
        width: 250px;
        left: -100px;
        transform: none;
    }
    .hero-title { font-size: 1.8rem; }
    .cta-buttons { flex-direction: column; }
    .tech-grid { grid-template-columns: 1fr; }
    .hero-section {
        margin: 0 -12px 24px -12px;
        padding-left: 12px;
        padding-right: 12px;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    body {
        height: 100vh;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    .top-nav { flex-shrink: 0; }

    .container {
        flex-grow: 1;
        height: 100%;
        display: grid;
        grid-template-rows: auto minmax(0, 1fr);
        gap: 24px;
        padding-bottom: 24px;
        overflow: hidden;
    }

    header { margin-bottom: 0; }

    .grid {
        display: grid;
        height: 100%;
        grid-template-rows: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    .panel {
        height: 100% !important;
    }
    
    .chart-container {
        height: 100%;
        min-height: 0;
        overflow: hidden; 
    }

    .scroll-wrapper {
        height: 100%;
        min-height: 0;
    }
}