/* 
   Modern Minimalist Dark Theme 
   Professional, Aesthetic, High Contrast
*/

:root {
    /* Color Palette - Dark Mode Base */
    --bg-body: #000000;
    --bg-surface: #000000;
    --bg-card: #111111;
    --bg-input: #1a1a1a;
    
    /* Accents */
    --primary: #ffffff;
    --primary-dim: #a0a0a0;
    --accent: #3b82f6; /* Subtle blue for interactive elements */
    --accent-hover: #60a5fa;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;

    /* Typography */
    --text-main: #ffffff;
    --text-secondary: #a3a3a3;
    --text-muted: #525252;

    /* Borders & Shadows */
    --border: #333333;
    --border-hover: #555555;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.4);

    /* Spacing & Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 24px;
    --container-width: 1200px;
}

/* Reset & Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Layout */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    padding: 60px 0;
    text-align: center;
    background: #000000;
    margin-bottom: 40px;
}

.logo-container {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.logo-emoji {
    font-size: 32px;
}

h1 {
    font-size: 48px;
    font-weight: 800;
    letter-spacing: -1px;
    background: linear-gradient(to right, #fff, #a0a0a0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 16px;
}

.tagline {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

#total-count {
    color: var(--accent);
    font-weight: 600;
}

/* Header */
header {
    padding: 80px 0 60px;
    text-align: center;
    background: radial-gradient(circle at center, #1a1a1a 0%, #0a0a0a 100%);
    border-bottom: 1px solid var(--border);
    margin-bottom: 40px;
}

.logo-container {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.logo-emoji {
    font-size: 32px;
}

h1 {
    font-size: 48px;
    font-weight: 800;
    letter-spacing: -1px;
    background: linear-gradient(to right, #fff, #a0a0a0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 16px;
}

.tagline {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

#total-count {
    color: var(--accent);
    font-weight: 600;
}

/* Search Section */
.search-section {
    position: sticky;
    top: 20px;
    z-index: 100;
    margin-bottom: 40px;
}

.search-container {
    background: rgba(30, 30, 30, 0.8);
    backdrop-filter: blur(12px);
    padding: 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

@media (min-width: 768px) {
    .search-container {
        flex-direction: row;
        align-items: center;
    }
}

.search-box {
    flex: 1;
    position: relative;
}

.search-box {
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 16px 20px 16px 50px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 16px;
    transition: all 0.2s;
}

.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--accent);
    border: none;
    border-radius: 6px;
    padding: 8px;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s;
}

.search-btn:hover {
    background: var(--accent-hover);
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}


.filters {
    display: flex;
    gap: 12px;
}

select {
    padding: 14px 32px 14px 16px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 14px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23a3a3a3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    min-width: 140px;
    transition: border-color 0.2s;
}

select:hover {
    border-color: var(--border-hover);
}

select:focus {
    outline: none;
    border-color: var(--accent);
}

/* Stats Section */
.stats-section {
    margin-bottom: 60px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-card {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    text-align: center;
    transition: transform 0.2s, border-color 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Results Header */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.results-header h2 {
    font-size: 24px;
    font-weight: 600;
}

.results-count {
    color: var(--text-secondary);
    font-size: 14px;
}

select:hover {
    border-color: var(--border-hover);
}

select:focus {
    outline: none;
    border-color: var(--accent);
}

/* Stats Bar */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 60px;
    color: var(--text-secondary);
    font-size: 14px;
    padding: 20px;
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
}

.stat-label {
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 10px;
}

/* Results Grid */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.results-header h2 {
    font-size: 24px;
    font-weight: 600;
}

.results-count {
    color: var(--text-secondary);
    font-size: 14px;
}

.workflows-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
    margin-bottom: 60px;
}

/* Workflow Card */
.workflow-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 24px;
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
    height: 100%;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.workflow-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-lg);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.card-badges {
    display: flex;
    gap: 8px;
}

.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-category {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge-complexity-low {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.badge-complexity-medium {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.badge-complexity-high {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    line-height: 1.4;
}

.card-description {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.integrations-list {
    display: flex;
    gap: 8px;
    color: var(--text-muted);
    font-size: 12px;
}

.integration-icon {
    background: var(--bg-surface);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.node-count {
    color: var(--text-muted);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Loading & Empty States */
.loading, .no-results {
    text-align: center;
    padding: 80px 0;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--bg-surface);
    border-top-color: var(--accent);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}


/* Footer */
footer {
    text-align: center;
    padding: 40px 0;
    color: var(--text-muted);
    font-size: 14px;
    border-top: 1px solid var(--border);
    margin-top: 80px;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    header {
        padding: 40px 0 30px;
    }

    h1 {
        font-size: 32px;
    }

    .search-container {
        padding: 16px;
    }

    .filters {
        flex-direction: column;
    }

    select {
        width: 100%;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-body);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}