:root {
    --bg: #030509;
    --glass: rgba(15, 23, 42, 0.85);
    --border: rgba(255, 255, 255, 0.1);
    --accent: #00f2ff;
    --accent-glow: rgba(0, 242, 255, 0.2);
    --text: #f8fafc;
    --text-dim: #94a3b8;
    --grad: linear-gradient(135deg, #00f2ff, #0088ff);
    --red: #ff4b4b;
    --green: #4ade80;
    --surface: #0f172a;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Space Grotesk', sans-serif;
    overflow-x: hidden;
    line-height: 1.6;
}

h1,
h2,
h3,
h4 {
    font-family: 'Outfit', sans-serif;
    text-transform: uppercase;
    letter-spacing: -1px;
}

/* Navigation */
.glass-dock {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    background: var(--glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 12px 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.dock-inner {
    display: flex;
    align-items: center;
    gap: 40px;
}

.logo-x {
    font-weight: 900;
    font-size: 1.1rem;
    color: white;
}

.logo-x span {
    color: var(--accent);
}

.dock-links {
    display: flex;
    gap: 25px;
}

.dock-links a {
    text-decoration: none;
    color: var(--text-dim);
    font-size: 0.8rem;
    font-weight: 700;
    transition: 0.3s;
}

.dock-links a:hover {
    color: var(--accent);
}

/* Hero */
.hero-x {
    min-height: 85vh;
    display: flex;
    align-items: center;
    padding: 100px 10% 40px;
}

.meta-tag {
    font-size: 0.7rem;
    color: var(--accent);
    letter-spacing: 4px;
    font-weight: 800;
    margin-bottom: 1.5rem;
}

h1 {
    font-size: clamp(3rem, 8vw, 6rem);
    line-height: 0.95;
    margin-bottom: 20px;
}

h1 span {
    -webkit-text-stroke: 1px white;
    color: transparent;
}

.hero-content-x p {
    font-size: 1.2rem;
    color: var(--text-dim);
    max-width: 700px;
    margin-bottom: 40px;
}

.btn-main {
    background: var(--grad);
    color: white;
    border: none;
    padding: 16px 40px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    font-size: 1rem;
    transition: 0.3s;
}

.btn-main:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px var(--accent-glow);
}

/* Pillars */
.pillars-x {
    padding: 100px 10%;
    display: flex;
    gap: 60px;
}

.pillar-sticky {
    position: sticky;
    top: 120px;
    height: fit-content;
    flex: 0 0 350px;
}

.pillar-sticky h2 {
    font-size: 3.5rem;
    line-height: 1;
    margin-bottom: 20px;
}

.pillar-scroll {
    flex: 1;
}

.p-card-x {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 30px;
    transition: 0.3s;
}

.p-card-x:hover {
    border-color: var(--accent);
    transform: translateX(10px);
}

.p-id {
    color: var(--accent);
    font-weight: 800;
    font-size: 0.75rem;
    margin-bottom: 10px;
    display: block;
    letter-spacing: 2px;
}

.p-card-x h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

/* Explorer */
.explorer-x {
    padding: 100px 10%;
    background: #05080f;
}

.explorer-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 60px;
}

.explorer-search {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#stateFilter,
#masterSearch {
    width: 100%;
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: white;
    border-radius: 12px;
    font-size: 1rem;
    outline: none;
    transition: 0.3s;
}

#stateFilter:focus,
#masterSearch:focus {
    border-color: var(--accent);
}

/* Result List Container */
.results-list {
    margin-top: 20px;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 5px;
    /* Space for scrollbar */
}

/* Custom Scrollbar */
.results-list::-webkit-scrollbar {
    width: 4px;
}

.results-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

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

