/* Solana Rapid-Fire 101 - Custom Styles */

/* Base styles */
* {
    scroll-behavior: smooth;
}

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

::-webkit-scrollbar-track {
    background: #09637E;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #09637E;
}

/* Gradient text utility */
.gradient-text {
    background: linear-gradient(135deg, #09637E 0%, #7AB2B2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Animation container base styles */
.animation-container {
    background: linear-gradient(180deg, rgba(122, 178, 178, 0.12) 0%, rgba(235, 244, 246, 0.25) 100%);
    border: 1px solid rgba(122, 178, 178, 0.35);
    border-radius: 1rem;
    position: relative;
    overflow: hidden;
}

.animation-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #09637E, #7AB2B2, transparent);
}

/* Animation controls */
.animation-controls {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(9, 99, 126, 0.08);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.animation-controls button {
    padding: 0.5rem 1rem;
    background: rgba(9, 99, 126, 0.2);
    border: 1px solid rgba(122, 178, 178, 0.5);
    border-radius: 0.5rem;
    color: #0f172a;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.animation-controls button:hover {
    background: rgba(9, 99, 126, 0.35);
    border-color: #7AB2B2;
}

.animation-controls button.active {
    background: #09637E;
    border-color: #7AB2B2;
}

/* Quiz styles */
.quiz-container {
    background: linear-gradient(180deg, rgba(235, 244, 246, 0.25) 0%, rgba(122, 178, 178, 0.18) 100%);
    border: 1px solid rgba(122, 178, 178, 0.35);
    border-radius: 1rem;
    padding: 1.5rem;
}

.quiz-option {
    display: block;
    width: 100%;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: #FFFFFF;
    border: 2px solid rgba(9, 99, 126, 0.2);
    border-radius: 0.75rem;
    color: #0f172a;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
}

.quiz-option:hover:not(.disabled) {
    background: #EBF4F6;
    border-color: rgba(9, 99, 126, 0.5);
}

.quiz-option.selected {
    border-color: #7AB2B2;
    background: rgba(9, 99, 126, 0.2);
}

.quiz-option.correct {
    border-color: #7AB2B2;
    background: rgba(122, 178, 178, 0.25);
}

.quiz-option.incorrect {
    border-color: #FF4545;
    background: rgba(255, 69, 69, 0.2);
}

.quiz-option.disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* Code block styles */
.code-block {
    background: #FFFFFF;
    border: 1px solid rgba(122, 178, 178, 0.6);
    border-radius: 0.75rem;
    overflow: hidden;
}

.code-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: rgba(9, 99, 126, 0.08);
    border-bottom: 1px solid #333;
}

.code-block-header span {
    color: #64748b;
    font-size: 0.875rem;
}

.code-block-header button {
    padding: 0.25rem 0.75rem;
    background: rgba(9, 99, 126, 0.2);
    border: 1px solid rgba(122, 178, 178, 0.5);
    border-radius: 0.375rem;
    color: #09637E;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.code-block-header button:hover {
    background: rgba(9, 99, 126, 0.35);
}

.code-block pre {
    padding: 1rem;
    margin: 0;
    overflow-x: auto;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
}

.code-block code {
    color: #0f172a;
}

/* Flow steps */
.flow-step {
    border: 1px solid rgba(9, 99, 126, 0.2);
    background: #FFFFFF;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
}

.flow-step-title {
    font-weight: 600;
    color: #09637E;
    font-size: 0.9rem;
}

.flow-step-text {
    color: #334155;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.flow-step.active {
    border-color: #09637E;
    box-shadow: 0 8px 16px rgba(9, 99, 126, 0.15);
    background: rgba(9, 99, 126, 0.08);
}

.flow-step {
    cursor: pointer;
}

.paywall-flow-arrows {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.5;
}

.mermaid-diagram {
    width: 100%;
    min-height: 320px;
    padding: 1rem;
}

.mermaid-diagram .mermaid {
    width: 100%;
}

/* Phase accordion */
.phase-accordion {
    border: 1px solid rgba(9, 99, 126, 0.2);
    border-radius: 0.75rem;
    background: #FFFFFF;
    overflow: hidden;
}

.phase-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1rem;
    border: 0;
    background: #FFFFFF;
    color: #09637E;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.phase-toggle:hover {
    background: rgba(9, 99, 126, 0.08);
}

