* {
    box-sizing: border-box;
}

:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --bg: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    transition: all 0.2s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 2rem 0;
    text-align: center;
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.stats {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.stat {
    text-align: center;
    min-width: 100px;
}

.stat-number {
    display: block;
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Controls */
.controls {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Main Content */
.main {
    padding: 2rem 0;
}

/* States */
.state {
    text-align: center;
    padding: 4rem 2rem;
}

.state .icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.state p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.retry-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
}

.retry-btn:hover {
    background: var(--primary-dark);
}

/* Workflow Grid */
.workflow-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.workflow-card {
    background-color: var(--bg);
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--border);
    height: 100%;
    cursor: pointer;
}

.workflow-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-color: var(--primary);
}

.card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Align items to the start (left) */
    gap: 0.75rem; /* Add space between stacked elements */
}

/* Make child elements take full width */
.card-body > * {
    width: 100%;
    margin: 0; /* Remove default margins */
}

/* Remove any flex-grow or flex properties that might be stretching items */
.card-body > * {
    flex: 0 0 auto;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.card-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
}

.nodes-tag {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.card-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.card-integrations {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.5rem;
}

.integration-tag {
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid var(--border);
}

.more-tag {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .workflow-grid {
        grid-template-columns: 1fr;
    }
}

.workflow-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.workflow-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
    line-height: 1.4;
}

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

.workflow-how-it-works {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.workflow-how-it-works::before {
    content: '';
}

.workflow-integrations {
    margin-top: 1rem;
}

.integrations-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.integrations-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.integration-tag {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    border: 1px solid var(--border);
}

.workflow-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.action-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    background: var(--bg);
    color: var(--text);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary);
}

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

.action-btn.primary:hover {
    background: var(--primary-dark);
}

/* Load More */
.load-more {
    text-align: center;
    margin-top: 2rem;
}

.load-more-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
}

