/**
 * OCEWeb Commands - Modern Dark Glassmorphism Stylesheet
 * Copyright (C) 2007-2026 Renato Brunetti - OCEWeb
 */

:root {
    --bg-main: #060911;
    --bg-surface: #0f172a;
    --bg-surface-elevated: #1e293b;
    --bg-surface-glass: rgba(15, 23, 42, 0.75);
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-focus: #38bdf8;
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent-cyan: #38bdf8;
    --accent-indigo: #6366f1;
    --accent-purple: #a855f7;
    --accent-green: #10b981;
    --accent-amber: #f59e0b;
    --accent-rose: #f43f5e;
    
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, Monaco, monospace;
}

/* Base Reset & Styling */
body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-heading);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    letter-spacing: -0.01em;
}

main {
    flex: 1 0 auto;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* Typography & Utilities */
.font-monospace, code, kbd, pre {
    font-family: var(--font-mono) !important;
}

.text-gradient {
    background: linear-gradient(135deg, #38bdf8 0%, #818cf8 50%, #c084fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-gradient-cyan {
    background: linear-gradient(135deg, #38bdf8 0%, #22d3ee 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.4));
}

.stars-pill {
    font-size: 0.75rem;
    padding: 2px 8px;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 12px;
    letter-spacing: 2px;
}

/* Navbar */
.glass-nav {
    background: var(--bg-surface-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-glass);
    z-index: 1030;
    transition: all 0.2s ease;
}

.glass-nav .nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.5rem 0.85rem;
    border-radius: 8px;
    transition: all 0.15s ease;
}

.glass-nav .nav-link:hover,
.glass-nav .nav-link.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.glass-nav .nav-link.active {
    color: var(--accent-cyan);
    font-weight: 600;
}

/* Buttons */
.btn-glass {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    backdrop-filter: blur(8px);
    transition: all 0.2s ease;
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    transform: translateY(-1px);
}

.btn-glass-search {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    border-radius: 8px;
    padding: 0.35rem 0.75rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.btn-glass-search:hover {
    border-color: var(--accent-cyan);
    color: var(--text-primary);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

.shortcut-badge {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-cyan);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.75rem;
    margin-left: 6px;
}

/* Hero Section */
.hero-section {
    position: relative;
    padding: 4.5rem 0 3.5rem;
    background: radial-gradient(circle at 50% -20%, rgba(56, 189, 248, 0.15), transparent 70%),
                radial-gradient(circle at 80% 20%, rgba(99, 102, 241, 0.1), transparent 60%);
    border-bottom: 1px solid var(--border-glass);
}

.hero-search-wrapper {
    position: relative;
    max-width: 760px;
    margin: 0 auto;
}

.hero-search-input {
    background: rgba(15, 23, 42, 0.9);
    border: 2px solid rgba(56, 189, 248, 0.3);
    color: #ffffff;
    font-size: 1.15rem;
    padding: 0.95rem 1.25rem 0.95rem 3.25rem;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 20px rgba(56, 189, 248, 0.1);
    transition: all 0.25s ease;
}

.hero-search-input:focus {
    background: #0f172a;
    border-color: var(--accent-cyan);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 25px rgba(56, 189, 248, 0.3);
    outline: none;
    color: #ffffff;
}

.hero-search-icon {
    position: absolute;
    left: 1.15rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.35rem;
    color: var(--accent-cyan);
    pointer-events: none;
}

.hero-search-kbd {
    position: absolute;
    right: 1.15rem;
    top: 50%;
    transform: translateY(-50%);
}

/* Live Search Suggestions Dropdown */
.search-results-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #0f172a;
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
    z-index: 1050;
    max-height: 480px;
    overflow-y: auto;
    display: none;
}

.search-result-item {
    display: block;
    padding: 0.85rem 1.15rem;
    border-bottom: 1px solid var(--border-glass);
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.15s ease;
}

.search-result-item:hover,
.search-result-item.active {
    background: rgba(56, 189, 248, 0.1);
}

.search-result-item:last-child {
    border-bottom: none;
}

/* Category Cards */
.category-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 1.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
    color: inherit;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--cat-gradient, linear-gradient(90deg, #38bdf8, #6366f1));
    opacity: 0.8;
    transition: height 0.2s ease;
}

.category-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(56, 189, 248, 0.1);
    color: inherit;
}

.category-card:hover::before {
    height: 5px;
}

.category-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--cat-color, #38bdf8);
    margin-bottom: 1rem;
    transition: transform 0.2s ease;
}

.category-card:hover .category-icon-box {
    transform: scale(1.08);
}

/* Command Cards */
.command-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    border-radius: 14px;
    padding: 1.25rem;
    transition: all 0.2s ease;
    position: relative;
}

