* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #64748b;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-color: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --code-bg: #1e293b;
    --code-text: #e2e8f0;
    --accent-green: #10b981;
    --accent-orange: #f59e0b;
    --accent-purple: #8b5cf6;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
header {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-purple));
    border-radius: 16px;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Search Section */
.search-section {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-bottom: 25px;
}

.search-box {
    position: relative;
    margin-bottom: 20px;
}

.search-box input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    font-size: 1.1rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.3rem;
    color: var(--text-muted);
}

.filter-section {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-section label {
    font-weight: 600;
    color: var(--text-color);
}

.filter-section select {
    padding: 10px 15px;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}

.filter-section select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Results Info */
.results-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px 15px;
    background: var(--card-bg);
    border-radius: 8px;
    font-size: 0.95rem;
}

.results-info #resultsCount {
    font-weight: 600;
    color: var(--primary-color);
}

.quick-tips {
    color: var(--text-muted);
}

.quick-tips kbd {
    background: var(--code-bg);
    color: var(--code-text);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: monospace;
}

/* Commands Grid */
.commands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.command-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    border-left: 4px solid var(--primary-color);
}

.command-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.command-card .command-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
    font-family: 'Courier New', monospace;
}

.command-card .command-category {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent-green), #059669);
    color: white;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.command-card .command-desc {
    color: var(--text-color);
    margin-bottom: 15px;
    line-height: 1.5;
}

.command-card .command-syntax {
    background: var(--code-bg);
    color: var(--code-text);
    padding: 10px 12px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    overflow-x: auto;
}

.command-card .quick-preview {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.command-card .quick-preview strong {
    color: var(--accent-orange);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    overflow-y: auto;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 30px 20px;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 30px;
    max-width: 800px;
    width: 100%;
    position: relative;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-color);
}

.modal-body h2 {
    color: var(--primary-color);
    font-family: 'Courier New', monospace;
    font-size: 2rem;
    margin-bottom: 10px;
}

.modal-body .category-tag {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent-green), #059669);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.modal-body .description {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.modal-section {
    margin-bottom: 25px;
}

.modal-section h3 {
    color: var(--primary-dark);
    font-size: 1.2rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-section h3::before {
    content: '';
    width: 4px;
    height: 20px;
    background: var(--accent-orange);
    border-radius: 2px;
}

.options-table {
    width: 100%;
    border-collapse: collapse;
}

.options-table th,
.options-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.options-table th {
    background: var(--bg-color);
    font-weight: 600;
    color: var(--text-color);
}

.options-table .flag {
    font-family: 'Courier New', monospace;
    background: var(--code-bg);
    color: var(--code-text);
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 600;
}

.options-table td {
    color: var(--text-color);
}

.examples-list {
    list-style: none;
}

.examples-list li {
    background: var(--bg-color);
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
}

.examples-list .example-cmd {
    background: var(--code-bg);
    color: var(--code-text);
    padding: 12px 15px;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
}

.examples-list .example-desc {
    padding: 10px 15px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.examples-list .example-desc::before {
    content: '→ ';
    color: var(--accent-green);
    font-weight: 600;
}

/* Footer */
footer {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    margin-top: 20px;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.no-results h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--text-color);
}

.no-results p {
    font-size: 1.1rem;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 0.95rem;
    }

    .commands-grid {
        grid-template-columns: 1fr;
    }

    .filter-section {
        flex-direction: column;
        align-items: flex-start;
    }

    .results-info {
        flex-direction: column;
        gap: 10px;
        text-align: left;
    }

    .modal-content {
        padding: 20px;
    }

    .modal-body h2 {
        font-size: 1.5rem;
    }
}

/* Highlight search matches */
.highlight {
    background: yellow;
    padding: 2px;
    border-radius: 2px;
}

/* Loading state */
.loading {
    text-align: center;
    padding: 40px;
    font-size: 1.2rem;
    color: var(--text-muted);
}

/* Accessibility - Visually Hidden but screen reader accessible */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip Links */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    z-index: 100;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* Quick Reference Section */
.quick-reference {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.quick-reference h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 25px;
    text-align: center;
}

.quick-ref-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.quick-ref-category h3 {
    color: var(--primary-dark);
    font-size: 1.1rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.quick-ref-category ul {
    list-style: none;
}

.quick-ref-category li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.quick-ref-category li:last-child {
    border-bottom: none;
}

.quick-ref-category code {
    background: var(--code-bg);
    color: var(--code-text);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* Print Styles */
@media print {
    body {
        background: white;
    }

    .search-section,
    .quick-tips,
    .modal,
    footer {
        display: none;
    }

    .commands-grid {
        display: block;
    }

    .command-card {
        break-inside: avoid;
        margin-bottom: 20px;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
