:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --dark-bg: #0d0d0d;
    --card-bg: #1a1a2e;
    --card-hover: #16213e;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #6b7280;
    --border-radius: 16px;
    --link-color: #667eea;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --code-text: #c9d1d9;
}

* {
    box-sizing: border-box;
}

html {
    background: var(--dark-bg);
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-primary);
    background:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(102, 78, 168, 0.18) 0%, transparent 70%),
        radial-gradient(ellipse 60% 40% at 80% 80%, rgba(79, 100, 220, 0.08) 0%, transparent 60%),
        var(--dark-bg);
}

/* ===== Animations ===== */
@keyframes driftBg {
    0%, 100% { transform: scale(1) translate(0, 0); }
    33%       { transform: scale(1.08) translate(2%, -2%); }
    66%       { transform: scale(0.96) translate(-2%, 2%); }
}

/* ===== Page Loading Indicator ===== */
#page-loading-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary-gradient);
    transform: scaleX(0);
    transform-origin: left;
    z-index: 9999;
    opacity: 0;
}

#page-loading-indicator.htmx-request {
    opacity: 1;
    animation: loading-bar 1s ease forwards;
}

@keyframes loading-bar {
    0%   { transform: scaleX(0); }
    70%  { transform: scaleX(0.85); }
    100% { transform: scaleX(1); }
}

/* ===== Navigation ===== */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 40px;
    background: rgba(13, 13, 13, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.15rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
}

.nav-logo img {
    border-radius: 6px;
    -webkit-text-fill-color: initial;
}

.nav-links {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 32px;
}

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

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

/* ===== Hero Section ===== */
.hero-section {
    position: relative;
    min-height: 72vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px 60px;
    overflow: hidden;
    text-align: center;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 260px;
    background: linear-gradient(to bottom, transparent 0%, var(--dark-bg) 75%);
    z-index: 0;
    pointer-events: none;
}

.hero-section::before {
    content: '';
    position: absolute;
    inset: -40%;
    background:
        radial-gradient(circle at 35% 55%, rgba(102, 126, 234, 0.2) 0%, transparent 45%),
        radial-gradient(circle at 68% 35%, rgba(118, 75, 162, 0.18) 0%, transparent 40%);
    animation: driftBg 18s ease-in-out infinite;
    z-index: 0;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 820px;
}

.hero-badge {
    display: inline-block;
    padding: 7px 18px;
    background: rgba(102, 126, 234, 0.15);
    border: 1px solid rgba(102, 126, 234, 0.35);
    border-radius: 50px;
    color: #8ea4f0;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 28px;
}

.hero-title {
    font-size: clamp(2.4rem, 5.5vw, 3.8rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin: 0 0 24px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: var(--text-secondary);
    line-height: 1.75;
    max-width: 600px;
    margin: 0 auto 44px;
}

.hero-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== Main Content Area ===== */
.main-container {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 24px 100px;
}

.main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 36px;
    align-items: start;
}

.grid-section-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.grid-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.07);
}

/* ===== Form Styles ===== */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 8px;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-muted);
}

.form-input:focus,
.form-textarea:focus {
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: rgba(255, 255, 255, 0.06);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

.form-textarea.code-input {
    font-family: 'Fira Code', 'Courier New', monospace;
    min-height: 180px;
    font-size: 0.875rem;
}

/* ===== Code Block ===== */
.code-block {
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 20px 24px;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.875rem;
    color: var(--code-text);
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.7;
}

/* ===== Command Cards ===== */
.commands-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.command-card-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--card-bg);
    border-radius: 14px;
    padding: 18px 22px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    text-decoration: none;
    transition: all 0.25s ease;
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
}

.command-card-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-gradient);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.command-card-link:hover {
    background: var(--card-hover);
    border-color: rgba(102, 126, 234, 0.25);
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    text-decoration: none;
    color: var(--text-primary);
}

.command-card-link:hover::before {
    transform: scaleX(1);
}

.command-card-title {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.975rem;
    margin: 0 0 4px;
}

.command-card-meta {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-family: 'Fira Code', monospace;
    margin: 0;
}

.command-card-arrow {
    color: var(--text-muted);
    font-size: 1.1rem;
    transition: transform 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
    margin-left: 16px;
}

.command-card-link:hover .command-card-arrow {
    transform: translateX(4px);
    color: var(--link-color);
}

/* ===== Section Title (legacy) ===== */
.section-title {
    color: var(--text-primary);
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0 0 20px;
}

/* ===== Command Detail ===== */
.detail-label {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 10px;
}

.detail-section {
    margin-bottom: 32px;
}

.detail-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.content-card .command-description {
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 20px 24px;
    color: var(--code-text);
    font-size: 0.9rem;
    line-height: 1.7;
    margin: 0;
    word-break: break-word;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
    background: var(--card-bg);
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* ===== Page Container (used by detail page) ===== */
.page-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 20px 80px;
}