.load-more-btn:hover {
    background: var(--primary-dark);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

.modal-box {
    position: relative;
    z-index: 1001;
    max-width: 32rem;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.5rem;
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    color: var(--text-secondary);
}

.modal-body {
    padding: 1.5rem;
}

.workflow-detail {
    margin-bottom: 1rem;
}

.workflow-detail h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.copy-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.copy-btn:hover {
    background: var(--primary-dark);
}

.copy-btn.copied {
    background: var(--success);
}

.copy-btn.copied:hover {
    background: var(--success);
}

.json-viewer {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1rem;
    font-size: 0.875rem;
    overflow-x: auto;
    max-height: 400px;
    white-space: pre-wrap;
}

.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .title {
        font-size: 2rem;
    }

    .stats {
        gap: 1rem;
    }

    .search-section,
    .filter-section {
        flex-direction: column;
        align-items: stretch;
    }

    .search-input {
        min-width: auto;
    }

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

    .workflow-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* Header styles */
.header {
    padding: 6rem 0.5rem 3rem 0.5rem;
    position: relative;
    overflow: hidden;
    min-height: 300px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.content-safe-zone {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    z-index: 5;
}

.headline-container {
    text-align: center;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0;
    position: relative;
    z-index: 10;
}

.headline {
    font-family: 'Poppins', sans-serif;
    font-size: 3.25rem;
    font-weight: 500;
    line-height: 1.1;
    margin-bottom: 1rem;
    color: var(--text);
    letter-spacing: -0.02em;
}

.colored-text {
    color: var(--primary);
}

/* Icon rows styling */
.icon-row {
    position: absolute;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 16rem;
    padding: 0 2rem;
    pointer-events: none;
}

.top-icon-row {
    top: 1.5rem;
}

.bottom-icon-row {
    bottom: 1rem;
}


.integration-icons-container {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    max-width: 1200px;
    width: 100%;
    height: 100%;
    z-index: 1; /* Below the hero text */
    pointer-events: none; /* So clicks pass through to elements below */
}

.integration-icon {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(5px);
    padding: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.integration-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Hero text container needs higher z-index */
.hero-content {
    position: relative;
    z-index: 2;
}

/* Vertical floating animations */
@keyframes float-up-down {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

.float {
    animation: float-up-down 4s infinite ease-in-out;
}

/* Search section styles */
.search-section {
    padding: 2rem 0.5rem;
    background-color: var(--bg);
    border-bottom: 1px solid var(--border);
}

/* Template count section */
.template-count {
    text-align: center;
    margin-bottom: 1.5rem;
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.template-count-number {
    text-decoration: underline;
    color: var(--text);
    font-weight: 500;
}

/* Container for centering the search box */
.search-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
    position: relative;
    z-index: 10;
}

/* Main search container with pulsing border */
.new-search-box {
    position: relative;
    width: 100%;
    max-width: 650px;
    border-radius: 0.75rem;
    overflow: hidden;
    border: 2px solid transparent;
    animation: pulse-border 2s infinite;
    background-color: var(--bg-secondary) !important;
}

/* Inner container */
.new-search-inner {
    display: flex;
    align-items: stretch;
    width: 100%;
    height: 100%;
    background-color: var(--bg-secondary) !important;
}

/* Input container */
.new-search-input-container {
    position: relative;
    flex-grow: 1;
}

.new-search-input::placeholder {
    color: var(--text-muted);
    opacity: 1;  /* Ensure it's fully visible */
}

/* Icon styling */
.new-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 18px;
    height: 18px;
    opacity: 0.7;
}

/* Input styling */
.new-search-input {
    width: 100% !important;
    height: 100% !important;
    padding: 0.875rem 1rem 0.875rem 2.75rem !important;
    font-size: 1rem !important;
    border: none !important;
    background-color: var(--bg-secondary) !important;
    color: var(--text) !important;
    outline: none !important;
    margin: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

/* Button styling */
.new-search-button {
    background-color: var(--primary) !important;
    color: white !important;
    border: none !important;
    padding: 0 1.25rem !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    border-radius: 0 !important;
    min-width: 50px !important;
}

.new-search-button:hover {
    background-color: var(--primary-dark) !important;
}

/* Search icon in button */
.new-search-button-icon {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
    /* Makes the icon white */
}

/* Animation for the sparkle icon */
@keyframes twinkle {

    0%,
    100% {
        opacity: 0.7;
    }

    50% {
        opacity: 0.5;
    }
}

.sparkle-animation {
    animation: twinkle 1.5s infinite ease-in-out;
}

/* Pulse border animation */
@keyframes pulse-border {
    0% {
        border-color: rgba(59, 130, 246, 0.2);
    }

    70% {
        border-color: rgba(59, 130, 246, 0.8);
    }

    100% {
        border-color: rgba(59, 130, 246, 0.2);
    }
}

/* Responsive styles */
@media (max-width: 768px) {
    .headline {
        font-size: 2.5rem;
    }

    .header {
        padding: 4rem 0.5rem 2rem 0.5rem;
        min-height: 250px;
    }

    .integration-icon {
        width: 36px;
        height: 36px;
    }

    .integration-icon img {
        width: 20px;
        height: 20px;
    }

    .icon-row {
        gap: 1.5rem;
    }

    .top-icon-row {
        top: 1rem;
    }

    .bottom-icon-row {
        bottom: 1rem;
    }

    .search-section {
        padding: 1.5rem 0.5rem;
    }
}

.workflow-steps-container {
    display: flex;
    width: 100%;
    padding: 0rem 0.5rem;
    /* background-color: red; */
}

.workflow-steps {
    width: 180%;
    margin-left: -15rem;
    /* background-color: blue; */
}

/* Style the figure to properly display the timeline */
.workflow-card figure.workflow-steps-container {
    padding: 1rem;
    background-color: #f8fafc;
    width: 100%;
    overflow: visible;
}


/* Style the card body */
.workflow-card .card-body {
    padding: 1.5rem;
}

/* Ensure proper spacing between elements */
.workflow-card .card-title {
    margin-bottom: 0.5rem;
}


/* Base badge styles for consistency */
.badge {
    white-space: nowrap; /* Prevent text wrapping */
    display: inline-flex; /* Better alignment */
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
}

/* Primary badge style (for node count) */
.badge-secondary,
.card-title .badge,
.modal-box h3 .badge {
    background: var(--primary);
    color: white;
    border: none;
}

/* Secondary badge style (for integrations) */
.card-tag,
.badge-outline,
.card-actions .badge,
.card-tags .badge,
.modal-box .card-tags .card-tag {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

/* Ensure modal badges match card badges */
.modal-box .card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.modal-box .card-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
}

/* Define the skeleton animation keyframes */
@keyframes skeleton {
  0% {
    background-position: 150%;
  }

  100% {
    background-position: -50%;
  }
}

/* Card loading animation with horizontal glow line */
.card-loading {
  position: relative;
  overflow: hidden;
}

.card-loading::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: linear-gradient(
    105deg,
    transparent 0% 40%,
    rgba(255, 255, 255, 0.6) 50%,
    transparent 60% 100%
  );
  background-size: 200% auto;
  background-repeat: no-repeat;
  background-position-x: -50%;
  animation: skeleton 1s ease-in-out;
  animation-fill-mode: forwards;
  pointer-events: none;
  z-index: 1;
}

/* Reset button styles to behave like a container */
.workflow-card-button {
    all: unset; /* Reset all properties */
    display: block;
    width: 100%;
    cursor: pointer;
    padding: 0;
    margin: 0;
    background: none;
    border: none;
    text-align: left;
}

a.download-link {
    background: var(--primary);
    border: 0.1px solid var(--border);
    color: white;
    border: none;
}

a.download-link:hover {
    color: #000000;
}