@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

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

:root {
    --bg: #0f1117;
    --bg-card: #1a1d27;
    --bg-card-hover: #22263a;
    --border: #2a2e3e;
    --text: #e4e6ed;
    --text-dim: #8b8fa3;
    --accent: #6c5ce7;
    --accent-light: #a29bfe;
    --gradient-1: linear-gradient(135deg, #6c5ce7, #a29bfe);
    --gradient-2: linear-gradient(135deg, #00cec9, #81ecec);
    --gradient-3: linear-gradient(135deg, #fd79a8, #fab1a0);
    --gradient-4: linear-gradient(135deg, #fdcb6e, #e17055);
    --gradient-5: linear-gradient(135deg, #55efc4, #00b894);
    --gradient-6: linear-gradient(135deg, #74b9ff, #0984e3);
    --gradient-7: linear-gradient(135deg, #d63031, #e17055);
    --gradient-8: linear-gradient(135deg, #636e72, #b2bec3);
    --success: #00b894;
    --warning: #fdcb6e;
    --danger: #d63031;
    --info: #0984e3;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background animated mesh */
.bg-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(108, 92, 231, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(0, 206, 201, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 60% 80%, rgba(253, 121, 168, 0.05) 0%, transparent 50%);
}

/* Top Navigation Bar */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(15, 17, 23, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text);
}

.nav-brand .shield-icon {
    width: 36px;
    height: 36px;
    background: var(--gradient-1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.nav-brand h1 {
    font-size: 1.3rem;
    font-weight: 700;
}

.nav-brand h1 span {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-back {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(108, 92, 231, 0.15);
    color: var(--accent-light);
    border: 1px solid rgba(108, 92, 231, 0.3);
    padding: 8px 18px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.nav-back:hover {
    background: rgba(108, 92, 231, 0.3);
    transform: translateY(-1px);
}

/* Main Content */
.page-content {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 88px 24px 60px;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 60px 0 48px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(108, 92, 231, 0.15);
    border: 1px solid rgba(108, 92, 231, 0.3);
    color: var(--accent-light);
    padding: 6px 18px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
}

.hero h2 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 16px;
}

.hero h2 .gradient-text {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-dim);
    max-width: 650px;
    margin: 0 auto 32px;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

/* Layer Navigation (sticky sidebar on desktop, horizontal on mobile) */
.layer-nav {
    position: sticky;
    top: 80px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 32px;
    z-index: 50;
}

.layer-nav-title {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 12px;
    font-weight: 600;
}

.layer-nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.layer-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    color: var(--text-dim);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
}

.layer-link:hover {
    background: rgba(108, 92, 231, 0.1);
    color: var(--accent-light);
    border-color: rgba(108, 92, 231, 0.2);
}

.layer-link .layer-num {
    background: rgba(255, 255, 255, 0.08);
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
}

/* Layer Sections */
.layer-section {
    margin-bottom: 48px;
    scroll-margin-top: 160px;
}

.layer-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding: 24px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.layer-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.layer-1 .layer-header::before {
    background: var(--gradient-1);
}

.layer-2 .layer-header::before {
    background: var(--gradient-2);
}

.layer-3 .layer-header::before {
    background: var(--gradient-6);
}

.layer-4 .layer-header::before {
    background: var(--gradient-4);
}

.layer-5 .layer-header::before {
    background: var(--gradient-5);
}

.layer-6 .layer-header::before {
    background: var(--gradient-3);
}

.layer-7 .layer-header::before {
    background: var(--gradient-7);
}

.layer-8 .layer-header::before {
    background: var(--gradient-8);
}

.layer-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
}

.layer-1 .layer-icon {
    background: rgba(108, 92, 231, 0.15);
}

.layer-2 .layer-icon {
    background: rgba(0, 206, 201, 0.15);
}

.layer-3 .layer-icon {
    background: rgba(9, 132, 227, 0.15);
}

.layer-4 .layer-icon {
    background: rgba(253, 203, 110, 0.15);
}

.layer-5 .layer-icon {
    background: rgba(0, 184, 148, 0.15);
}

.layer-6 .layer-icon {
    background: rgba(253, 121, 168, 0.15);
}

.layer-7 .layer-icon {
    background: rgba(214, 48, 49, 0.15);
}

.layer-8 .layer-icon {
    background: rgba(99, 110, 114, 0.15);
}

.layer-header-text h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.layer-header-text p {
    font-size: 0.9rem;
    color: var(--text-dim);
}

/* Sub-section headers */
.sub-section {
    margin-bottom: 32px;
}

.sub-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.sub-header h4 {
    font-size: 1.1rem;
    font-weight: 700;
}

.sub-header .sub-icon {
    font-size: 1.2rem;
}

/* Tool Tables */
.tool-table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    margin-bottom: 20px;
}

.tool-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.tool-table thead {
    background: rgba(108, 92, 231, 0.1);
}

.tool-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--accent-light);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.tool-table td {
    padding: 10px 16px;
    border-bottom: 1px solid rgba(42, 46, 62, 0.5);
    color: var(--text);
    vertical-align: top;
}

.tool-table tbody tr {
    transition: background 0.2s;
}

.tool-table tbody tr:hover {
    background: rgba(108, 92, 231, 0.05);
}

.tool-table tbody tr:last-child td {
    border-bottom: none;
}

.tool-name {
    font-weight: 600;
    color: var(--accent-light);
    white-space: nowrap;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-free {
    background: rgba(0, 184, 148, 0.15);
    color: #55efc4;
}

.badge-paid {
    background: rgba(253, 203, 110, 0.15);
    color: #fdcb6e;
}

.badge-mixed {
    background: rgba(9, 132, 227, 0.15);
    color: #74b9ff;
}

.stars {
    color: var(--warning);
    font-size: 0.75rem;
}

/* Workflow Boxes */
.workflow-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
    margin-bottom: 20px;
}

.workflow-box .workflow-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 12px;
    color: var(--accent-light);
}

.workflow-box ol,
.workflow-box ul {
    list-style: none;
    padding: 0;
}

.workflow-box li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    font-size: 0.85rem;
    color: var(--text-dim);
    border-bottom: 1px solid rgba(42, 46, 62, 0.3);
}

.workflow-box li:last-child {
    border-bottom: none;
}

.workflow-box li .step-num {
    background: rgba(108, 92, 231, 0.2);
    color: var(--accent-light);
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* Tip / Warning Boxes */
.tip-box {
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 0.85rem;
}

.tip-box.info {
    background: rgba(9, 132, 227, 0.1);
    border: 1px solid rgba(9, 132, 227, 0.25);
    color: #74b9ff;
}

.tip-box.warning {
    background: rgba(253, 203, 110, 0.08);
    border: 1px solid rgba(253, 203, 110, 0.25);
    color: #fdcb6e;
}

.tip-box.danger {
    background: rgba(214, 48, 49, 0.08);
    border: 1px solid rgba(214, 48, 49, 0.25);
    color: #fab1a0;
}

.tip-box.success {
    background: rgba(0, 184, 148, 0.08);
    border: 1px solid rgba(0, 184, 148, 0.25);
    color: #55efc4;
}

.tip-box .tip-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

/* Config Code Block */
.config-block {
    background: #0d0f15;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    margin-bottom: 20px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.8rem;
    color: var(--accent-light);
    overflow-x: auto;
    line-height: 1.8;
}

.config-block .comment {
    color: var(--text-dim);
}

.config-block .key {
    color: #55efc4;
}

.config-block .value {
    color: #fdcb6e;
}

/* Implementation Plan Cards */
.plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.plan-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.plan-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.plan-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.plan-card.level-1::before {
    background: var(--gradient-5);
}

.plan-card.level-2::before {
    background: var(--gradient-6);
}

.plan-card.level-3::before {
    background: var(--gradient-4);
}

.plan-card.level-4::before {
    background: var(--gradient-7);
}

.plan-card .plan-level {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
}

.plan-card.level-1 .plan-level {
    color: #55efc4;
}

.plan-card.level-2 .plan-level {
    color: #74b9ff;
}

.plan-card.level-3 .plan-level {
    color: #fdcb6e;
}

.plan-card.level-4 .plan-level {
    color: #fab1a0;
}

.plan-card h4 {
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.plan-card .plan-cost {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 16px;
}

.plan-card .plan-items {
    list-style: none;
    padding: 0;
}

.plan-card .plan-items li {
    font-size: 0.8rem;
    color: var(--text-dim);
    padding: 5px 0;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.plan-card .plan-items li::before {
    content: '✓';
    color: var(--success);
    font-weight: 700;
    flex-shrink: 0;
}

/* Checklist Section */
.checklist-section {
    margin-bottom: 24px;
}

.checklist-section h4 {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.checklist {
    list-style: none;
    padding: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.checklist li {
    padding: 10px 16px;
    border-bottom: 1px solid rgba(42, 46, 62, 0.5);
    font-size: 0.85rem;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background 0.2s;
}

.checklist li:hover {
    background: rgba(108, 92, 231, 0.05);
}

.checklist li:last-child {
    border-bottom: none;
}

.checklist li .check-icon {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
    font-size: 0.7rem;
}

.checklist li.checked .check-icon {
    background: var(--success);
    border-color: var(--success);
    color: #000;
}

.checklist li.checked {
    color: var(--text);
    text-decoration: line-through;
    opacity: 0.6;
}

/* Errors Table */
.error-table {
    margin-bottom: 24px;
}

/* Resources Section */
.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.resource-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
    transition: transform 0.3s, border-color 0.3s;
}

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

.resource-card h5 {
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.resource-card p {
    font-size: 0.8rem;
    color: var(--text-dim);
}

/* Footer */
.page-footer {
    text-align: center;
    padding: 48px 0;
    border-top: 1px solid var(--border);
    margin-top: 48px;
    color: var(--text-dim);
    font-size: 0.85rem;
}

.page-footer p {
    margin-bottom: 8px;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h2 {
        font-size: 1.8rem;
    }

    .hero-stats {
        gap: 20px;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .plan-grid {
        grid-template-columns: 1fr;
    }

    .resources-grid {
        grid-template-columns: 1fr;
    }

    .layer-nav-links {
        gap: 6px;
    }

    .layer-link {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    .tool-table {
        font-size: 0.78rem;
    }

    .tool-table th,
    .tool-table td {
        padding: 8px 10px;
    }

    .layer-header {
        flex-direction: column;
        text-align: center;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Scroll indicator animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.layer-section {
    animation: fadeInUp 0.5s ease-out;
}