@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

:root {
    /* GitHub Dark Dimmed Palette */
    --bg-canvas: #0d1117;
    --bg-canvas-subtle: #161b22;
    --border-default: #30363d;
    --border-muted: #21262d;
    --text-primary: #c9d1d9;
    --text-secondary: #8b949e;
    --accent-fg: #58a6ff;
    --success-fg: #238636;
    --danger-fg: #f85149;
    --attention-fg: #d29922;
    --header-height: 56px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    background-color: var(--bg-canvas);
    color: var(--text-primary);
    line-height: 1.5;
}

.font-mono {
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Scrollbar (GitHub Style) */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: #30363d;
    border: 3px solid var(--bg-canvas);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #8b949e;
}

.custom-scroll::-webkit-scrollbar {
    width: 8px;
}

/* Buttons */
.btn-primary {
    background-color: #238636;
    color: #ffffff;
    border: 1px solid rgba(240, 246, 252, 0.1);
    border-radius: 6px;
    padding: 5px 16px;
    font-weight: 500;
    font-size: 14px;
    transition: 0.2s;
    user-select: none;
}

.btn-primary:hover {
    background-color: #2ea043;
    border-color: #8b949e;
}

.btn-outline {
    background-color: #21262d;
    color: var(--text-secondary);
    border: 1px solid var(--border-default);
    border-radius: 6px;
    padding: 5px 12px;
    font-size: 13px;
    font-weight: 500;
    transition: 0.2s;
    user-select: none;
}

.btn-outline:hover {
    background-color: #30363d;
    border-color: #8b949e;
    color: var(--text-primary);
}

/* Audio Visualizer Bars */
.bar {
    background-color: #58a6ff;
    width: 3px;
    border-radius: 2px;
    height: 4px;
    transition: height 0.1s ease;
}

/* Markdown Body (GitHub Flavored) */
.markdown-body {
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.6;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
    margin-top: 24px;
    margin-bottom: 16px;
    font-weight: 600;
    line-height: 1.25;
    color: #ffd700;
    /* Gold */
}

.markdown-body h2 {
    padding-bottom: 0.3em;
    border-bottom: 1px solid var(--border-default);
}

.markdown-body p {
    margin-bottom: 16px;
}

.markdown-body code {
    padding: 0.2em 0.4em;
    margin: 0;
    font-size: 85%;
    background-color: rgba(110, 118, 129, 0.4);
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
}

.markdown-body pre {
    padding: 16px;
    overflow: auto;
    font-size: 85%;
    line-height: 1.45;
    background-color: #161b22;
    border-radius: 6px;
    margin-bottom: 16px;
}

.markdown-body pre code {
    background-color: transparent;
    padding: 0;
}

.markdown-body ul {
    padding-left: 2em;
    margin-bottom: 16px;
    list-style-type: disc;
}

.markdown-body blockquote {
    padding: 0 1em;
    color: var(--text-secondary);
    border-left: 0.25em solid var(--border-default);
    margin-bottom: 16px;
}

/* File Tree */
.tree-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    cursor: pointer;
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 13px;
    white-space: nowrap;
}

.tree-item:hover {
    color: var(--text-primary);
    background-color: rgba(177, 186, 196, 0.12);
}

.tree-item.active {
    background-color: rgba(56, 139, 253, 0.15);
    color: white;
    position: relative;
}

.tree-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #58a6ff;
    border-radius: 2px;
}

/* Mermaid Override */
.mermaid svg {
    max-width: none !important;
    /* Allow zoom */
}

#mermaid-container {
    background: #ffffff;
    /* White bg for diagram */
    padding: 1rem;
    border-radius: 0.5rem;
}

#mermaid-wrapper {
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
    background-size: 20px 20px;
    cursor: grab;
    overflow: hidden;
    /* Important for transform pan */
}

#mermaid-wrapper:active {
    cursor: grabbing;
}

/* Script Styling */
.script-turn {
    padding: 12px 16px;
    border-bottom: 1px solid #21262d;
    transition: background 0.2s;
}

.script-turn:hover {
    background: #161b22;
}

.script-turn:last-child {
    border-bottom: none;
}

.script-label {
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.script-text {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.5;
}

/* Landing Page Effects */
.bg-grid {
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 40px 40px;
}

.spotlight {
    position: fixed;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(46, 160, 67, 0.15) 0%, transparent 70%);
    pointer-events: none;
    left: var(--mouse-x, 50%);
    top: var(--mouse-y, 50%);
    transform: translate(-50%, -50%);
    transition: opacity 0.5s;
    z-index: 1;
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fade-in-up 0.6s ease-out;
}

.input-glow {
    transition: all 0.3s ease;
}

.input-glow:focus-within {
    box-shadow: 0 0 0 3px rgba(46, 160, 67, 0.2);
}

/* Gradient Text */
.text-gradient {
    background: linear-gradient(to bottom, #ffffff 30%, rgba(255, 255, 255, 0.5) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Hover Effects */
.group:hover .group-hover\:translate-x-1 {
    transform: translateX(0.25rem);
}

/* Loading Animation */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}