/* ==========================================
   Product Development & MVPs - Service Page Styles
   ========================================== */

/* Hero Section Specifics */
.product-hero {
    background: radial-gradient(circle at top right, rgba(139, 92, 246, 0.05), transparent 40%),
        radial-gradient(circle at bottom left, rgba(6, 182, 212, 0.05), transparent 40%);
}

.hero-authority {
    color: var(--color-text-secondary);
    font-size: var(--font-size-lg);
    border-left: 2px solid var(--color-accent-primary);
    padding-left: var(--space-3);
    margin: var(--space-4) 0;
    max-width: 600px;
}

.hero-benefit-list {
    list-style: none;
    margin-bottom: var(--space-6);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.hero-benefit-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--color-text-secondary);
    font-size: var(--font-size-lg);
}

.hero-benefit-item svg {
    color: var(--color-accent-primary);
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.cta-group {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    overflow: visible;
}

/* Ensure hero text doesn't overflow on desktop */
.product-hero .hero-content {
    overflow: visible;
}

.product-hero .hero-text {
    width: 100%;
    overflow: visible;
}

@media (min-width: 1024px) {
    .product-hero .hero-text {
        max-width: 640px;
    }

    .cta-group {
        justify-content: flex-start;
    }
}

.product-hero .btn-primary {
    min-width: max-content;
    white-space: nowrap;
}

/* ==========================================
   HERO ANIMATION: Idea -> Wireframe -> Product
   ========================================== */

.product-hero-visual {
    position: relative;
    width: 100%;
    max-width: 480px;
    height: 480px;
    margin: 0 auto;
    perspective: 1000px;
}

.lifecycle-container {
    padding: 20px;
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
}

.lifecycle-card {
    position: absolute;
    width: 280px;
    height: 360px;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    padding: 20px;
    backdrop-filter: blur(10px);
    transition: all 0.5s ease;
}

/* Card 1: The Idea (Sketch/Note style) */
.card-idea {
    z-index: 1;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 2px dashed #d97706;
    color: #92400e;
    transform: translate(-50%, -50%) rotate(-5deg);
    animation: ideaFades 1s ease-out 1.5s forwards;
    /* Fades back/out when next card comes */
}

.card-idea .card-icon {
    font-size: 40px;
    margin-bottom: 20px;
    color: #d97706;
}

.card-idea .scribble-line {
    height: 4px;
    background: rgba(146, 64, 14, 0.2);
    border-radius: 2px;
    margin-bottom: 12px;
    width: 100%;
}

/* Card 2: The Wireframe (Blueprint style) */
.card-wireframe {
    z-index: 2;
    background: #1e293b;
    border: 1px solid #475569;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9) translateX(50px);
    animation: wireframeEnter 1s ease-out 1s forwards, wireframeRecede 1s ease-out 3.5s forwards;
}

.wireframe-block {
    background: rgba(255, 255, 255, 0.1);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    margin-bottom: 15px;
}

.wf-header {
    height: 40px;
    border-radius: 4px;
}

.wf-img {
    height: 120px;
    border-radius: 4px;
}

.wf-text {
    height: 10px;
    border-radius: 2px;
    width: 80%;
}

.wf-text:last-child {
    width: 60%;
}

/* Card 3: The Functional Product (Final UI) */
.card-product {
    z-index: 3;
    background: #0f172a;
    /* Dark navy */
    border: 1px solid rgba(6, 182, 212, 0.3);
    box-shadow: 0 0 30px rgba(6, 182, 212, 0.15);
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9) translateX(50px);
    animation: productEnter 1s ease-out 3s forwards;
}

.product-ui-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.product-ui-logo {
    width: 80px;
    height: 12px;
    background: var(--color-accent-primary);
    border-radius: 6px;
}

.product-stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.stat-box {
    background: rgba(6, 182, 212, 0.1);
    padding: 10px;
    border-radius: 8px;
    text-align: center;
}

.stat-val {
    font-size: 20px;
    font-weight: bold;
    color: var(--color-accent-primary);
}

.stat-label {
    font-size: 10px;
    color: var(--color-text-secondary);
}

/* Animation Keyframes */

/* Idea fades back just a bit to show depth */
@keyframes ideaFades {
    to {
        transform: translate(-70%, -45%) rotate(-15deg) scale(0.85);
        opacity: 0.6;
        filter: grayscale(0.5);
    }
}

/* Wireframe enters */
@keyframes wireframeEnter {
    to {
        opacity: 1;
        transform: translate(-50%, -50%) rotate(0deg) scale(1);
    }
}

/* Wireframe recedes to make room for product */
@keyframes wireframeRecede {
    to {
        transform: translate(-30%, -55%) rotate(5deg) scale(0.9);
        opacity: 0.8;
    }
}