.results-list::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Compact Result Item */
.res-item-x {
    padding: 12px 15px;
    border: 1px solid var(--border);
    margin-bottom: 8px;
    /* Reduced margin */
    border-radius: 8px;
    /* Slightly sharper corners */
    cursor: pointer;
    transition: 0.2s;
    background: rgba(255, 255, 255, 0.01);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.res-item-x div {
    /* Container for text */
}

.res-item-x h4 {
    font-size: 0.85rem;
    /* Smaller font */
    color: white;
    margin-bottom: 2px;
    line-height: 1.2;
}

.res-item-x p {
    /* State name styling if present */
    font-size: 0.7rem;
    color: var(--text-dim);
    margin: 0;
}

.res-item-x:hover {
    border-color: var(--accent);
    background: rgba(0, 242, 255, 0.1);
    transform: translateX(4px);
    /* Subtle interaction hint */
}


/* District Display */
.district-display {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 32px;
    padding: 50px;
    display: flex;
    flex-direction: column;
    gap: 50px;
}

.display-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border);
}

#d-name {
    font-size: 3rem;
    line-height: 1.1;
    margin-bottom: 5px;
    word-break: break-word;
}

#d-state {
    font-size: 1rem;
    color: var(--accent);
    letter-spacing: 2px;
}

.di-ami strong {
    font-size: 4.5rem;
    color: var(--accent);
    font-family: 'Outfit';
}

/* Grid */
.display-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
}

.di-stats-grid {
    display: flex;
    flex-direction: column;
    gap: 35px;
}

.di-stat-box label {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    font-weight: 800;
    margin-bottom: 10px;
    display: block;
}

.main-val {
    font-size: 2.8rem;
    font-weight: 900;
    color: white;
    line-height: 1;
}

/* Radar - FINAL FIX */
.di-viz {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 20px;
    padding: 25px;
    border: 1px solid var(--border);
}

.di-viz h4 {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 20px;
    text-align: center;
}

.radar-holder {
    position: relative;
    height: 350px;
    width: 100%;
}

/* Solutions */
.display-solutions {
    border-top: 1px solid var(--border);
    padding-top: 40px;
}

.sol-tag {
    font-size: 0.7rem;
    color: var(--accent);
    letter-spacing: 3px;
    font-weight: 800;
    margin-bottom: 20px;
    display: block;
}

#sol-title {
    font-size: 2.2rem;
    line-height: 1.1;
    margin-bottom: 30px;
    border-left: 6px solid var(--accent);
    padding-left: 24px;
}

.sol-content-inner {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 35px;
}

.nlp-block {
    margin-bottom: 40px;
}

.nlp-block h5 {
    font-size: 0.8rem;
    color: var(--accent);
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.nlp-text li {
    margin-bottom: 20px;
    position: relative;
    padding-left: 20px;
}

.directive-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 35px;
}

.sol-step {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.s-num {
    width: 36px;
    height: 36px;
    background: var(--accent);
    color: #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    flex-shrink: 0;
}

.step-info h6 {
    font-size: 1rem;
    color: white;
    margin-bottom: 5px;
}

.step-info p {
    font-size: 0.85rem;
    color: var(--text-dim);
    line-height: 1.6;
}

/* UVP Section */
.uvp-section {
    padding: 100px 10%;
    background: black;
}

.uvp-header {
    text-align: center;
    margin-bottom: 60px;
}

.uvp-header h2 {
    font-size: 4rem;
    margin-bottom: 20px;
}

.uvp-header h2 span {
    color: var(--accent);
}

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

.uvp-card {
    padding: 40px;
    background: #05080f;
    border: 1px solid var(--border);
    border-radius: 20px;
    transition: 0.3s;
}

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

.uvp-card h3 {
    color: var(--accent);
    font-size: 1.4rem;
    margin-bottom: 20px;
}

.uvp-card p {
    color: var(--text-dim);
    line-height: 1.7;
}

/* FOOTER - PROFESSIONAL REDESIGN */
.footer-x {
    padding: 60px 10%;
    border-top: 1px solid var(--border);
    background: #020408;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 60px;
    margin-bottom: 40px;
}

.footer-brand h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.footer-brand h3 span {
    color: var(--accent);
}

.footer-brand p {
    color: var(--text-dim);
    line-height: 1.7;
    margin-bottom: 10px;
}

.footer-stats {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.stat-item label {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}

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

.footer-bottom {
    padding-top: 30px;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-dim);
    font-size: 0.85rem;
}

.hidden {
    display: none;
}

@media (max-width: 1200px) {

    .explorer-layout,
    .display-main,
    .directive-grid,
    .footer-content {
        grid-template-columns: 1fr;
    }

    .pillars-x {
        flex-direction: column;
    }
}

/* Closing the media query */

/* STRATEGY GRID */
.strategy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.strategy-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    transition: 0.3s;
}