.page-header {
    text-align: center;
    margin-bottom: 50px;
}

.page-title {
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ===== Content Card ===== */
.content-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 40px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.content-card p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 20px;
}

.content-card h3 {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 40px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.content-card h3:first-of-type {
    margin-top: 20px;
}

.content-card ul,
.content-card ol {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 20px;
    padding-left: 24px;
}

.content-card li {
    margin-bottom: 12px;
}

.content-card ol ol {
    margin-top: 12px;
    list-style-type: lower-alpha;
}

.content-card a {
    color: var(--link-color);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.content-card a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.content-card em {
    color: var(--text-primary);
    font-style: italic;
}

.intro-text {
    font-size: 1.05rem;
    color: var(--text-primary);
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.third-party-box {
    background: rgba(102, 126, 234, 0.08);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.third-party-box p {
    color: var(--text-primary);
    margin-bottom: 12px;
    font-weight: 500;
}

.third-party-box ul {
    margin-bottom: 0;
}

.btn-primary {
    display: inline-block;
    padding: 14px 28px;
    background: var(--primary-gradient);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
    color: white;
    text-decoration: none;
}

.btn-secondary {
    display: inline-block;
    padding: 14px 28px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-secondary:hover {
    border-color: rgba(102, 126, 234, 0.5);
    background: rgba(102, 126, 234, 0.08);
    color: var(--text-primary);
    text-decoration: none;
}

/* ===== Tool Buttons ===== */
.tool-btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    background: var(--primary-gradient);
    color: white;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tool-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.tool-btn-secondary {
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tool-btn-secondary:hover {
    border-color: rgba(102, 126, 234, 0.5);
    color: var(--text-primary);
}

/* ===== Tool Toast ===== */
.tool-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 24px;
    background: var(--card-bg);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.tool-toast.show {
    opacity: 1;
}

/* ===== Tool Disclaimer Footer ===== */
.tool-disclaimer {
    margin-top: 32px;
    padding: 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ===== Footer ===== */
.site-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: 40px;
}

.footer-inner {
    max-width: 1160px;
    margin: 0 auto;
    padding: 40px 24px 32px;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 40px;
    align-items: start;
}

.footer-logo {
    font-size: 1rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
    margin-bottom: 8px;
}

.footer-tagline {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 0;
    line-height: 1.6;
}

.footer-tagline a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-tagline a:hover {
    color: var(--text-primary);
}

.footer-disclaimer {
    background: rgba(245, 158, 11, 0.06);
    border: 1px solid rgba(245, 158, 11, 0.18);
    border-radius: 10px;
    padding: 14px 18px;
}

.footer-disclaimer p {
    color: var(--text-muted);
    font-size: 0.83rem;
    line-height: 1.65;
    margin: 0;
}

.footer-disclaimer strong {
    color: #d4a017;
    font-weight: 600;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
    padding: 16px 24px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.footer-bottom a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-bottom a:hover {
    color: var(--text-secondary);
}

@media (max-width: 640px) {
    .footer-inner {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

/* ===== Legacy Card Styles ===== */
.commandCard {
    display: flex;
    flex-direction: row;
    background-color: var(--card-bg);
    border-radius: 15px;
    padding: 4px 16px;
    transition: 0.1s all ease;
    color: white;
    text-decoration: none;
    margin-bottom: 16px;
}

.commandDetails {
    display: flex;
    flex-direction: column;
}

.commandControls {
    display: flex;
    flex-direction: row;
    font-size: 50px;
}

.commandCard:hover {
    background-color: var(--card-hover);
    color: white;
    text-decoration: none;
}

.commandTitle {
    color: whitesmoke;
}

.commandDesc {
    color: var(--text-secondary);
}

.commandIconAlign {
    align-content: center;
    display: flex;
    flex-direction: row;
    margin-left: 12px;
}

.botCard {
    display: flex;
    flex-direction: column;
    background-color: var(--card-bg);
    border-radius: 15px;
    padding: 2px 16px;
    transition: 0.1s all ease;
    color: white;
    text-decoration: none;
    margin-bottom: 16px;
}

.botCard:hover {
    background-color: var(--card-hover);
    color: white;
    text-decoration: none;
}

.mailChip {
    word-break: break-all;
    text-wrap: wrap;
}

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

@media (max-width: 768px) {
    .navbar {
        padding: 14px 20px;
    }

    .nav-links {
        display: none;
    }

    .hero-section {
        min-height: auto;
        padding: 60px 20px 40px;
    }

    .content-card {
        padding: 24px;
    }

    .page-container {
        padding: 20px 16px 60px;
    }

    .tool-btn {
        min-height: 44px;
    }
}