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

:root {
    --bg-dark: #030712;
    --bg-card: rgba(17, 24, 39, 0.7);
    --bg-card-hover: rgba(31, 41, 55, 0.8);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow-cyan: rgba(6, 182, 212, 0.2);
    --border-glow-purple: rgba(139, 92, 246, 0.2);
    
    --color-cyan: #06b6d4;
    --color-cyan-glow: rgba(6, 182, 212, 0.5);
    --color-purple: #8b5cf6;
    --color-purple-glow: rgba(139, 92, 246, 0.5);
    --color-pink: #ec4899;
    --color-amber: #f59e0b;
    --color-green: #10b981;
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --font-sans: 'Outfit', sans-serif;
    --font-mono: 'Fira Code', monospace;
    
    --glow-shadow-cyan: 0 0 20px rgba(6, 182, 212, 0.15);
    --glow-shadow-purple: 0 0 20px rgba(139, 92, 246, 0.15);
    
    --layout-max-width: 95%;
    --container-padding: clamp(1rem, 3vw, 2rem);
    --docs-padding: clamp(1rem, 4vw, 2.5rem);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.5;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(139, 92, 246, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.05) 0%, transparent 40%);
    background-attachment: fixed;
}

a {
    color: inherit;
    text-decoration: none;
}

