@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --bg-dark: #080b11;
    --bg-surface: rgba(17, 22, 34, 0.65);
    --bg-surface-hover: rgba(22, 30, 47, 0.85);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-hover: rgba(0, 242, 254, 0.3);

    --primary: #00f2fe;
    --primary-glow: rgba(0, 242, 254, 0.15);
    --secondary: #8a2be2;
    --secondary-glow: rgba(138, 43, 226, 0.15);

    --text-main: #f0f6fc;
    --text-muted: #8b949e;

    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.2);
    --warning: #f59e0b;
    --warning-glow: rgba(245, 158, 11, 0.2);
    --error: #ef4444;
    --error-glow: rgba(239, 68, 68, 0.2);

    --sidebar-width: 280px;
    --font-sans: 'Plus Jakarta Sans', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    background-image:
        radial-gradient(at 0% 0%, rgba(138, 43, 226, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(0, 242, 254, 0.08) 0px, transparent 50%),
        radial-gradient(at 50% 100%, rgba(8, 11, 17, 0.5) 0px, transparent 50%);
    background-attachment: fixed;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Dashboard Layout */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100vw;
}

/* Sidebar Styling */
aside {
    width: var(--sidebar-width);
    background: rgba(10, 14, 23, 0.85);
    border-right: 1px solid var(--border-color);
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 3rem;
}

.brand-icon {
    font-size: 1.8rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
    display: flex;
    align-items: center;
}

.brand-text {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #ffffff, #8b949e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.nav-item a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: var(--transition);
}

.nav-item.active a,
.nav-item a:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.04);
}

.nav-item.active a {
    border-left: 3px solid var(--primary);
    background: rgba(0, 242, 254, 0.05);
}

.sidebar-footer {
    margin-top: auto;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

/* Main Dashboard Panel */
main {
    margin-left: var(--sidebar-width);
    flex-grow: 1;
    padding: 2.5rem;
    max-width: 1400px;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.header-title h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 0.25rem;
}

.header-title p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--success);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse 1.6s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Grid Sections */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (max-width: 1100px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Card Styling (Glassmorphism) */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: var(--transition);
}

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

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

.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* Pipeline Simulator Widget */
.pipeline-track {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    padding: 2.5rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px dashed rgba(255, 255, 255, 0.05);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.pipeline-line {
    position: absolute;
    top: 50%;
    left: 10%;
    right: 10%;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    z-index: 1;
    transform: translateY(-50%);
}

.pipeline-line-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    box-shadow: 0 0 10px var(--primary);
    transition: width 0.4s ease;
}

.pipeline-node {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    width: 80px;
}

.node-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(15, 22, 36, 0.9);
    border: 2px solid rgba(255, 255, 255, 0.15);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.1rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.pipeline-node.active .node-icon-wrapper {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 20px var(--primary-glow);
    animation: nodePulse 1.5s infinite alternate;
}

.pipeline-node.success .node-icon-wrapper {
    border-color: var(--success);
    color: var(--success);
    background: rgba(16, 185, 129, 0.1);
    box-shadow: 0 0 15px var(--success-glow);
}

.pipeline-node.failed .node-icon-wrapper {
    border-color: var(--error);
    color: var(--error);
    background: rgba(239, 68, 68, 0.1);
    box-shadow: 0 0 15px var(--error-glow);
}

.node-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-align: center;
    white-space: nowrap;
}

.pipeline-node.active .node-label {
    color: var(--primary);
}

.pipeline-node.success .node-label {
    color: var(--success);
}

.pipeline-node.failed .node-label {
    color: var(--error);
}

@keyframes nodePulse {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(1.1);
        box-shadow: 0 0 25px var(--primary);
    }
}

