/* AI Tools Page Styles */

:root {
    --ai-gradient: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
}

.ai-tools-page {
    min-height: 100vh;
}

/* Hero Section */
.ai-hero {
    padding: 2rem 1rem;
    /* Same box as the game-page banners (see game-page.css .banner-image):
       the 2200x400 ratio shows the whole banner between ~1100px and 2200px wide,
       min-height holds it off being a flat strip on phones (cover crops the sides
       instead), and it never grows past 400px on a wide screen. Height is still
       auto, so if the hero text needs more room than the ratio gives, the box
       grows rather than clipping the words. */
    /* width:100% is load-bearing, not decoration: with an auto width, the
       min-height below makes Chrome resolve the width *through* the ratio
       (200 x 5.5 = 1100px) and the hero shoots past a phone screen. */
    width: 100%;
    aspect-ratio: 2200 / 400;
    min-height: 200px;
    max-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;   /* auto cross-margins would otherwise let the text
                              take its 800px max-width and overflow a phone */
    /* Banner image (textless) with a dark scrim so the overlaid hero text stays
       readable. Falls back to the purple gradient if the image is missing.
       2200x400 like every game banner, so no upscaling on desktop. */
    background-image:
        linear-gradient(rgba(10, 15, 30, 0.5), rgba(10, 15, 30, 0.5)),
        url('/assets/images/main/recommendations-banner-blurr.jpg'),
        var(--ai-gradient);
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
}

.ai-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(139, 92, 246, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(236, 72, 153, 0.3) 0%, transparent 50%);
    pointer-events: none;
}

.ai-hero .hero-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    color: white;
    /* Drop shadow so the text stays legible over the busy banner image */
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

.ai-hero h1 {
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    font-weight: 800;
    margin-bottom: 0.5rem;
    line-height: 1.1;
}

.ai-hero .subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    font-weight: 600;
    margin-bottom: 0.5rem;
    opacity: 0.95;
}

.ai-hero .description {
    font-size: var(--font-size-base);
    line-height: 1.5;
    opacity: 0.9;
    max-width: 700px;
    margin: 0 auto;
}

/* Services Section */
.services-section {
    /* Halved top gap between hero and first category */
    padding: 2.5rem 0 5rem;
    background: var(--color-bg-primary);
}

.services-grid {
    display: grid;
    /* Fixed card width (max 360px), centered — so a lone card (e.g. Ludocards)
       keeps the same width as when three sit in a row instead of stretching. */
    grid-template-columns: repeat(auto-fit, minmax(280px, 360px));
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
}

/* Category grouping */
.rec-category {
    /* Per-section colour theme. Default = purple; theme classes override. */
    --section-gradient: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    --section-accent: #8b5cf6;
    margin-top: 3.5rem;
}

.rec-category:first-child {
    margin-top: 0;
}

/* Section colour themes */
.rec-category.theme-purple {
    --section-gradient: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    --section-accent: #8b5cf6;
}

.rec-category.theme-green {
    /* green with turquoise tint */
    --section-gradient: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
    --section-accent: #10b981;
}

