/* ===================================
   Home Page - Modern Minimalist Style
   =================================== */

/* CSS Variables for Theming */
:root,
[data-bs-theme="light"] {
    --bg-page: #f5f7fa;
    --bg-surface: #ffffff;
    --bg-hover: #f8f9fa;
    --bg-section: #fafbfc;
    --text-primary: #1a202c;
    --text-secondary: #718096;
    --text-tertiary: #a0aec0;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: rgba(99, 102, 241, 0.1);
    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.1);
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.1);
    --info: #3b82f6;
    --info-light: rgba(59, 130, 246, 0.1);
}

[data-bs-theme="dark"],
.dark {
    /* n8n-inspired dark theme with maroon/purple tones */
    --bg-page: #0c0810;
    --bg-surface: #150f18;
    --bg-hover: #1f1726;
    --bg-section: #120c15;
    --text-primary: #f5f0ff;
    --text-secondary: #a89bb8;
    --text-tertiary: #6b5d7a;
    --border: #2a1f35;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.6);
    --primary: #c4b5fd;
    --primary-hover: #a78bfa;
    --primary-light: rgba(196, 181, 253, 0.12);
    --success: #6ee7b7;
    --success-light: rgba(110, 231, 183, 0.12);
    --warning: #fcd34d;
    --warning-light: rgba(252, 211, 77, 0.12);
    --info: #93c5fd;
    --info-light: rgba(147, 197, 253, 0.12);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.theme-wrapper {
    min-height: 100vh;
    background: var(--bg-page);
}

[data-bs-theme="dark"] .theme-wrapper,
.dark .theme-wrapper {
    background: var(--bg-page);
    background-image: 
        radial-gradient(ellipse at top, #37174d 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, #180d1c 0%, transparent 50%),
        radial-gradient(ellipse at bottom left, #150a15 0%, transparent 40%);
    background-attachment: fixed;
}

.home-page {
    min-height: 100vh;
}

/* Hero Section */
.hero-section {
    padding: 5rem 2rem;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
}

.hero-content {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

/* Gemini-style gradient text */
.gemini-gradient {
    background: linear-gradient(90deg, 
        #4285f4 0%,
        #9b72cb 9%,
        #d96570 20%,
        #d96570 24%,
        #9b72cb 35%,
        #4285f4 44%,
        #9b72cb 50%,
        #d96570 56%,
        #d96570 75%,
        #9b72cb 90%,
        #4285f4 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% auto;
    animation: gemini-shine 3s linear infinite;
}

@keyframes gemini-shine {
    0% {
        background-position: 0% center;
    }
    100% {
        background-position: 200% center;
    }
}

/* Dark mode adjustment for gradient - n8n style lavender/rose */
[data-bs-theme="dark"] .gemini-gradient,
.dark .gemini-gradient {
    background: linear-gradient(90deg, 
        #c4b5fd 0%,
        #e9d5ff 15%,
        #fda4af 30%,
        #fb7185 45%,
        #e9d5ff 60%,
        #c4b5fd 75%,
        #a78bfa 90%,
        #c4b5fd 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% auto;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    line-height: 1.6;
}

/* Search Bar */
.search-container {
    max-width: 600px;
    margin: 0 auto;
}

.search-wrapper {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-tertiary);
    pointer-events: none;
}

.search-icon-rtl {
    left: auto;
    right: 1.25rem;
}

.search-input {
    width: 100%;
    padding: 1rem 1.25rem 1rem 3.5rem;
    border-radius: 15px;
    border: 2px solid var(--border);
    background: var(--bg-page);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s;
}

.search-input-rtl {
    padding: 1rem 3.5rem 1rem 1.25rem;
    text-align: right;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

/* Category Filter Pills */
.category-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 2px solid var(--border);
    border-radius: 15px;
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-pill:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.filter-pill.active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.filter-pill.active:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #fff;
}

.filter-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Service Badge */
.service-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.25rem 0.625rem;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Popular Badge - Subtle bottom corner style */
.popular-badge {
    position: absolute;
    bottom: 0.625rem;
    left: 0.625rem;
    padding: 0.2rem 0.4rem;
    font-size: 0.5625rem;
    font-weight: 600;
    border-radius: 4px;
    background: rgba(255, 107, 53, 0.12);
    color: #ff6b35;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    z-index: 2;
    opacity: 0.85;
    transition: opacity 0.2s ease;
}

/* Dark mode popular badge */
[data-bs-theme="dark"] .popular-badge,
.dark .popular-badge {
    background: rgba(255, 167, 38, 0.15);
    color: #ffa726;
}

/* Hover effect - slightly more visible */
.service-card:hover .popular-badge {
    opacity: 1;
}

/* RTL support for popular badge */
[dir="rtl"] .popular-badge {
    left: auto;
    right: 0.625rem;
}

/* In RTL, keep badge on the right side to avoid overlapping with icon */
[dir="rtl"] .service-badge,
.service-content-rtl ~ .service-badge {
    right: 0.75rem;
    left: auto;
    margin-bottom: 0.5rem;
}

/* In RTL, add space between badge and service title */
[dir="rtl"] .service-content,
.service-content-rtl {
    padding-top: 1.5rem;
}

.service-badge-primary {
    background: var(--primary-light);
    color: var(--primary);
}

.service-badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.service-badge-success {
    background: var(--success-light);
    color: var(--success);
}

.service-badge-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.service-badge-info {
    background: var(--info-light);
    color: var(--info);
}

[data-bs-theme="dark"] .service-badge-danger,
.dark .service-badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

/* Services Section */
.services-section {
    padding: 4rem 2rem;
}

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

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

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

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

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

.service-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.75rem;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-hover));
    opacity: 0;
    transition: opacity 0.3s;
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

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

/* Disabled Service Card */
.service-card-disabled {
    opacity: 0.65;
    cursor: not-allowed;
    pointer-events: none;
}

.service-card-disabled:hover {
    transform: none;
    box-shadow: var(--shadow);
    border-color: var(--border);
}

.service-card-disabled::before {
    display: none;
}

/* Service Icon - Danger Color */
.service-icon-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

[data-bs-theme="dark"] .service-icon-danger,
.dark .service-icon-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

/* No Results */
.no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    color: var(--text-secondary);
}

.no-results .icon {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-results p {
    font-size: 1.125rem;
    margin: 0;
}

.service-content {
    display: flex;
    gap: 1.25rem;
}

.service-content-rtl {
    flex-direction: row-reverse;
    text-align: right;
}

.service-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s;
}

.service-card:hover .service-icon {
    transform: scale(1.1);
}

.service-icon-primary {
    background: var(--primary-light);
    color: var(--primary);
}

.service-icon-success {
    background: var(--success-light);
    color: var(--success);
}

.service-icon-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.service-icon-info {
    background: var(--info-light);
    color: var(--info);
}

.service-icon .icon {
    width: 24px;
    height: 24px;
    stroke-width: 2;
}

.service-text {
    flex: 1;
}

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

.service-description {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.service-card {
    animation: fadeIn 0.5s ease;
}

.service-card:nth-child(1) { animation-delay: 0.05s; }
.service-card:nth-child(2) { animation-delay: 0.1s; }
.service-card:nth-child(3) { animation-delay: 0.15s; }
.service-card:nth-child(4) { animation-delay: 0.2s; }
.service-card:nth-child(5) { animation-delay: 0.25s; }
.service-card:nth-child(6) { animation-delay: 0.3s; }
.service-card:nth-child(7) { animation-delay: 0.35s; }
.service-card:nth-child(8) { animation-delay: 0.4s; }
.service-card:nth-child(9) { animation-delay: 0.45s; }
.service-card:nth-child(10) { animation-delay: 0.5s; }
.service-card:nth-child(11) { animation-delay: 0.55s; }
.service-card:nth-child(12) { animation-delay: 0.6s; }

/* Responsive Design */
@media (max-width: 1200px) {
    .services-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .hero-section {
        padding: 4rem 1.5rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.125rem;
    }

    .services-section {
        padding: 3rem 1.5rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .services-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 1.25rem;
    }

    .service-card {
        padding: 1.5rem;
    }

    .category-filters {
        gap: 0.375rem;
    }

    .filter-pill {
        padding: 0.375rem 0.75rem;
        font-size: 0.8125rem;
    }
}

@media (max-width: 640px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

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

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

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

    .service-content {
        gap: 1rem;
    }

    .service-icon {
        width: 44px;
        height: 44px;
    }

    .service-icon .icon {
        width: 22px;
        height: 22px;
    }

    .service-title {
        font-size: 1rem;
    }

    .service-description {
        font-size: 0.875rem;
    }

    .category-filters {
        gap: 0.375rem;
        margin-top: 1rem;
    }

    .filter-pill {
        padding: 0.375rem 0.625rem;
        font-size: 0.75rem;
    }

    .filter-icon {
        width: 14px;
        height: 14px;
    }
}

@media (max-width: 480px) {
    .hero-section {
        padding: 3rem 1rem;
    }

    .services-section {
        padding: 2.5rem 1rem;
    }

    .search-input {
        padding: 0.875rem 1rem 0.875rem 3rem;
        font-size: 0.9375rem;
    }

    .search-input-rtl {
        padding: 0.875rem 3rem 0.875rem 1rem;
    }

    .filter-pill {
        padding: 0.3rem 0.5rem;
        font-size: 0.6875rem;
        gap: 0.25rem;
    }

    .filter-icon {
        width: 12px;
        height: 12px;
    }

    .service-badge {
        font-size: 0.625rem;
        padding: 0.2rem 0.5rem;
    }
}

