/* --- Self-hosted Inter font family ---
 * Loaded locally so we don't depend on fonts.googleapis.com, which under certain
 * User-Agents returned relative woff2 URLs that resolved against this origin and
 * produced repeated 404s for /assets/fonts/Inter-*.woff2.
 */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/assets/fonts/Inter-Regular.woff2') format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/assets/fonts/Inter-Medium.woff2') format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('/assets/fonts/Inter-SemiBold.woff2') format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/assets/fonts/Inter-Bold.woff2') format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url('/assets/fonts/Inter-ExtraBold.woff2') format('woff2');
}

:root {
    --bg-base: #0e0e12;
    --bg-surface: #141419;
    --bg-surface-glass: rgba(20, 20, 25, 0.6);
    --border-color: rgba(255, 255, 255, 0.06);
    --border-glow: rgba(0, 229, 255, 0.3);

    --text-main: #ffffff;
    --text-muted: #a3a6aa;

    --accent-cyan: #00e5ff;
    --accent-purple: #9d00ff;
    --accent-blue: #5865F2;
    --accent-red: #ff3b30;
    --accent-green: #2ed573;
    --accent-yellow: #ffa502;

    --font-primary: 'Inter', sans-serif;

    --warning-color: #daa520;
    --bg-input: rgba(255, 255, 255, 0.03);
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-base);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* --- AMBIENT GLOW BACKGROUND --- */
.ambient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
}

#particle-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.ambient-sphere {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.4;
    animation: float 20s infinite alternate ease-in-out;
    z-index: 2;
}

.sphere-cyan {
    top: -10%;
    left: 10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-cyan) 0%, transparent 70%);
}

.sphere-purple {
    top: 30%;
    right: -10%;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, var(--accent-purple) 0%, transparent 70%);
    animation-delay: -5s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(50px, 80px) scale(1.1);
    }
}

/* --- GLASS HEADER --- */
.glass-header {
    position: sticky;
    top: 0;
    width: 100%;
    background: rgba(14, 14, 18, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    text-decoration: none;
}

.logo-icon {
    color: var(--accent-cyan);
    text-shadow: 0 0 15px rgba(0, 229, 255, 0.5);
}

.logo-text {
    font-size: 20px;
    font-weight: bold;
    color: #ffffff;
}

.nav-links .nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-links .nav-link:hover {
    color: #fff;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(0, 229, 255, 0.2);
}

/* Wrapper & Layout */
.dashboard-wrapper {
    padding: 40px 20px;
    display: flex;
    justify-content: center;
}

.dashboard-container {
    width: 100%;
    max-width: 1000px;
}

.dashboard-header {
    text-align: left;
    margin-bottom: 30px;
}

.dashboard-header h2 {
    color: #ffffff;
    margin: 0 0 5px 0;
    font-size: 28px;
}

.subtitle {
    color: var(--text-muted);
    margin: 0;
}

.settings-card.glass-panel {
    background: var(--bg-surface-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 25px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

/* Suchbox & Filters */
.search-filter-card {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 15px;
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    padding: 12px 12px 12px 40px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: #ffffff;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    border-radius: 20px;
    padding: 8px 16px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
    background: rgba(0, 229, 255, 0.1);
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.2);
}

/* Kategorien-Unterteilung */
.command-category-section {
    margin-bottom: 35px;
    animation: fadeIn 0.3s ease;
}

.category-heading {
    font-size: 18px;
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

/* Befehls-Karten (Cards) */
.command-card {
    background: var(--bg-surface-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--border-color);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.command-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.06), transparent 50%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.command-card:hover {
    transform: translateY(-4px) scale(1.01);
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(30, 30, 35, 0.8);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

.command-card:hover::before {
    opacity: 1;
}

.command-card.slash-cmd {
    border-left-color: var(--accent-cyan);
}

.command-card.prefix-cmd {
    border-left-color: var(--accent-blue);
}

.command-card.interaction-only {
    border-left-color: var(--warning-color);
}

.command-card.auto-system {
    border-left-color: var(--success-color);
}

.command-header-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

/* Badges */
.cmd-badge {
    font-size: 10px;
    font-weight: 800;
    padding: 3px 6px;
    border-radius: 3px;
    color: white;
}

.cmd-badge.slash {
    background: var(--accent-cyan);
    color: #000;
}

.cmd-badge.prefix {
    background: var(--accent-blue);
}

.cmd-badge.UI {
    background: var(--warning-color);
}

.cmd-badge.auto {
    background: var(--success-color);
}

.cmd-name {
    font-family: 'Consolas', 'Courier New', Courier, monospace;
    font-size: 15px;
    font-weight: bold;
    color: #fff;
    background: var(--bg-input);
    padding: 4px 8px;
    border-radius: 4px;
}

.cmd-param {
    color: var(--text-muted);
    font-weight: normal;
}

.perm-badge {
    font-size: 11px;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: auto;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

.perm-badge.admin {
    background: rgba(218, 55, 60, 0.15);
    color: #ff3333;
}

.perm-badge.manager {
    background: rgba(254, 231, 92, 0.1);
    color: var(--warning-color);
}

.perm-badge.team {
    background: rgba(88, 101, 242, 0.15);
    color: #5865f2;
}

.perm-badge.system {
    background: rgba(35, 165, 90, 0.15);
    color: var(--success-color);
}

.cmd-desc {
    margin: 0;
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- SCROLL ANIMATIONS --- */
[data-animate="fade-up"] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

[data-animate="fade-up"].is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 768px) {
    .perm-badge {
        margin-left: 0;
        width: max-content;
    }

    body {
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    .glass-header,
    .container {
        padding-left: 14px;
        padding-right: 14px;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .view-toggles,
    .filter-buttons {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .view-toggles button,
    .filter-btn,
    .filter-buttons button {
        min-height: 44px;
        padding: 10px 14px;
        font-size: 0.85rem;
    }

    .search-box input,
    .command-search,
    input[type="search"],
    input[type="text"] {
        min-height: 44px;
        font-size: 16px !important; /* iOS zoom guard */
        width: 100%;
        box-sizing: border-box;
    }

    .command-card {
        padding: 14px 12px;
    }

    .command-header-row {
        flex-wrap: wrap;
        gap: 8px;
    }

    .dashboard-container.grid-view .command-category-section {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }

    /* Perf: drop heavy glass blur on phones */
    .command-card,
    .glass-header,
    .glass-card {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    #particle-canvas,
    .ambient-sphere {
        display: none !important;
    }

    .ambient-bg {
        width: 100%;
        height: 100%;
    }
}

@media (max-width: 480px) {
    .command-card {
        padding: 12px 10px;
    }

    .command-card h3 {
        font-size: 0.95rem;
    }
}

.antilink {
    text-decoration: none !important;
    /* Unterstreichung weg */
    color: inherit !important;
    /* Farbe beibehalten */
}

/* --- GRID VIEW TOGGLE --- */
.dashboard-container.grid-view .command-category-section {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 16px;
    align-items: stretch;
}

.dashboard-container.grid-view .category-heading {
    grid-column: 1 / -1;
    margin-bottom: 8px;
}

.dashboard-container.grid-view .command-card {
    margin-bottom: 0;
    height: auto;
}