.phase-toggle.active {
    background: rgba(9, 99, 126, 0.12);
}

.phase-panel {
    display: none;
    padding: 0 1rem 1rem;
    border-bottom: 1px solid rgba(9, 99, 126, 0.15);
}

.phase-panel.active {
    display: block;
}

.phase-indicator {
    font-size: 1.1rem;
    line-height: 1;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.step-nav-btn {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s;
    cursor: pointer;
}

.btn-primary {
    background: #09637E;
    color: #ffffff;
    border: 1px solid #09637E;
    box-shadow: 0 6px 12px rgba(9, 99, 126, 0.2);
}

.btn-primary:hover {
    background: #088395;
    border-color: #088395;
    transform: translateY(-1px);
}

.btn-secondary,
.step-nav-btn {
    background: #ffffff;
    color: #09637E;
    border: 1px solid rgba(9, 99, 126, 0.45);
}

.btn-secondary:hover,
.step-nav-btn:hover {
    background: rgba(9, 99, 126, 0.12);
    border-color: #09637E;
}

.step-nav-btn.active {
    background: rgba(9, 99, 126, 0.15);
    border-color: #09637E;
    color: #09637E;
}

.btn-primary:disabled,
.btn-secondary:disabled,
.step-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Syntax highlighting */
.code-keyword { color: #09637E; }
.code-string { color: #088395; }
.code-comment { color: #64748b; }
.code-function { color: #0f172a; }
.code-number { color: #7AB2B2; }

/* Lesson page layout */
.lesson-layout {
    display: block;
    min-height: 100vh;
    width: 100%;
}

@media (max-width: 1024px) {
    .lesson-layout {
        display: block;
    }
}

/* Sidebar */
.lesson-sidebar {
    position: fixed;
    top: 64px;
    left: 0;
    width: 280px;
    height: calc(100vh - 64px);
    background: #EBF4F6;
    border-right: 1px solid rgba(122, 178, 178, 0.6);
    overflow-y: auto;
    padding: 1.5rem;
    z-index: 40;
}

@media (max-width: 1024px) {
    .lesson-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .lesson-sidebar.open {
        transform: translateX(0);
    }
}

.sidebar-section {
    margin-bottom: 1.5rem;
}

.sidebar-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 0.75rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    margin-bottom: 0.25rem;
    border-radius: 0.5rem;
    color: #64748b;
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.sidebar-link:hover {
    background: rgba(9, 99, 126, 0.08);
    color: #0f172a;
}

.sidebar-link.active {
    background: rgba(9, 99, 126, 0.18);
    color: #09637E;
}

.sidebar-link.completed {
    color: #09637E;
}

.sidebar-link .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(9, 99, 126, 0.3);
    flex-shrink: 0;
}

.sidebar-link.completed .status-dot {
    background: #09637E;
}

.sidebar-link.active .status-dot {
    background: #09637E;
}

/* Main content area */
.lesson-content {
    margin-left: 280px;
    padding: 2rem;
    max-width: none;
    width: calc(100% - 280px);
    box-sizing: border-box;
}

@media (max-width: 1024px) {
    .lesson-content {
        margin-left: 0;
        padding: 1rem;
        width: 100%;
    }
}

/* Content typography */
.lesson-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.lesson-content h2 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    color: #7AB2B2;
}

.lesson-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.lesson-content p {
    color: #334155;
    line-height: 1.75;
    margin-bottom: 1rem;
}

.lesson-content ul, .lesson-content ol {
    color: #334155;
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.lesson-content li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.lesson-content strong {
    color: #0f172a;
    font-weight: 600;
}

/* Info boxes */
.info-box {
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    margin: 1.5rem 0;
}

.info-box.note {
    background: rgba(9, 99, 126, 0.18);
    border-left: 4px solid #7AB2B2;
}

.info-box.tip {
    background: rgba(122, 178, 178, 0.18);
    border-left: 4px solid #7AB2B2;
}

.info-box.warning {
    background: rgba(255, 200, 50, 0.1);
    border-left: 4px solid #ffc832;
}

.info-box-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Navigation buttons */
.lesson-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(122, 178, 178, 0.6);
}

.lesson-nav a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: #FFFFFF;
    border: 1px solid rgba(9, 99, 126, 0.2);
    border-radius: 0.75rem;
    color: #0f172a;
    text-decoration: none;
    transition: all 0.2s;
}

.lesson-nav a:hover {
    background: rgba(9, 99, 126, 0.2);
    border-color: #7AB2B2;
}

.lesson-nav .next {
    margin-left: auto;
}

/* Solana Playground embed */
.playground-embed {
    width: 100%;
    height: 500px;
    border-radius: 0.75rem;
    border: 1px solid rgba(122, 178, 178, 0.6);
    margin: 1.5rem 0;
}

/* Checklist */
.checklist {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.checklist-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #7AB2B2;
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
}

.checklist-item label {
    cursor: pointer;
    color: #334155;
}

.checklist-item.checked label {
    color: #7AB2B2;
    text-decoration: line-through;
}

/* Progress indicator in lesson pages */
.lesson-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.lesson-progress-bar {
    flex: 1;
    height: 4px;
    background: #222;
    border-radius: 2px;
    overflow: hidden;
}

.lesson-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #09637E, #7AB2B2);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Mobile menu toggle */
.mobile-sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #09637E, #7AB2B2);
    border: none;
    border-radius: 50%;
    color: #0f172a;
    cursor: pointer;
    z-index: 50;
    box-shadow: 0 4px 20px rgba(9, 99, 126, 0.4);
}

@media (max-width: 1024px) {
    .mobile-sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease forwards;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(9, 99, 126, 0.3); }
    50% { box-shadow: 0 0 40px rgba(9, 99, 126, 0.6); }
}

.animate-pulse-glow {
    animation: pulse-glow 2s ease-in-out infinite;
}

/* Node styles for network animations */
.node {
    fill: #09637E;
    stroke: #7AB2B2;
    stroke-width: 2;
}

.node-label {
    fill: white;
    font-size: 12px;
    text-anchor: middle;
    dominant-baseline: middle;
}

.connection {
    stroke: rgba(9, 99, 126, 0.5);
    stroke-width: 2;
    fill: none;
}

.data-packet {
    fill: #7AB2B2;
    filter: drop-shadow(0 0 8px rgba(122, 178, 178, 0.8));
}

/* Account visualization */
.account-box {
    fill: rgba(9, 99, 126, 0.2);
    stroke: #7AB2B2;
    stroke-width: 2;
    rx: 8;
}

.account-label {
    fill: white;
    font-size: 14px;
    font-weight: 600;
}

.account-field {
    fill: rgba(255, 255, 255, 0.05);
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 1;
    rx: 4;
}

/* Stepper cards */
.stepper-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem;
    padding: 1rem;
    transition: all 0.2s ease;
}