.strategy-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.05);
}

.strat-header {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.strat-body {
    font-size: 0.95rem;
    color: #ccc;
    line-height: 1.5;
}

.strat-body strong {
    color: white;
}

/* Card Types */
.alert-high {
    border-left: 4px solid #ff4b4b;
}

.alert-high .strat-header {
    color: #ff4b4b;
}

.alert-medium {
    border-left: 4px solid #facc15;
}

.alert-medium .strat-header {
    color: #facc15;
}

.alert-critical {
    border-left: 4px solid #f43f5e;
    background: rgba(244, 63, 94, 0.05);
}

.alert-critical .strat-header {
    color: #f43f5e;
}

.status-good {
    border-left: 4px solid #4ade80;
}

.status-good .strat-header {
    color: #4ade80;
}

.status-neutral {
    border-left: 4px solid #94a3b8;
}

.status-neutral .strat-header {
    color: #94a3b8;
}


/* NEW DEEP DIVE LAYOUT */
.dd-controls-bar {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
    align-items: center;
}

.dd-control-item {
    flex: 1;
}

.dd-select {
    width: 100%;
    padding: 15px 20px;
    padding-right: 40px;
    /* Space for arrow */
    background-color: rgba(255, 255, 255, 0.05);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.7)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    color: white;
    outline: none;
    font-family: inherit;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    font-size: 1rem;
    transition: 0.3s;
}

.dd-select:focus {
    border-color: var(--accent);
    background-color: rgba(0, 0, 0, 0.5);
}

.dd-select option {
    background-color: #000;
    color: white;
    padding: 12px;
}

.search-wrapper {
    position: relative;
    width: 100%;
}

.dd-search-input {
    width: 100%;
    padding: 15px 20px 15px 45px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: white;
    outline: none;
    font-family: inherit;
    transition: 0.3s;
}

.dd-search-input:focus {
    border-color: var(--accent);
    background: rgba(0, 242, 255, 0.05);
}

.dd-search-results {
    position: absolute;
    top: 110%;
    left: 0;
    right: 0;
    background: #0f172a;
    /* Solid background for legibility */
    border: 1px solid var(--border);
    border-radius: 12px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    padding: 10px;
}

/* Hide when empty or hidden class applied */
.dd-search-results.hidden {
    display: none;
}

/* Linear Metrics Responsive */
@media (max-width: 900px) {
    .linear-metrics {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .lm-line {
        width: 100% !important;
        height: 1px !important;
    }

    .linear-header {
        flex-direction: column;
        text-align: center;
        gap: 20px;
        align-items: center;
    }
}

/* SWITCH TOGGLE */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #333;
    -webkit-transition: .4s;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    -webkit-transition: .4s;
    transition: .4s;
}

input:checked+.slider {
    background-color: var(--accent);
}

input:focus+.slider {
    box-shadow: 0 0 1px var(--accent);
}

input:checked+.slider:before {
    -webkit-transform: translateX(20px);
    -ms-transform: translateX(20px);
    transform: translateX(20px);
}

/* Rounded sliders */
.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* ========================================
   MOBILE RESPONSIVE OPTIMIZATIONS
   ======================================== */

