/* ===== CSS Variables ===== */
:root {
    /* Primary Colors - Purple Theme */
    --primary: #a855f7;
    --primary-light: #c084fc;
    --primary-dark: #7c3aed;
    
    /* Background Colors */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(20, 20, 30, 0.6);
    --bg-card-hover: rgba(30, 30, 45, 0.8);
    
    /* Text Colors */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Border Colors */
    --border: rgba(148, 163, 184, 0.1);
    --border-hover: rgba(168, 85, 247, 0.3);
    
    /* Effects */
    --glow: rgba(168, 85, 247, 0.15);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    
    /* Spacing */
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== Background Effects ===== */
.bg-effects {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.bg-gradient {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at top, rgba(168, 85, 247, 0.1) 0%, transparent 50%),
                radial-gradient(ellipse at bottom right, rgba(124, 58, 237, 0.08) 0%, transparent 50%);
}

.bg-grid {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(148, 163, 184, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
}

.bg-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    animation: float 20s ease-in-out infinite;
}

.bg-glow-1 {
    width: 600px;
    height: 600px;
    background: rgba(168, 85, 247, 0.15);
    top: -200px;
    right: -200px;
}

.bg-glow-2 {
    width: 400px;
    height: 400px;
    background: rgba(124, 58, 237, 0.1);
    bottom: -100px;
    left: -100px;
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, 20px) scale(1.1); }
}

/* ===== Container ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    position: relative;
    z-index: 1;
}

/* ===== Header ===== */
.header {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 30px var(--glow);
}

.logo-icon svg {
    width: 28px;
    height: 28px;
    color: white;
}

.logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: calc(var(--radius) - 4px);
}

.logo-text h1 {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-text p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ===== Search ===== */
.search-container {
    position: relative;
    max-width: 400px;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    pointer-events: none;
}

#searchInput {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-family: inherit;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

#searchInput::placeholder {
    color: var(--text-muted);
}

#searchInput:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--glow);
}

.search-shortcut {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    padding: 0.25rem 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    pointer-events: none;
}

/* ===== Tabs ===== */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 0.25rem;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
}

.tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.25rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9375rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab:hover {
    color: var(--text-primary);
    background: rgba(148, 163, 184, 0.05);
}

.tab.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 15px var(--glow);
}

.tab svg {
    flex-shrink: 0;
}

.tab-count {
    padding: 0.125rem 0.5rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.tab:not(.active) .tab-count {
    background: var(--bg-secondary);
}

/* ===== Filter ===== */
.filter-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.filter-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.filter-btn:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* ===== Commands Grid ===== */
.commands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1rem;
}

/* ===== Command Card ===== */
.command-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.command-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--card-color, var(--primary));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.command-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 40px -10px rgba(168, 85, 247, 0.2);
}

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

.command-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.command-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.command-name code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-secondary);
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.command-category {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    background: var(--card-color, var(--primary));
    color: white;
    white-space: nowrap;
    opacity: 0.9;
}

.command-description {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.command-details {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.command-detail {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.detail-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    min-width: 60px;
    padding-top: 0.25rem;
}

.detail-value {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-value code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8125rem;
    color: var(--primary-light);
    background: rgba(168, 85, 247, 0.1);
    padding: 0.375rem 0.625rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(168, 85, 247, 0.2);
    word-break: break-all;
}

.copy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.copy-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(168, 85, 247, 0.1);
}

.copy-btn svg {
    width: 14px;
    height: 14px;
}

/* ===== No Results ===== */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.no-results svg {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-results h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

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

/* ===== Toast ===== */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast svg {
    width: 18px;
    height: 18px;
    color: #22c55e;
}

/* ===== Responsive ===== */
@media (min-width: 768px) {
    .header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    
    .search-container {
        width: 320px;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 1rem;
    }
    
    .commands-grid {
        grid-template-columns: 1fr;
    }
    
    .tab {
        padding: 0.75rem;
        font-size: 0.875rem;
    }
    
    .tab span:not(.tab-count) {
        display: none;
    }
    
    .search-shortcut {
        display: none;
    }
    
    .logo-text h1 {
        font-size: 1.5rem;
    }
}