.stepper-card.active {
    border-color: #7AB2B2;
    box-shadow: 0 0 0 1px rgba(9, 99, 126, 0.4);
    background: rgba(9, 99, 126, 0.12);
}

.stepper-card.complete {
    border-color: #7AB2B2;
    background: rgba(8, 131, 149, 0.08);
}

.stepper-title {
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.stepper-progress {
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
}

.stepper-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #09637E, #7AB2B2);
    width: 0%;
    transition: width 0.3s ease;
}

/* Pills */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: #c9c9c9;
    font-size: 0.75rem;
    transition: all 0.2s ease;
}

.pill.active {
    border-color: #7AB2B2;
    color: #7AB2B2;
    background: rgba(8, 131, 149, 0.12);
}

/* Slide card */
.slide-card {
    background: linear-gradient(135deg, rgba(235, 244, 246, 0.9), rgba(122, 178, 178, 0.25));
    border: 1px solid rgba(9, 99, 126, 0.2);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-top: 0px !important;
}

.slide-kicker {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
}

.slide-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0.35rem 0 0.5rem;
}

.slide-subtitle {
    color: #475569;
    font-size: 0.95rem;
}

/* Slide deck */
.slide-deck {
    background: #FFFFFF;
    border: 1px solid rgba(122, 178, 178, 0.6);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(9, 99, 126, 0.08);
}

.slide {
    display: none;
    animation: fadeIn 0.3s ease;
}

.slide.active {
    display: block;
}

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

.slide-counter {
    font-size: 0.85rem;
    color: #64748b;
}

.slide-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.5rem;
}

