/* ============================================
   AUTOMATION HUB - PREMIUM DESIGN SYSTEM
   ============================================ */

/* Section Background */
#automation-gallery {
    background: linear-gradient(180deg, #0a0f1a 0%, #0f172a 50%, #1a1f35 100%);
    padding: 5rem 2rem;
    position: relative;
    overflow: hidden;
}

/* Subtle animated background gradient */
#automation-gallery::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse 80% 50% at 20% 40%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 60%, rgba(20, 184, 166, 0.06) 0%, transparent 50%);
    pointer-events: none;
}

/* Header */
.automation-gallery-header {
    text-align: center;
    margin-bottom: 3.5rem;
    position: relative;
    z-index: 1;
}

.gallery-title {
    color: #ffffff;
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #ffffff 0%, #e2e8f0 50%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gallery-subtitle {
    color: rgba(148, 163, 184, 0.9);
    font-size: 1.125rem;
    line-height: 1.7;
    max-width: 700px;
    margin: 0 auto;
}

/* Social Proof Stats */
.automation-gallery-header .social-proof {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
}

.automation-gallery-header .social-proof strong {
    color: #14b8a6;
    font-weight: 700;
}

/* ============================================
   CATEGORY FILTERS - PILL STYLE
   ============================================ */
.category-filter {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(148, 163, 184, 0.15);
    color: rgba(255, 255, 255, 0.7);
    padding: 0.625rem 1.25rem;
    border-radius: 2rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
}

.filter-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.4);
    color: #fff;
    transform: translateY(-2px);
}

.filter-btn.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(20, 184, 166, 0.2) 100%);
    border-color: rgba(99, 102, 241, 0.5);
    color: white;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.25);
}

/* ============================================
   AUTOMATION CARDS GRID
   ============================================ */
.automation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.75rem;
    max-width: 1300px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* ============================================
   AUTOMATION CARDS - PREMIUM GLASSMORPHISM
   ============================================ */
.automation-card {
    background: linear-gradient(145deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.02) 50%,
        rgba(0, 0, 0, 0.1) 100%);
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 1.25rem;
    padding: 1.75rem;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Card Glow Effect */
.automation-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(99, 102, 241, 0.5) 20%,
        rgba(20, 184, 166, 0.5) 80%,
        transparent 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.automation-card:hover {
    transform: translateY(-8px);
    border-color: rgba(99, 102, 241, 0.35);
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(99, 102, 241, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

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

.automation-card.selected {
    background: linear-gradient(145deg,
        rgba(16, 185, 129, 0.12) 0%,
        rgba(16, 185, 129, 0.05) 100%);
    border-color: rgba(16, 185, 129, 0.4);
}

/* Card Header */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
}

/* Card Icon - Premium Style */
.card-icon {
    font-size: 0 !important;
    color: transparent !important;
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(20, 184, 166, 0.1) 100%);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 0.875rem;
    transition: all 0.3s ease;
}

.automation-card:hover .card-icon {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(20, 184, 166, 0.2) 100%);
    border-color: rgba(99, 102, 241, 0.4);
    transform: scale(1.05);
}

.card-icon svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
    color: #a5b4fc;
}

/* Popular Badge */
.popular-badge {
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    color: white;
    padding: 0.375rem 0.875rem;
    border-radius: 2rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

.selected-badge {
    background: linear-gradient(135deg, #10b981 0%, #14b8a6 100%);
    color: white;
    padding: 0.375rem 0.875rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

/* Card Body */
.card-body {
    margin-bottom: 1.5rem;
}

.card-title {
    color: #ffffff;
    font-size: 1.375rem;
    font-weight: 700;
    margin-bottom: 0.625rem;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.card-tagline {
    color: rgba(148, 163, 184, 0.85);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

/* Stats Section */
.card-stats {
    display: flex;
    gap: 1.5rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.6) 0%, rgba(30, 41, 59, 0.4) 100%);
    border-radius: 0.75rem;
    border: 1px solid rgba(148, 163, 184, 0.08);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-item .stat-icon {
    font-size: 1rem;
}

.stat-value {
    color: #14b8a6;
    font-weight: 700;
    font-size: 1.125rem;
}

.stat-label {
    color: rgba(148, 163, 184, 0.8);
    font-size: 0.8rem;
    margin-left: 0.25rem;
}

/* Card Footer Button */
.card-footer {
    margin-top: 1.25rem;
}

.btn-expand {
    width: 100%;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(20, 184, 166, 0.08) 100%);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 0.75rem;
    color: white;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-expand:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(20, 184, 166, 0.15) 100%);
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.2);
    transform: translateY(-2px);
}

.btn-expand .arrow {
    transition: transform 0.3s ease;
}

.btn-expand:hover .arrow {
    transform: translateX(4px);
}

/* ============================================
   AUTOMATION STACK PANEL
   ============================================ */
#automation-stack {
    display: none;
}

#automation-stack.has-items {
    display: block;
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.9) 100%);
    border: 2px solid rgba(16, 185, 129, 0.3);
    border-radius: 1.25rem;
    padding: 2rem;
    margin: 3rem auto;
    max-width: 1200px;
    backdrop-filter: blur(20px);
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.stack-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.stack-title {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.stack-title::before {
    content: '🚀';
}

.stack-clear {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: rgba(239, 68, 68, 0.9);
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.stack-clear:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
}

.stack-item {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(16, 185, 129, 0.03) 100%);
    border: 1px solid rgba(16, 185, 129, 0.25);
    padding: 1.25rem;
    border-radius: 0.75rem;
    margin-bottom: 0.875rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.stack-item:hover {
    border-color: rgba(16, 185, 129, 0.4);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(16, 185, 129, 0.05) 100%);
}

.stack-item-name {
    color: white;
    font-weight: 600;
    font-size: 1rem;
}

.stack-remove {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: rgba(239, 68, 68, 1);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.stack-remove:hover {
    background: rgba(239, 68, 68, 0.2);
}

.stack-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.stack-deploy,
.stack-clear-all {
    flex: 1;
    padding: 1.125rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.stack-deploy {
    background: linear-gradient(135deg, #6366f1 0%, #14b8a6 100%);
    border: none;
    color: white;
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.35);
}

.stack-deploy:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(99, 102, 241, 0.45);
}

.stack-clear-all {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
}

.stack-clear-all:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    #automation-gallery {
        padding: 3rem 1rem;
    }

    .automation-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .gallery-title {
        font-size: 1.75rem;
    }

    .gallery-subtitle {
        font-size: 1rem;
    }

    .category-filter {
        gap: 0.5rem;
    }

    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }

    .automation-card {
        padding: 1.25rem;
    }

    .card-stats {
        flex-direction: column;
        gap: 0.75rem;
    }

    .stack-actions {
        flex-direction: column;
    }
}