/* Tablets and smaller (below 768px) */
@media (max-width: 768px) {

    /* Navigation - Hamburger style */
    .glass-dock {
        padding: 10px 15px;
    }

    .dock-links {
        display: none;
        /* Hide nav links on mobile, show hamburger if needed */
    }

    .logo-x {
        font-size: 1.2rem;
    }

    /* Hero Section */
    .hero-x {
        padding: 80px 20px 60px;
        min-height: 70vh;
    }

    .hero-content-x h1 {
        font-size: 2.5rem !important;
        line-height: 1.2;
    }

    .hero-content-x p {
        font-size: 1rem;
        line-height: 1.6;
    }

    /* Pillars Section */
    .pillars-x {
        flex-direction: column;
        padding: 40px 20px;
    }

    .pillar-sticky {
        position: static;
        padding: 0;
        margin-bottom: 30px;
    }

    .pillars-scroll {
        gap: 20px;
    }

    .pi-card {
        min-width: 100%;
        padding: 20px;
    }

    /* Deep Dive Controls */
    .dd-controls-bar {
        flex-direction: column !important;
        gap: 15px !important;
    }

    .dd-control-item {
        width: 100%;
    }

    .dd-select {
        font-size: 0.95rem;
        padding: 12px 15px;
    }

    /* Deep Dive Actions Bar */
    .dd-actions-bar {
        flex-direction: column !important;
        gap: 10px !important;
        padding: 15px;
    }

    .future-toggle-group {
        width: 100%;
        justify-content: center;
    }

    #btnDownloadReport {
        width: 100%;
        justify-content: center;
        padding: 12px 20px;
    }

    /* Linear Header */
    .linear-header {
        flex-direction: column !important;
        text-align: center !important;
        gap: 15px;
    }

    .lh-left {
        flex-direction: column !important;
        align-items: center !important;
        gap: 8px !important;
    }

    .lh-left h2 {
        font-size: 2rem !important;
    }

    /* Linear Metrics */
    .linear-metrics {
        flex-direction: column !important;
        padding: 15px !important;
    }

    .lm-item {
        width: 100%;
        text-align: center;
        padding: 15px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .lm-item:last-child {
        border-bottom: none;
    }

    .lm-line {
        display: none !important;
        /* Hide vertical separators on mobile */
    }

    /* Strategy Grid */
    .strategy-grid {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }

    .strategy-card {
        padding: 15px;
    }

    .strat-header {
        font-size: 0.8rem;
    }

    .strat-body {
        font-size: 0.9rem;
    }
}

/* Small mobile devices (below 480px) */
@media (max-width: 480px) {

    /* Hero */
    .hero-content-x h1 {
        font-size: 2rem !important;
    }

    .meta-tag {
        font-size: 0.65rem;
        padding: 6px 12px;
    }

    /* Buttons */
    .btn-main {
        width: 100%;
        padding: 15px 20px;
        font-size: 0.9rem;
    }

    /* Cards */
    .pi-card {
        padding: 15px;
    }

    .pi-card h3 {
        font-size: 1.1rem;
    }

    /* Deep Dive Funnel Header */
    .dd-funnel-header h2 {
        font-size: 1.5rem !important;
    }

    /* Linear Header - Even smaller */
    .lh-left h2 {
        font-size: 1.8rem !important;
    }

    #d-state {
        font-size: 0.9rem !important;
    }

    #d-ami {
        font-size: 2.5rem !important;
    }

    /* Metric values */
    .lm-item label {
        font-size: 0.7rem;
    }

    .lm-item strong {
        font-size: 1.3rem;
    }
}

/* Landscape mobile optimization */
@media (max-height: 600px) and (orientation: landscape) {
    .hero-x {
        min-height: 100vh;
        padding: 60px 20px 40px;
    }

    .hero-content-x h1 {
        font-size: 2rem !important;
    }
}