.command-card:hover {
    border-color: rgba(56, 189, 248, 0.3);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
}

.command-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.command-card-title a {
    color: #ffffff;
    text-decoration: none;
    transition: color 0.15s ease;
}

.command-card-title a:hover {
    color: var(--accent-cyan);
}

/* Terminal & Syntax Blocks */
.terminal-block {
    background: #020617;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    margin: 1rem 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.terminal-header {
    background: #090d16;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.terminal-dots {
    display: flex;
    gap: 6px;
}

.terminal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.terminal-dot.red { background: #ef4444; }
.terminal-dot.yellow { background: #eab308; }
.terminal-dot.green { background: #22c55e; }

.terminal-title {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.terminal-body {
    padding: 1rem 1.25rem;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    line-height: 1.6;
    color: #e2e8f0;
    overflow-x: auto;
    position: relative;
}

.terminal-prompt {
    color: var(--accent-cyan);
    margin-right: 0.6rem;
    user-select: none;
    font-weight: 700;
}

/* Syntax Highlighting */
.syntax-opt {
    color: #93c5fd;
}
.syntax-arg {
    color: #fca5a5;
    font-style: italic;
}
.syntax-flag {
    color: #34d399;
    font-weight: 600;
}

/* Badges */
.badge-difficulty {
    font-size: 0.72rem;
    padding: 4px 8px;
    font-weight: 600;
    border-radius: 6px;
}

.badge-diff-beginner {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-diff-intermediate {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-diff-advanced {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-os {
    font-size: 0.72rem;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
}

.badge-os-all {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    border-color: rgba(99, 102, 241, 0.3);
}

.badge-dangerous {
    background: rgba(239, 68, 68, 0.2);
    color: #ff6b6b;
    border: 1px solid rgba(239, 68, 68, 0.5);
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 700;
    animation: pulseDanger 2s infinite;
}

@keyframes pulseDanger {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

/* Param Table */
.param-flag-code {
    background: rgba(56, 189, 248, 0.12);
    color: var(--accent-cyan);
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid rgba(56, 189, 248, 0.25);
    font-weight: 600;
    font-size: 0.88rem;
}

.table-params {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-primary);
    --bs-table-border-color: var(--border-glass);
}

.table-params th {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-glass);
}

/* Copy Buttons */
.btn-copy {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-copy:hover {
    background: var(--accent-cyan);
    color: #020617;
    border-color: var(--accent-cyan);
}

.btn-copy.copied {
    background: var(--accent-green);
    color: #020617;
    border-color: var(--accent-green);
}

/* Favorite Button */
.btn-fav {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-muted);
    border-radius: 8px;
    padding: 0.35rem 0.65rem;
    transition: all 0.2s ease;
}

.btn-fav:hover {
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.4);
    background: rgba(245, 158, 11, 0.1);
}

.btn-fav.active {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.15);
    border-color: #f59e0b;
}

/* Interactive Builders */
.builder-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.builder-output {
    background: #020617;
    border: 2px solid rgba(56, 189, 248, 0.4);
    border-radius: 12px;
    padding: 1.25rem;
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: #38bdf8;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

/* Custom Modals */
.glass-modal {
    background: #0f172a !important;
    border: 1px solid var(--border-glass);
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

.form-control-glass {
    background: rgba(2, 6, 23, 0.8);
    border: 1px solid var(--border-glass);
    color: #ffffff;
    border-radius: 8px;
}

.form-control-glass:focus {
    background: #020617;
    border-color: var(--accent-cyan);
    color: #ffffff;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
}

/* Custom Toast */
.custom-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #1e293b;
    border: 1px solid var(--accent-cyan);
    color: #ffffff;
    padding: 0.85rem 1.25rem;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    z-index: 9999;
    font-size: 0.9rem;
    display: none;
    align-items: center;
    gap: 8px;
    animation: toastSlideIn 0.25s ease-out;
}

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

/* Breadcrumbs */
.custom-breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
}
.custom-breadcrumb .breadcrumb-item a {
    color: var(--text-secondary);
    text-decoration: none;
}
.custom-breadcrumb .breadcrumb-item a:hover {
    color: var(--accent-cyan);
}
.custom-breadcrumb .breadcrumb-item.active {
    color: var(--text-muted);
}
.custom-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    color: var(--text-muted);
}

/* Footer */
.site-footer {
    background: #030712;
    border-top: 1px solid var(--border-glass);
    padding: 3.5rem 0 1.5rem;
    margin-top: 5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section {
        padding: 3rem 0 2rem;
    }
    .hero-search-input {
        font-size: 1rem;
        padding-left: 2.75rem;
    }
    .hero-search-icon {
        font-size: 1.1rem;
        left: 0.85rem;
    }
}