/* Product enters */
@keyframes productEnter {
    to {
        opacity: 1;
        transform: translate(-50%, -40%) rotate(0deg) scale(1.05);
        box-shadow: 0 30px 60px rgba(6, 182, 212, 0.3);
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {

    .card-idea,
    .card-wireframe,
    .card-product {
        animation: none;
        opacity: 1;
        transition: none;
    }

    /* Static stacked arrangement */
    .card-idea {
        transform: translate(-60%, -60%) rotate(-5deg) scale(0.9);
        z-index: 1;
    }

    .card-wireframe {
        transform: translate(-55%, -55%) rotate(0deg) scale(0.95);
        z-index: 2;
    }

    .card-product {
        transform: translate(-50%, -50%) scale(1);
        z-index: 3;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .product-hero-visual {
        height: 400px;
        transform: scale(0.85);
    }

    .lifecycle-card {
        width: 240px;
        height: 320px;
    }
}

/* Solutions Grid (Reusing general styles pattern) */
.solutions-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
    margin-top: var(--space-6);
}

@media (min-width: 768px) {
    .solutions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .solutions-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.solution-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.solution-card:hover {
    border-color: var(--color-accent-primary);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(6, 182, 212, 0.1);
}

.solution-card h3 {
    font-size: var(--font-size-xl);
    color: var(--color-text-primary);
}

.solution-card p {
    color: var(--color-text-secondary);
    font-size: var(--font-size-base);
}

/* Who This Is For */
.who-for-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
}

@media (min-width: 768px) {
    .who-for-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.who-for-card {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    transition: transform var(--transition-base);
}

.who-for-card:hover {
    transform: scale(1.02);
}

.who-for-bullet {
    width: 8px;
    height: 8px;
    background: var(--color-accent-primary);
    border-radius: 50%;
    flex-shrink: 0;
}

/* Comparison Table */
.comparison-container {
    overflow-x: auto;
    margin-top: var(--space-6);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
    background: var(--color-bg-card);
    backdrop-filter: blur(10px);
}

.comparison-table th,
.comparison-table td {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.comparison-table th {
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-text-primary);
    font-weight: 700;
}

.comparison-table tr:last-child td {
    border-bottom: none;
}

.comparison-table td:first-child {
    font-weight: 600;
    color: var(--color-text-primary);
    width: 30%;
}

.comparison-table td {
    color: var(--color-text-secondary);
}

/* Process Timeline */
.process-timeline {
    position: relative;
    max-width: 800px;
    margin: var(--space-8) auto 0;
}

.process-step {
    display: flex;
    gap: var(--space-4);
    margin-bottom: var(--space-8);
    position: relative;
}

.process-step:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 20px;
    top: 40px;
    bottom: -40px;
    width: 2px;
    background: linear-gradient(to bottom, var(--color-accent-primary), transparent);
}

.step-number {
    width: 40px;
    height: 40px;
    background: var(--color-accent-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    flex-shrink: 0;
    box-shadow: 0 0 15px var(--color-shadow);
    z-index: 2;
}

.step-content h3 {
    margin-bottom: var(--space-1);
}

.step-outputs {
    margin-top: var(--space-2);
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.output-tag {
    font-size: var(--font-size-xs);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 10px;
    border-radius: var(--radius-full);
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
}

.process-confidence {
    text-align: center;
    color: var(--color-text-secondary);
    margin-top: var(--space-6);
    font-style: italic;
}

/* Checklist Grid */
.checklist-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-3);
    margin-top: var(--space-6);
}

@media (min-width: 768px) {
    .checklist-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2);
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-sm);
}

.checklist-item svg {
    color: var(--color-accent-primary);
    flex-shrink: 0;
}

/* Tech Stack */
.tech-context {
    text-align: center;
    color: var(--color-text-secondary);
    max-width: 600px;
    margin: var(--space-2) auto var(--space-6);
}

.tech-categories {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
    margin-top: var(--space-6);
}

@media (min-width: 768px) {
    .tech-categories {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .tech-categories {
        grid-template-columns: repeat(4, 1fr);
        /* 4 for Product: Frontend, Backend, DB, Cloud */
    }
}

.tech-group h4 {
    margin-bottom: var(--space-2);
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
}

.badge-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.tech-badge {
    background: var(--color-bg-tertiary);
    color: var(--color-text-primary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    font-weight: 500;
    border: 1px solid var(--color-border);
}

/* Example Project */
.example-project-card {
    background: linear-gradient(135deg, var(--color-bg-secondary) 0%, #0c1220 100%);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    margin-top: var(--space-8);
}

.project-flow {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.flow-step {
    border-left: 2px solid var(--color-accent-primary);
    padding-left: var(--space-4);
}

.flow-step h4 {
    color: var(--color-accent-primary);
    margin-bottom: var(--space-1);
    font-size: var(--font-size-lg);
}

.flow-step p {
    color: var(--color-text-secondary);
}

/* FAQ */
.faq-list {
    margin-top: var(--space-8);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.faq-item {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all var(--transition-base);
}

.faq-item.active {
    border-color: var(--color-accent-primary);
}

.faq-question {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    background: var(--color-bg-secondary);
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-3);
    cursor: pointer;
    color: var(--color-text-primary);
    font-weight: 600;
    text-align: left;
}

.faq-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    transition: transform 0.25s ease;
    color: var(--color-accent-primary);
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 var(--space-4);
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease-in-out;
    background: rgba(255, 255, 255, 0.02);
    opacity: 0;
}

.faq-item.active .faq-answer {
    max-height: 300px;
    padding: var(--space-3) var(--space-4);
    opacity: 1;
}

/* Final CTA */
.final-cta {
    position: relative;
    overflow: hidden;
    padding: var(--space-8) 0;
    background: var(--color-bg-secondary);
    border-top: 1px solid var(--color-border);
}

.cta-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.cta-buttons {
    margin-top: var(--space-6);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
}

.btn-group {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
    justify-content: center;
}

/* ==========================================
   LAYOUT FIXES (Prevent Section Overlap)
   ========================================== */

/* 1. Give each section its own spacing context */
section {
    padding-top: 80px;
    padding-bottom: 80px;
    position: relative;
    margin-top: 0;
    margin-bottom: 0;
}

/* 2. Isolate headings from margin collapse */
section h2,
section h3 {
    margin-top: 0;
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

/* 3. Add a safe gap between sections */
section+section {
    margin-top: 0;
}

/* 4. Fix Grid / Card Containers */
.who-for-grid,
.comparison-container,
.solutions-grid,
.checklist-grid,
.tech-categories {
    margin-top: 32px;
}

/* 6. Safety Reset */
main,
.page-content {
    overflow: visible;
}