/* ===================================================================
   AKZ BotSec - Custom Styling (System/Light/Dark, Glassmorphism, Tree Nav)
   =================================================================== */

:root {
    --bg-primary: #f8fafc;
    --bg-surface: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.85);
    --border-color: rgba(226, 232, 240, 0.8);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --accent-blue: #3b82f6;
    --accent-indigo: #6366f1;
    --accent-purple: #8b5cf6;
    --brand-glow: rgba(59, 130, 246, 0.15);
}

html.dark {
    --bg-primary: #090d16;
    --bg-surface: #0f172a;
    --bg-card: rgba(15, 23, 42, 0.85);
    --border-color: rgba(51, 65, 85, 0.6);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-blue: #60a5fa;
    --accent-indigo: #818cf8;
    --accent-purple: #a78bfa;
    --brand-glow: rgba(59, 130, 246, 0.25);
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: background-color 0.25s ease, color 0.25s ease;
    overflow-x: hidden;
}

/* Glassmorphism Styles */
.glass-nav {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
}

.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px -10px var(--brand-glow);
    border-radius: 1rem;
    transition: all 0.2s ease;
}

.glass-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
}

/* Gradient Texts & Accents */
.text-gradient {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-gradient {
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
}

/* Pricing & CTA Action Buttons */
.btn-emerald {
    background-color: #059669 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px 0 rgba(5, 150, 105, 0.35);
}
.btn-emerald:hover {
    background-color: #10b981 !important;
    color: #ffffff !important;
    box-shadow: 0 6px 20px 0 rgba(5, 150, 105, 0.45);
}

.btn-purple-gradient {
    background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px 0 rgba(124, 58, 237, 0.35);
}
.btn-purple-gradient:hover {
    background: linear-gradient(135deg, #6d28d9 0%, #4338ca 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 6px 20px 0 rgba(124, 58, 237, 0.45);
}

/* SPA Top Progress Bar */
#spa-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899);
    z-index: 99999;
    transition: width 0.3s ease, opacity 0.3s ease;
    pointer-events: none;
}

/* Anchor Scroll Offset untuk Sticky Navbar */
section[id] {
    scroll-margin-top: 5.5rem;
}

/* ===================================================================
   Navigation Tree (Compact Tree Navigation for Docs)
   =================================================================== */
.nav-tree {
    user-select: none;
}

.tree-item {
    margin-bottom: 0.25rem;
}

.tree-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tree-header:hover {
    background: rgba(59, 130, 246, 0.08);
    color: var(--accent-blue);
}

.tree-header.active {
    background: rgba(59, 130, 246, 0.12);
    color: var(--accent-blue);
}

.tree-header .tree-icon {
    transition: transform 0.2s ease;
    width: 14px;
    height: 14px;
}

.tree-header.collapsed .tree-icon {
    transform: rotate(-90deg);
}

.tree-children {
    padding-left: 1.25rem;
    margin-top: 0.25rem;
    border-left: 1.5px dashed var(--border-color);
    margin-left: 0.75rem;
    transition: max-height 0.25s ease, opacity 0.2s ease;
    overflow: hidden;
}

.tree-children.collapsed {
    display: none;
}

.tree-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.625rem;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.15s ease;
}

.tree-link:hover {
    color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.06);
    transform: translateX(3px);
}

.tree-link.active {
    color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.12);
    font-weight: 600;
}

.method-badge {
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.method-get { background: rgba(34, 197, 94, 0.15); color: #22c55e; border: 1px solid rgba(34, 197, 94, 0.3); }
.method-post { background: rgba(59, 130, 246, 0.15); color: #3b82f6; border: 1px solid rgba(59, 130, 246, 0.3); }
.method-put { background: rgba(234, 179, 8, 0.15); color: #eab308; border: 1px solid rgba(234, 179, 8, 0.3); }
.method-delete { background: rgba(239, 68, 68, 0.15); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.3); }

/* ===================================================================
   Custom Toast Notifications (Replacing Native Alerts)
   =================================================================== */
#toast-container {
    position: fixed;
    bottom: 5.25rem;
    right: 1.5rem;
    z-index: 100000;
    display: flex;
    flex-direction: column-reverse;
    gap: 0.75rem;
    max-width: 420px;
    width: calc(100% - 3rem);
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border-radius: 0.75rem;
    padding: 0.875rem 1.125rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    backdrop-filter: blur(16px);
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    overflow: hidden;
    position: relative;
}

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

.toast.hide {
    transform: translateX(120%);
    opacity: 0;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    transform-origin: left;
    transition: width linear;
}

.toast-success .toast-progress { background: #22c55e; }
.toast-error .toast-progress { background: #ef4444; }
.toast-warning .toast-progress { background: #f59e0b; }
.toast-info .toast-progress { background: #3b82f6; }

/* ===================================================================
   Custom Modal Dialogs (Replacing Native Prompt & Confirm)
   =================================================================== */
#modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 99990;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

#modal-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

#modal-box {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    max-width: 520px;
    width: 100%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    transform: scale(0.95);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

#modal-backdrop.open #modal-box {
    transform: scale(1);
}

/* Animations & Transitions */
.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.5);
}