.rec-category.theme-orange {
    /* orange with red tint — ready for the "Recommended Products" category */
    --section-gradient: linear-gradient(135deg, #f97316 0%, #ef4444 100%);
    --section-accent: #f97316;
}

.rec-category-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.rec-category-header h2 {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: var(--section-gradient, var(--ai-gradient));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.rec-category-header p {
    color: var(--color-text-secondary);
    font-size: var(--font-size-lg);
    margin: 0;
}

.service-card {
    background: var(--color-bg-secondary);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: var(--transition-base);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--section-gradient, var(--ai-gradient));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-card:hover {
    transform: translateY(-4px);
    border-color: var(--section-accent, var(--color-primary));
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.service-card.highlighted {
    border-color: var(--color-primary);
    background: linear-gradient(135deg, var(--color-bg-secondary) 0%, rgba(139, 92, 246, 0.05) 100%);
}

.service-card.highlighted::after {
    content: 'RECOMMENDED';
    position: absolute;
    top: 1.5rem;
    right: -2.5rem;
    background: var(--color-primary);
    color: white;
    padding: 0.25rem 3rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    transform: rotate(45deg);
    z-index: 1;
}

.service-logo {
    width: 80px;
    height: 80px;
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    font-size: 2.5rem;
}

.service-logo.placeholder {
    background: var(--section-gradient, var(--ai-gradient));
    color: white;
    font-weight: 800;
}

.service-card h3 {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 0.5rem;
}

.service-card .tagline {
    font-size: var(--font-size-sm);
    color: var(--section-accent, var(--color-primary));
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.service-card .description {
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    /* Cap to 6 lines so cards stay even */
    display: -webkit-box;
    -webkit-line-clamp: 6;
    line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.service-features {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem 0;
}

.service-features li {
    padding: 0.5rem 0 0.5rem 1.75rem;
    position: relative;
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    line-height: 1.5;
    /* One row per feature (max 4 features rendered) */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.service-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--section-accent, var(--color-primary));
    font-weight: 700;
}

.service-card .btn {
    width: 100%;
    justify-content: center;
    padding: 0.875rem 1.5rem;
    font-weight: 600;
}

.service-card .btn-primary {
    background: var(--section-gradient, var(--ai-gradient));
    color: #fff;
    border: none;
}

.service-card .btn-primary:hover {
    filter: brightness(1.08);
    transform: translateY(-2px);
}

/* How It Works Section */
.how-it-works {
    padding: 5rem 0;
    background: var(--color-bg-secondary);
}

.how-it-works h2 {
    text-align: center;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    margin-bottom: 3rem;
    color: var(--color-text-primary);
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    max-width: 1000px;
    margin: 0 auto;
}

.step-card {
    text-align: center;
    position: relative;
}

.step-number {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: var(--ai-gradient);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 800;
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.3);
}

.step-card h3 {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 1rem;
}

.step-card p {
    color: var(--color-text-secondary);
    line-height: 1.6;
}

/* Integration Section */
.integration-section {
    padding: 5rem 0;
    background: var(--ai-gradient);
    position: relative;
    overflow: hidden;
}

.integration-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 30% 50%, rgba(139, 92, 246, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(236, 72, 153, 0.3) 0%, transparent 50%);
    pointer-events: none;
}

.integration-content {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.integration-content h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    margin-bottom: 1rem;
    color: white;
}

.integration-content p {
    font-size: var(--font-size-lg);
    color: white;
    line-height: 1.7;
    margin-bottom: 2.5rem;
    opacity: 0.95;
}

.integration-links {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.integration-links .btn {
    padding: 1.25rem 2.5rem;
    font-size: var(--font-size-lg);
    font-weight: 700;
    border-radius: var(--radius-md);
    transition: var(--transition-base);
    min-width: 200px;
}

.integration-links .btn-primary,
.integration-links .btn-secondary {
    background: #f97316;
    color: white;
    border: 2px solid #f97316;
}

.integration-links .btn-primary:hover,
.integration-links .btn-secondary:hover {
    background: #ea580c;
    border-color: #ea580c;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(249, 115, 22, 0.4);
}

/* CTA Section */
.cta-section {
    padding: 6rem 0;
    background: var(--ai-gradient);
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 30% 30%, rgba(139, 92, 246, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(236, 72, 153, 0.3) 0%, transparent 50%);
    pointer-events: none;
}

.cta-content {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
    color: white;
}

.cta-content h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    margin-bottom: 1rem;
}

.cta-content p {
    font-size: var(--font-size-lg);
    margin-bottom: 2.5rem;
    opacity: 0.95;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-buttons .btn {
    background: white;
    color: var(--color-primary);
    border: 2px solid white;
    padding: 1rem 2rem;
    font-weight: 700;
    font-size: var(--font-size-lg);
}

.cta-buttons .btn:hover {
    background: transparent;
    color: white;
    border-color: white;
    transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 768px) {
    .ai-hero {
        /* Keep side padding — `0` let the hero text run into the screen edges */
        padding: 2rem 1.25rem;
    }

    /* Phone: the tagline is the line that pushes the hero over its height and
       squeezes the rest. The h1 and the description say the same thing. */
    .ai-hero .subtitle {
        display: none;
    }

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

    .steps-grid {
        gap: 2rem;
    }

    .how-it-works,
    .integration-section,
    .services-section {
        padding: 3rem 0;
    }

    .cta-section {
        padding: 4rem 0;
    }

    .cta-buttons,
    .integration-links {
        flex-direction: column;
    }

    .cta-buttons .btn,
    .integration-links .btn {
        width: 100%;
    }
}

/* Affiliate disclosure note under the tools grid */
.affiliate-disclosure {
    text-align: center;
    color: var(--color-text-tertiary);
    font-size: var(--font-size-sm);
    margin-top: var(--spacing-lg);
}
