/* ============================================
   OpenClaw.ai.vn — Utilities CSS
   Supplementary utility classes
   ============================================ */

/* --- Spacing --- */
.mt-0 {
    margin-top: 0;
}

.mt-1 {
    margin-top: 8px;
}

.mt-2 {
    margin-top: 16px;
}

.mt-3 {
    margin-top: 24px;
}

.mt-4 {
    margin-top: 32px;
}

.mt-5 {
    margin-top: 48px;
}

.mt-6 {
    margin-top: 64px;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-1 {
    margin-bottom: 8px;
}

.mb-2 {
    margin-bottom: 16px;
}

.mb-3 {
    margin-bottom: 24px;
}

.mb-4 {
    margin-bottom: 32px;
}

.mb-5 {
    margin-bottom: 48px;
}

/* --- Flex --- */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

.items-center {
    align-items: center;
}

.items-start {
    align-items: flex-start;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-end {
    justify-content: flex-end;
}

.gap-1 {
    gap: 8px;
}

.gap-2 {
    gap: 16px;
}

.gap-3 {
    gap: 24px;
}

.gap-4 {
    gap: 32px;
}

/* --- Text --- */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.text-sm {
    font-size: 0.875rem;
}

.text-xs {
    font-size: 0.75rem;
}

.text-lg {
    font-size: 1.125rem;
}

.text-xl {
    font-size: 1.25rem;
}

.font-bold {
    font-weight: 700;
}

.font-semibold {
    font-weight: 600;
}

.font-medium {
    font-weight: 500;
}

.uppercase {
    text-transform: uppercase;
}

.tracking-wide {
    letter-spacing: 0.5px;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Display --- */
.hidden {
    display: none;
}

.block {
    display: block;
}

.inline-block {
    display: inline-block;
}

.inline-flex {
    display: inline-flex;
}

/* --- Width --- */
.w-full {
    width: 100%;
}

.max-w-sm {
    max-width: 480px;
}

.max-w-md {
    max-width: 640px;
}

.max-w-lg {
    max-width: 768px;
}

/* --- Position --- */
.relative {
    position: relative;
}

.absolute {
    position: absolute;
}

.sticky {
    position: sticky;
}

/* --- Overflow --- */
.overflow-hidden {
    overflow: hidden;
}

.overflow-x-auto {
    overflow-x: auto;
}

/* --- Border --- */
.border {
    border: 1px solid var(--border-color);
}

.border-b {
    border-bottom: 1px solid var(--border-color);
}

.border-t {
    border-top: 1px solid var(--border-color);
}

.rounded-lg {
    border-radius: 12px;
}

.rounded-full {
    border-radius: 9999px;
}

/* --- Transitions --- */
.transition {
    transition: all 0.2s ease;
}

.transition-slow {
    transition: all 0.4s ease;
}

/* --- Visibility --- */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .hide-desktop {
        display: none !important;
    }
}

/* --- Prose (Article Content) --- */
.prose {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-primary);
}

.prose h2 {
    margin-top: 48px;
    margin-bottom: 16px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.prose h2:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.prose h3 {
    margin-top: 32px;
    margin-bottom: 12px;
}

.prose p {
    margin-bottom: 20px;
}

.prose ul,
.prose ol {
    margin-bottom: 20px;
    padding-left: 24px;
}

.prose li {
    margin-bottom: 8px;
}

.prose blockquote {
    border-left: 4px solid var(--color-accent);
    padding: 16px 20px;
    margin: 24px 0;
    background: var(--bg-surface);
    border-radius: 0 10px 10px 0;
    color: var(--text-secondary);
    font-style: italic;
}

.prose img {
    border-radius: 12px;
    margin: 24px 0;
    border: 1px solid var(--border-color);
}

.prose a {
    color: var(--color-accent);
    font-weight: 500;
}

.prose a:hover {
    text-decoration: underline;
}

.prose pre {
    margin: 24px 0;
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
}

.prose th,
.prose td {
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    text-align: left;
}

.prose th {
    background: var(--bg-surface);
    font-weight: 600;
    font-size: 0.9rem;
}

/* --- Article Layout --- */
.article-layout {
    display: grid;
    grid-template-columns: 1fr 240px;
    gap: 48px;
    align-items: start;
}

@media (max-width: 1024px) {
    .article-layout {
        grid-template-columns: 1fr;
    }

    .article-layout .toc {
        position: static;
        display: none;
    }
}

/* --- Sidebar (News) --- */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.sidebar-widget {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 24px;
}

.sidebar-widget h4 {
    font-size: 0.95rem;
    margin-bottom: 16px;
}

/* --- Terminal Animation --- */
.terminal {
    background: #0d1117;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    max-width: 600px;
}

.terminal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #161b22;
}

.terminal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.terminal-dot.red {
    background: #ff5f57;
}

.terminal-dot.yellow {
    background: #febc2e;
}

.terminal-dot.green {
    background: #28c840;
}

.terminal-body {
    padding: 20px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: #c9d1d9;
    line-height: 1.8;
}

.terminal-body .prompt {
    color: #58a6ff;
}

.terminal-body .command {
    color: #f0f6fc;
}

.terminal-body .output {
    color: #8b949e;
}

.terminal-body .success {
    color: #3fb950;
}

.terminal-cursor {
    display: inline-block;
    width: 8px;
    height: 16px;
    background: #58a6ff;
    animation: blink 1s infinite;
    vertical-align: middle;
    margin-left: 4px;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* --- Architecture Diagram --- */
.arch-diagram {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    padding: 40px 20px;
}

.arch-box {
    padding: 20px 24px;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    text-align: center;
    min-width: 140px;
    transition: all 0.2s;
}

.arch-box:hover {
    border-color: var(--color-accent);
    transform: translateY(-2px);
}

.arch-arrow {
    font-size: 1.5rem;
    color: var(--color-accent);
}

/* --- Social Auth Buttons --- */
.social-auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
}

.social-auth-btn:hover {
    border-color: var(--border-hover);
    background: var(--bg-surface);
    color: var(--text-primary);
}

.social-auth-btn i {
    font-size: 1.1rem;
}

/* --- Divider --- */
.divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

/* --- Dashboard Stats --- */
.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 24px;
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
}

.stat-card-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.stat-card-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 8px;
}

.stat-card-change.up {
    color: var(--color-success);
}

.stat-card-change.down {
    color: var(--color-error);
}

/* --- API Key Table --- */
.api-key-masked {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}

/* --- Usage Bar --- */
.usage-bar-bg {
    width: 100%;
    height: 8px;
    background: var(--bg-surface);
    border-radius: 4px;
    overflow: hidden;
}

.usage-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--color-accent), var(--color-secondary));
    transition: width 0.5s ease;
}

/* --- Dashboard Sidebar Nav --- */
.dash-nav {
    list-style: none;
}

.dash-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border-radius: 8px;
    transition: all 0.15s;
    margin-bottom: 2px;
}

.dash-nav-link:hover {
    background: var(--bg-surface);
    color: var(--color-accent);
}

.dash-nav-link.active {
    background: rgba(255, 107, 53, 0.1);
    color: var(--color-accent);
    font-weight: 600;
}

.dash-nav-link i {
    width: 20px;
    text-align: center;
}