/* --- Layout & Typography --- */
.container {
    width: 100%;
    max-width: var(--layout-max-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

/* --- Header / Navigation --- */
header {
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(3, 7, 18, 0.7);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 4.5rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    background: linear-gradient(135deg, var(--color-cyan) 0%, var(--color-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-img {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    object-fit: cover;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-link.active {
    color: var(--color-cyan);
    font-weight: 600;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    gap: 0.5rem;
    border: 1px solid transparent;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-cyan) 0%, var(--color-purple) 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(6, 182, 212, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.45);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.btn-cyan {
    background: rgba(6, 182, 212, 0.1);
    color: var(--color-cyan);
    border-color: rgba(6, 182, 212, 0.2);
}

.btn-cyan:hover {
    background: rgba(6, 182, 212, 0.15);
    border-color: var(--color-cyan);
}

.btn-purple {
    background: rgba(139, 92, 246, 0.1);
    color: var(--color-purple);
    border-color: rgba(139, 92, 246, 0.2);
}

.btn-purple:hover {
    background: rgba(139, 92, 246, 0.15);
    border-color: var(--color-purple);
}

.btn-danger {
    background: rgba(244, 63, 94, 0.1);
    color: #f43f5e;
    border-color: rgba(244, 63, 94, 0.2);
}

.btn-danger:hover {
    background: rgba(244, 63, 94, 0.15);
    border-color: #f43f5e;
}

/* --- Hero Section --- */
.hero {
    padding: 7rem 0 5rem 0;
    text-align: center;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 300px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.08) 0%, transparent 70%);
    filter: blur(50px);
    pointer-events: none;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 1rem;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.2);
    color: #a78bfa;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 2rem;
    box-shadow: var(--glow-shadow-purple);
}

.hero-title {
    font-size: 4rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, #ffffff, #d1d5db);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-title span {
    background: linear-gradient(135deg, var(--color-cyan) 0%, var(--color-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 640px;
    margin: 0 auto 2.5rem auto;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 5rem;
}

/* --- Features Section --- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 6rem;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-glow-cyan);
    box-shadow: var(--glow-shadow-cyan);
    background: var(--bg-card-hover);
}

.feature-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    background: rgba(6, 182, 212, 0.1);
    color: var(--color-cyan);
}

.feature-icon.purple {
    background: rgba(139, 92, 246, 0.1);
    color: var(--color-purple);
}

.feature-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.feature-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* --- Interactive Code Sandbox Grid --- */
.code-preview-section {
    margin-bottom: 8rem;
}

.code-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(480px, 1fr));
    gap: 2.5rem;
    align-items: start;
}

.code-card {
    background: #090d16;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.code-header {
    background: #0d1321;
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.code-dots {
    display: flex;
    gap: 0.35rem;
}

.code-dot {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 9999px;
    background: #ef4444;
}

.code-dot:nth-child(2) { background: #f59e0b; }
.code-dot:nth-child(3) { background: #10b981; }

.code-title {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.code-body {
    padding: 1.5rem;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: #e5e7eb;
}

/* --- Card Forms (Login / Register / Dashboards) --- */
.auth-container {
    max-width: 480px;
    margin: 6rem auto;
    padding: 0 1rem;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 3rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--glow-shadow-purple);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(3, 7, 18, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-cyan);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
    background: rgba(3, 7, 18, 0.8);
}

.auth-footer {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.auth-link {
    color: var(--color-cyan);
    font-weight: 600;
    transition: text-shadow 0.2s ease;
}

.auth-link:hover {
    text-shadow: 0 0 8px rgba(6, 182, 212, 0.4);
}

/* --- Alert Messages --- */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    display: none;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #34d399;
}

/* --- Dashboard --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    margin-top: 3rem;
    margin-bottom: 5rem;
}

.dashboard-sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    position: relative;
    overflow: hidden;
}

.stat-glow {
    position: absolute;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, var(--color-cyan-glow) 0%, transparent 70%);
    top: -50px;
    right: -50px;
    pointer-events: none;
}

.stat-glow.purple {
    background: radial-gradient(circle, var(--color-purple-glow) 0%, transparent 70%);
}

.stat-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.stat-val {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--color-cyan) 0%, var(--color-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.panel-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2.5rem;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.panel-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.key-box {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.key-input {
    flex-grow: 1;
    font-family: var(--font-mono);
    background: rgba(3, 7, 18, 0.8);
    font-size: 0.9rem;
    border-color: rgba(255, 255, 255, 0.05);
}

.key-input[type="password"] {
    letter-spacing: 0.2em;
}

/* --- Token Shop Packages --- */
.packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.package-card {
    background: rgba(3, 7, 18, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.package-card:hover {
    border-color: var(--border-glow-purple);
    background: rgba(3, 7, 18, 0.6);
    transform: scale(1.02);
}

.package-tokens {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.package-price {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--color-cyan);
    margin-bottom: 1rem;
}

/* --- Tables & Lists --- */
.data-table-wrapper {
    overflow-x: auto;
    margin-top: 1rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.95rem;
}

.data-table th, .data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    background: rgba(0, 0, 0, 0.1);
}

.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.role-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
}

.role-badge.admin {
    background: rgba(139, 92, 246, 0.15);
    color: #c084fc;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.role-badge.user {
    background: rgba(6, 182, 212, 0.15);
    color: #22d3ee;
    border: 1px solid rgba(6, 182, 212, 0.3);
}

/* --- Footer --- */
footer {
    margin-top: 8rem;
    border-top: 1px solid var(--border-color);
    padding: 3rem 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
}

/* --- Responsive Adjustments --- */
@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-title {
        font-size: 3rem;
    }
}

/* --- Hamburger Menu & Responsive Adjustments --- */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 101;
    padding: 0;
}

.hamburger .bar {
    height: 2px;
    width: 100%;
    background-color: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 4.5rem;
        right: 0;
        left: auto;
        width: 250px;
        background: rgba(3, 7, 18, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-left: 1px solid var(--border-color);
        border-bottom: 1px solid var(--border-color);
        border-radius: 0 0 0 12px;
        padding: 2rem;
        gap: 1.5rem;
        align-items: stretch; /* Stretch children to full width for hover backgrounds */
        text-align: left; /* Align text of links to the left */
        z-index: 99;
        box-shadow: -10px 10px 30px rgba(0,0,0,0.5);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links .nav-link {
        width: 100%;
        text-align: left;
        padding: 0.5rem 0.75rem;
        border-radius: 6px;
        transition: all 0.2s ease;
    }

    .nav-links .nav-link:hover {
        background: rgba(255, 255, 255, 0.03);
    }

    .nav-links .nav-link.active {
        color: var(--color-cyan) !important;
        background: rgba(6, 182, 212, 0.15) !important;
        border-left: 3px solid var(--color-cyan);
        padding-left: 0.5rem;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    
    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
}

@media (max-width: 600px) {
    .hero-title {
        font-size: 2.25rem;
    }
}

/* --- Documentation Layout --- */
.docs-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 3rem;
    margin-top: 2rem;
    margin-bottom: 6rem;
    align-items: start;
}

.docs-sidebar {
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    top: 6.5rem;
    max-height: calc(100vh - 8rem);
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.docs-sidebar-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

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

.docs-menu-item a {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.docs-menu-item a:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.docs-menu-item.active a {
    color: var(--color-cyan);
    background: rgba(6, 182, 212, 0.15); /* More prominent background selection */
    border-right: 3px solid var(--color-cyan); /* Border on the right since menu is on the right */
    border-left: none;
    padding-right: 0.5rem;
    padding-left: 0.75rem;
    border-radius: 6px 0 0 6px;
}

.docs-content {
    grid-column: 1;
    grid-row: 1;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #e5e7eb;
    min-width: 0; /* Prevent content overflow in grid */
    width: 100%;
}

/* Documentation Typography & Markdown styles */
.docs-content h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #d1d5db 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    word-break: break-word; /* Wrap headings under zoom */
}

.docs-content h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    word-break: break-word;
}

.docs-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    word-break: break-word;
}

.docs-content p {
    margin-bottom: 1.25rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.docs-content ul, .docs-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
    color: var(--text-secondary);
}

.docs-content li {
    margin-bottom: 0.5rem;
}

.docs-content code {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    color: #f472b6;
    border: 1px solid rgba(255, 255, 255, 0.03);
    word-break: break-all;
}

.docs-content pre {
    background: #090d16;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem;
    overflow-x: auto;
    margin-bottom: 1.5rem;
    max-width: 100%; /* Restrict code overflow */
}

.docs-content pre code {
    background: transparent;
    padding: 0;
    border: none;
    color: #e5e7eb;
    font-size: 0.9rem;
    white-space: pre;
}

.docs-content blockquote {
    border-left: 4px solid var(--color-purple);
    background: rgba(139, 92, 246, 0.05);
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 0 8px 8px 0;
}

.docs-content blockquote p {
    margin-bottom: 0;
    font-style: italic;
    color: var(--text-primary);
}

.docs-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    display: block; /* Force table block representation for horizontal scroll */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.docs-content th, .docs-content td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.docs-content th {
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-primary);
    font-weight: 600;
}

/* Docs Mobile Toggle Button */
.docs-toggle-btn {
    display: none;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    padding: 0.75rem 1.25rem;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    justify-content: center;
    margin-bottom: 1.5rem;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
}

.docs-toggle-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--color-cyan);
}

.docs-toggle-btn svg {
    transition: transform 0.2s ease;
}

@media (max-width: 900px) {
    .docs-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .docs-sidebar {
        display: none;
        position: static;
        max-height: none;
        width: 100%;
        margin-bottom: 1.5rem;
        grid-column: auto; /* Reset grid position on mobile */
        grid-row: auto;
    }
    
    .docs-sidebar.active {
        display: block;
    }
    
    .docs-content {
        grid-column: auto; /* Reset grid position on mobile */
        grid-row: auto;
    }
    
    .docs-toggle-btn {
        display: flex;
    }
}

/* --- PayPal Modal --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(3, 7, 18, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 3rem 1rem;
    overflow-y: auto;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 90%;
    max-width: 480px;
    padding: 2.5rem;
    margin: auto;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active .modal-card {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.5rem;
    transition: color 0.2s ease;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-header {
    margin-bottom: 2rem;
    text-align: center;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.modal-summary {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 2rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.summary-row:last-child {
    margin-bottom: 0;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--border-color);
    font-weight: 700;
    color: var(--color-cyan);
}

/* Spinner style */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--color-cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- Success Banner --- */
.success-banner {
    position: relative;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    overflow: hidden;
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.05);
    animation: slideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.success-banner-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.12) 0%, transparent 75%);
    pointer-events: none;
}