.slide-nav button {
    padding: 0.6rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(9, 99, 126, 0.25);
    background: #EBF4F6;
    color: #09637E;
    cursor: pointer;
    transition: all 0.2s ease;
}

.slide-nav button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.slide-nav button:hover:not(:disabled) {
    background: rgba(9, 99, 126, 0.15);
}

.slide-dots {
    display: flex;
    gap: 0.4rem;
    justify-content: center;
    flex-wrap: wrap;
}

.slide-dot {
    min-width: 28px;
    height: 28px;
    padding: 0 0.35rem;
    border-radius: 999px;
    border: 1px solid rgba(9, 99, 126, 0.3);
    background: #EBF4F6;
    color: #09637E;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
}

.slide-dot.active {
    background: #09637E;
    border-color: #09637E;
    color: #FFFFFF;
}

/* Global network board */
.all-at-once-board {
    background-image: url("https://upload.wikimedia.org/wikipedia/commons/8/80/BlankMap-World.svg");
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    border-radius: 0.75rem;
}

.all-at-once-status {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 1.25rem;
    background: #FFFFFF;
    border: 1px solid rgba(122, 178, 178, 0.6);
    border-radius: 999px;
    color: #09637E;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 10px 20px rgba(9, 99, 126, 0.12);
    z-index: 2;
}

#ledger.highlighted rect,
#memory-panel.highlighted rect {
    stroke: #09637E;
    stroke-width: 2.5;
    filter: drop-shadow(0 0 10px rgba(9, 99, 126, 0.35));
}

/* Computer flow interaction */
.computer-flow {
    background: #FFFFFF;
    border: 1px solid rgba(122, 178, 178, 0.6);
    border-radius: 1rem;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.computer-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 1.5rem;
}

.computer-controls label {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: #475569;
}

.computer-controls input,
.computer-controls select {
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(9, 99, 126, 0.3);
    border-radius: 0.5rem;
    background: #EBF4F6;
    color: #0f172a;
}

.computer-controls button {
    padding: 0.6rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(9, 99, 126, 0.35);
    background: #09637E;
    color: #EBF4F6;
    cursor: pointer;
    transition: all 0.2s ease;
}

.computer-controls button:hover {
    background: #088395;
}

.computer-controls button.secondary {
    background: #EBF4F6;
    color: #09637E;
}

.computer-controls button.secondary:hover {
    background: rgba(9, 99, 126, 0.12);
}

.computer-graphic {
    display: grid;
    grid-template-columns: 1fr auto 3fr;
    gap: 1rem;
    align-items: center;
}

.pc-case {
    background: #FFFFFF;
    border: 2px solid rgba(9, 99, 126, 0.35);
    border-radius: 1rem;
    padding: 1rem;
    position: relative;
}

.pc-case-title {
    position: absolute;
    top: -0.7rem;
    left: 1rem;
    background: #EBF4F6;
    padding: 0 0.5rem;
    font-size: 0.75rem;
    color: #09637E;
    font-weight: 600;
}

.pc-flow {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    align-items: center;
}

.cf-node {
    background: #EBF4F6;
    border: 1px solid rgba(9, 99, 126, 0.25);
    border-radius: 0.75rem;
    padding: 0.9rem;
    text-align: center;
    transition: all 0.2s ease;
}

.cf-node.active {
    border-color: #09637E;
    box-shadow: 0 0 0 2px rgba(9, 99, 126, 0.2);
}

.cf-title {
    font-weight: 600;
    color: #09637E;
}

.cf-sub {
    font-size: 0.8rem;
    color: #64748b;
}

.cf-value {
    margin-top: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
}

.cf-arrow {
    font-size: 1.5rem;
    color: #7AB2B2;
    text-align: center;
}

.computer-share {
    margin-top: 1.5rem;
    display: flex;
    justify-content: flex-end;
}

@media (max-width: 900px) {
    .computer-graphic {
        grid-template-columns: 1fr;
    }

    .pc-flow {
        grid-template-columns: 1fr;
    }

    .cf-arrow {
        transform: rotate(90deg);
    }

    .computer-share {
        justify-content: flex-start;
    }
}

/* Print styles */
@media print {
    .lesson-sidebar,
    .animation-controls,
    .lesson-nav,
    .mobile-sidebar-toggle {
        display: none !important;
    }

    .lesson-content {
        margin-left: 0;
        max-width: 100%;
    }
}
