@import url('vendor/fonts/fonts.css');

:root {
    color-scheme: dark;
    --bg-dark: #04070b;
    --bg-base: #070b11;
    --bg-card: #0d131d;
    --bg-panel: #111a25;
    --bg-elevated: #151f2c;
    --primary: #2ee9f5;
    --primary-strong: #00f2ff;
    --primary-soft: rgba(46, 233, 245, 0.12);
    --secondary: #4ea1ff;
    --accent: #ff4d82;
    --success: #2dd47f;
    --warning: #f6b84b;
    --text-main: #e6edf3;
    --text-muted: #a7b2be;
    --text-dim: #8894a3;
    --border: #253140;
    --border-strong: #334255;
    --glow: rgba(46, 233, 245, 0.18);
    --shadow-soft: 0 20px 60px rgba(0, 0, 0, 0.42);
    --surface-gradient:
        linear-gradient(135deg, rgba(46, 233, 245, 0.045), rgba(255, 77, 130, 0.025)),
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0));
    --radius-panel: 8px;
    --radius-control: 6px;
}

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

html {
    color-scheme: dark;
    background: var(--bg-dark);
}

body {
    background:
        linear-gradient(180deg, rgba(8, 13, 20, 0.96), var(--bg-dark) 30%, #020407 100%);
    color: var(--text-main);
    font-family: 'Space Grotesk', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: rgba(46, 233, 245, 0.24);
    color: var(--text-main);
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #05080d;
}

::-webkit-scrollbar-thumb {
    background: #223142;
    border: 2px solid #05080d;
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: #31475d;
}

a {
    color: inherit;
}

a:visited:not(.btn):not(.nav-link):not(.nav-cta):not(.drawer-link) {
    color: #9acff4;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible {
    outline: 2px solid rgba(46, 233, 245, 0.82);
    outline-offset: 3px;
}

/* Background Matrix/Grid Effect */
.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(46, 233, 245, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(46, 233, 245, 0.035) 1px, transparent 1px);
    background-size: 56px 56px;
    z-index: -1;
    pointer-events: none;
    opacity: 0.75;
}

.bg-radial {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        linear-gradient(115deg, transparent 0 30%, rgba(46, 233, 245, 0.035) 46%, transparent 62%),
        linear-gradient(245deg, transparent 0 24%, rgba(255, 77, 130, 0.026) 50%, transparent 68%);
    z-index: -1;
    pointer-events: none;
}

/* Typography */
h1, h2, h3 {
    text-transform: uppercase;
    letter-spacing: 0;
    font-weight: 700;
    text-wrap: balance;
}

.mono {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--primary);
}

/* Status Tag Styling */
.hero-tag {
    display: inline-block;
    padding: 6px 16px;
    background: var(--primary-soft);
    border: 1px solid rgba(46, 233, 245, 0.42);
    border-radius: var(--radius-control);
    color: var(--primary);
    text-shadow: 0 0 10px rgba(46, 233, 245, 0.45);
    box-shadow: 0 0 18px rgba(46, 233, 245, 0.14);
    margin-bottom: 2rem;
    animation: pulse-glow 2s infinite ease-in-out;
}

@keyframes pulse-glow {
    0% { opacity: 0.82; box-shadow: 0 0 10px rgba(46, 233, 245, 0.1); }
    50% { opacity: 1; box-shadow: 0 0 24px rgba(46, 233, 245, 0.32); }
    100% { opacity: 0.82; box-shadow: 0 0 10px rgba(46, 233, 245, 0.1); }
}

/* Hero Section */
.hero {
    height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 10%;
    position: relative;
}

.hero-tag {
    background: var(--primary-soft);
    border: 1px solid rgba(46, 233, 245, 0.42);
    padding: 0.5rem 1.5rem;
    border-radius: var(--radius-control);
    margin-bottom: 2rem;
    animation: pulse 2s infinite;
}

.hero h1 {
    font-size: clamp(3rem, 8vw, 6rem);
    line-height: 1;
    margin-bottom: 1.5rem;
}

.hero h1 span {
    background: linear-gradient(to right, var(--text-main), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-dim);
    max-width: 700px;
    margin-bottom: 3rem;
}

/* Feature Grid */
.features {
    padding: 10rem 10%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: var(--surface-gradient), var(--bg-card);
    border: 1px solid var(--border);
    padding: 3rem;
    border-radius: var(--radius-panel);
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.22);
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(46, 233, 245, 0.62), transparent);
    opacity: 0.4;
    transition: opacity 0.3s;
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: rgba(46, 233, 245, 0.34);
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.32), 0 0 28px rgba(46, 233, 245, 0.06);
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-card h3 {
    margin: 1.5rem 0 1rem;
    color: var(--primary);
}

/* Animations */
@keyframes pulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.98); }
    100% { opacity: 1; transform: scale(1); }
}

/* Terminal Preview */
.terminal-window {
    background: #05080d;
    width: 100%;
    max-width: 800px;
    border-radius: var(--radius-panel);
    border: 1px solid var(--border);
    margin-top: 5rem;
    overflow: hidden;
    text-align: left;
    box-shadow: var(--shadow-soft);
}

.terminal-header {
    background: var(--bg-panel);
    padding: 12px 20px;
    display: flex;
    gap: 8px;
}

.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot-red { background: var(--accent); }
.dot-yellow { background: var(--warning); }
.dot-green { background: var(--success); }

.terminal-body {
    padding: 20px;
    color: var(--success);
    font-size: 0.9rem;
}

/* Dashboard Specific Styles */
.dashboard-container {
    padding: 2rem;
    max-width: 1600px;
    margin: 0 auto;
}

.grid-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    height: 600px;
    margin-bottom: 2rem;
}

#map {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-panel);
    height: 100%;
    width: 100%;
    z-index: 1;
}

.log-vault {
    background: var(--surface-gradient), var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-panel);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.log-header {
    background: rgba(255, 255, 255, 0.035);
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    font-family: 'JetBrains Mono', monospace;
    font-weight: bold;
    color: var(--primary);
}

.log-content {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    background: rgba(5, 8, 13, 0.68);
}

.log-item {
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text-dim);
}

.log-time {
    color: var(--secondary);
}

.section-title {
    font-family: 'JetBrains Mono', monospace;
    margin: 2rem 0 1rem;
    padding-left: 0;
    border-left: 0;
    font-size: 1.2rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(46, 233, 245, 0.36), transparent);
}

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

.device-card {
    background: var(--surface-gradient), var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-panel);
    padding: 1.5rem;
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.device-card:hover {
    border-color: rgba(46, 233, 245, 0.34);
    transform: translateY(-3px);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

.card,
.stat-card,
.plan-card,
.pay-section,
.method-card,
.mpesa-step,
.qa-card,
.dev-card,
.ticket-card,
.modal-box,
.kpi,
.tbl-wrap,
.mb-sheet,
.metric,
.status,
.add-dev-card,
.enroll-card {
    border-radius: var(--radius-panel);
}

.input,
input,
select,
textarea {
    accent-color: var(--primary);
}

input::placeholder,
textarea::placeholder {
    color: rgba(167, 178, 190, 0.46);
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.001ms !important;
    }
}