.success-banner-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 1;
}

.success-banner-icon {
    color: #10b981;
    background: rgba(16, 185, 129, 0.15);
    border-radius: 50%;
    padding: 0.3rem;
    flex-shrink: 0;
}

.success-banner-text {
    display: flex;
    flex-direction: column;
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.success-banner-close {
    background: none;
    border: none;
    color: rgba(16, 185, 129, 0.6);
    cursor: pointer;
    font-size: 1.5rem;
    transition: color 0.2s ease;
    z-index: 1;
    line-height: 1;
}

.success-banner-close:hover {
    color: #10b981;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- AI Chat Container --- */
.chat-container {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(3, 7, 18, 0.4);
    display: flex;
    flex-direction: column;
    height: 480px;
    overflow: hidden;
    margin-top: 1rem;
}

.chat-messages {
    flex-grow: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    scroll-behavior: smooth;
}

.chat-message {
    max-width: 85%;
    padding: 1rem 1.25rem;
    border-radius: 14px;
    font-size: 0.95rem;
    line-height: 1.6;
    position: relative;
    word-break: break-word;
}

/* User Message */
.chat-message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--color-cyan) 0%, #06b6d4 100%);
    color: #030712;
    font-weight: 500;
    border-bottom-right-radius: 2px;
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.15);
}

/* Assistant Message */
.chat-message.assistant {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-bottom-left-radius: 2px;
}

/* System/Welcome Message */
.chat-message.system {
    align-self: center;
    background: rgba(255, 255, 255, 0.01);
    border: 1px dashed var(--border-color);
    color: var(--text-secondary);
    text-align: center;
    font-size: 0.85rem;
    max-width: 90%;
    padding: 0.75rem 1.25rem;
}

.chat-input-area {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    background: rgba(3, 7, 18, 0.6);
}

.chat-input {
    flex-grow: 1;
    background: rgba(255, 255, 255, 0.02) !important;
}

.chat-input:focus {
    background: rgba(255, 255, 255, 0.05) !important;
}

/* Code block formatting inside chat */
.chat-message pre {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin: 0.75rem 0;
    overflow-x: auto;
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
}

.chat-message code {
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    color: var(--color-cyan);
    background: rgba(6, 182, 212, 0.08);
    padding: 0.15rem 0.3rem;
    border-radius: 4px;
}

.chat-message pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.chat-message p {
    margin-bottom: 0.75rem;
}

.chat-message p:last-child {
    margin-bottom: 0;
}

/* RTL Text Alignment & LTR Code Blocks */
.chat-message.rtl {
    direction: rtl;
    text-align: right;
}

.chat-message.rtl pre,
.chat-message.rtl code {
    direction: ltr !important;
    text-align: left !important;
    unicode-bidi: embed;
}