/* Console Logger Terminal */
.console-wrapper {
    background: #05070c;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    font-family: var(--font-mono);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.console-header {
    background: rgba(255, 255, 255, 0.02);
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.console-dots {
    display: flex;
    gap: 6px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot-red {
    background: #ff5f56;
}

.dot-yellow {
    background: #ffbd2e;
}

.dot-green {
    background: #27c93f;
}

.console-title {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.console-body {
    padding: 1rem;
    height: 180px;
    overflow-y: auto;
    font-size: 0.85rem;
    color: #a5b4fc;
}

.console-line {
    margin-bottom: 0.25rem;
    white-space: pre-wrap;
    display: flex;
    gap: 0.5rem;
}

.console-line.success {
    color: var(--success);
}

.console-line.error {
    color: var(--error);
}

.console-line.info {
    color: var(--primary);
}

.console-line.warning {
    color: var(--warning);
}

.console-cursor {
    display: inline-block;
    width: 6px;
    height: 14px;
    background: var(--primary);
    animation: blink 0.8s infinite;
    vertical-align: middle;
}

@keyframes blink {

    0%,
    100% {
        opacity: 0;
    }

    50% {
        opacity: 1;
    }
}

.pipeline-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Button UI */
.btn {
    font-family: var(--font-sans);
    padding: 0.65rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #080b11;
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(0, 242, 254, 0.5);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Live Stats Sidebar / Grid-Item */
.metrics-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.metric-card {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.metric-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.metric-icon.primary {
    color: var(--primary);
    background: rgba(0, 242, 254, 0.05);
}

.metric-icon.secondary {
    color: var(--secondary);
    background: rgba(138, 43, 226, 0.05);
}

.metric-icon.success {
    color: var(--success);
    background: rgba(16, 185, 129, 0.05);
}

.metric-info {
    display: flex;
    flex-direction: column;
}

.metric-value {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.2;
}

.metric-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Interactive Roadmap/Cheatsheets Sections */
.section-title {
    font-size: 1.4rem;
    font-weight: 800;
    margin: 2.5rem 0 1.25rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.roadmap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.roadmap-card {
    cursor: pointer;
}

.roadmap-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.roadmap-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.roadmap-card:hover .roadmap-icon {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #080b11;
}

.roadmap-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.roadmap-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    border-top: 1px solid var(--border-color);
    padding-top: 0.75rem;
}

.roadmap-tag {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    color: var(--text-muted);
}

.roadmap-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Modal Dialog */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 7, 12, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.modal.open {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: #0f141f;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    transition: var(--transition);
    max-height: 85vh;
    overflow-y: auto;
}

.modal.open .modal-content {
    transform: translateY(0);
}

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

.modal-title {
    font-size: 1.3rem;
    font-weight: 800;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.close-btn:hover {
    color: var(--text-main);
}

.modal-body {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.modal-body h4 {
    color: var(--text-main);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.modal-body ul {
    margin-left: 1.25rem;
    margin-bottom: 1rem;
}

.modal-body code {
    background: #05070c;
    color: var(--primary);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.modal-body pre {
    background: #05070c;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1rem 0;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-body pre code {
    padding: 0;
    background: none;
    color: #a5b4fc;
}

/* Cheatsheet Quick Tabs */
.tabs-container {
    margin-top: 2rem;
}

.tab-nav {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-sans);
    border-radius: 6px;
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
    color: var(--primary);
    background: rgba(0, 242, 254, 0.06);
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cheatsheet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.cheatsheet-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
}

.cheatsheet-item h4 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.cheatsheet-item p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.command-box {
    background: #05070c;
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    padding: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: #a5b4fc;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.copy-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.copy-btn:hover {
    color: var(--primary);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: rgba(15, 20, 31, 0.9);
    border: 1px solid var(--primary);
    border-radius: 8px;
    padding: 0.75rem 1.25rem;
    color: var(--text-main);
    font-size: 0.85rem;
    box-shadow: 0 10px 30px rgba(0, 242, 254, 0.15);
    z-index: 2000;
    transform: translateY(100px);
    opacity: 0;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* Responsive adjustment for Mobile/Tablet */
@media (max-width: 768px) {
    aside {
        display: none;
        /* simple hidden sidebar on small screens or we can make it off-canvas */
    }

    main {
        margin-left: 0;
        padding: 1.5rem;
    }
}