/* =================================================================
   Popo Page Specific Styles
================================================================== */

:root {
    --color-popo-primary: #6366F1;
    --color-popo-secondary: #A855F7;
    --color-popo-accent: #EC4899;
    --color-popo-bg: #EEF2FF;
    --color-popo-text-dim: #64748B;
}

/* Base Layout Overrides */
.page-template-page-popo main {
    overflow-x: hidden;
    background-color: #FAFAFA;
}

/* 
  1. Hero Section 
*/
.popo-hero {
    position: relative;
    min-height: 90vh;
    /* Fallback */
    min-height: 90svh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 80px;
    /* Header Offset for Mobile */
    background: radial-gradient(circle at 70% 30%, rgba(6, 182, 212, 0.08), transparent 60%),
        radial-gradient(circle at 20% 80%, rgba(59, 130, 246, 0.08), transparent 60%),
        linear-gradient(to bottom, #FFFFFF, #F0F9FF);
    overflow: hidden;
}

@media (min-width: 768px) {
    .popo-hero {
        padding-top: 0;
        /* Centered on larger screens if desired, or keep padding */
    }
}

/* Floating Particles */
.popo-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.popo-particle {
    position: absolute;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
    opacity: 0.6;
    animation: float-particle 15s infinite linear;
}

@keyframes float-particle {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }

    10% {
        opacity: 0.8;
    }

    90% {
        opacity: 0.8;
    }

    100% {
        transform: translateY(-100vh) translateX(20px);
        opacity: 0;
    }
}

/* Hero Content */
.popo-hero__content {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: none;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 4rem;
    align-items: center;
}

@media (min-width: 900px) {
    .popo-hero__content {
        grid-template-columns: 1.2fr 0.8fr;
        text-align: left;
    }
}

.popo-hero__text-area {
    order: 2;
}

@media (min-width: 900px) {
    .popo-hero__text-area {
        order: 1;
    }
}

.popo-hero__visual {
    order: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

@media (min-width: 900px) {
    .popo-hero__visual {
        order: 2;
        justify-content: flex-end;
    }
}

.popo-hero__image-wrapper {
    position: relative;
    width: 280px;
    height: 280px;
}

@media (min-width: 768px) {
    .popo-hero__image-wrapper {
        width: 360px;
        height: 360px;
    }
}

/* Breathing Animation for Popo */
.popo-breathing {
    animation: popo-breath 6s ease-in-out infinite;
}

@keyframes popo-breath {

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

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

/* 
  2. Profile Section Cards 
*/
.popo-profile-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.05);
    border-radius: 24px;
    padding: 3rem;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.popo-profile-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 50px -15px rgba(99, 102, 241, 0.1);
}

.popo-tag {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 99px;
    background: #F1F5F9;
    color: var(--color-text-secondary);
    font-size: 0.875rem;
    font-weight: 700;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.popo-tag:hover {
    background: #E0E7FF;
    color: var(--color-popo-primary);
}

/* 
  3. Philosophy Section 
*/
.popo-philosophy-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

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

.popo-philo-card {
    background: #FFFFFF;
    border-radius: 20px;
    padding: 2.5rem;
    text-align: left;
    border: 1px solid var(--color-border-default);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.popo-philo-card:hover {
    border-color: var(--color-popo-primary);
    box-shadow: 0 10px 30px -10px rgba(99, 102, 241, 0.15);
}

.popo-philo-number {
    font-size: 3rem;
    font-weight: 900;
    color: #F1F5F9;
    line-height: 1;
    margin-bottom: 1rem;
    transition: color 0.3s ease;
}

.popo-philo-card:hover .popo-philo-number {
    color: #EEF2FF;
}

/* 
  4. Capabilities Grid 
*/
.popo-capa-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (min-width: 768px) {
    .popo-capa-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
}

.popo-capa-item {
    background: #FFFFFF;
    border: 1px solid var(--color-border-default);
    border-radius: 16px;
    padding: 2rem 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: default;
}

.popo-capa-item:hover {
    background: linear-gradient(135deg, #FFFFFF 0%, #F5F7FF 100%);
    border-color: var(--color-popo-primary);
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -8px rgba(99, 102, 241, 0.12);
}

.popo-capa-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    display: inline-block;
    background: #F1F5F9;
    width: 60px;
    height: 60px;
    line-height: 60px;
    border-radius: 50%;
    color: var(--color-popo-primary);
    transition: all 0.3s ease;
}

.popo-capa-item:hover .popo-capa-icon {
    background: var(--color-popo-primary);
    color: white;
    transform: rotateY(180deg);
}

/* 
  5. CTA Section 
*/
.popo-cta-box {
    background: radial-gradient(circle at 50% 0%, #F5F7FF, #FFFFFF);
    border: 1px solid var(--color-border-focus);
    border-radius: 32px;
    padding: 4rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.popo-cta-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, var(--color-popo-primary), var(--color-popo-secondary), var(--color-popo-accent));
}

.popo-btn-gradient {
    background: linear-gradient(135deg, var(--color-popo-primary), var(--color-popo-secondary));
    color: white;
    padding: 1rem 3rem;
    border-radius: 99px;
    font-weight: 700;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px -5px rgba(99, 102, 241, 0.4);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.popo-btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px -5px rgba(99, 102, 241, 0.5);
    filter: brightness(1.1);
}

/* Animations Utility */
.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease-out forwards;
}

.delay-100 {
    animation-delay: 0.1s;
}

.delay-200 {
    animation-delay: 0.2s;
}

.delay-300 {
    animation-delay: 0.3s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =================================================================
   AI Telephone Architecture Diagram Styles (Refined)
   ================================================================== */

.tel-architecture {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem 0;
    width: 100%;
    /* Horizontal scroll on mobile if needed */
    overflow-x: auto;
    padding-bottom: 2rem;
    /* space for scrollbar/shadow */
}

@media (min-width: 1024px) {
    .tel-architecture {
        flex-direction: row;
        justify-content: center;
        align-items: flex-start;
        /* Align tops */
        gap: 0;
        overflow-x: visible;
    }
}

/* Common Card Styles */
.tel-card {
    background: #FFFFFF;
    border-radius: 16px;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 120px;
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 120px;
}

.tel-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.15);
    border-color: var(--color-popo-primary);
}

.tel-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.tel-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-text-primary);
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.tel-desc {
    font-size: 0.65rem;
    color: var(--color-text-secondary);
    background: #F8FAFC;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Sections */
.tel-section {
    position: relative;
    padding: 1.5rem;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.tel-world-label {
    position: absolute;
    top: -10px;
    left: 10px;
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--color-text-disabled);
    background: #FAFAFA;
    /* Match page bg */
    padding: 0 8px;
    z-index: 5;
    white-space: nowrap;
}

/* 1. User */
.section-user {
    /* No border/bg for user */
}

.card-user {
    border-radius: 50%;
    /* Circle for user */
    width: 100px;
    height: 100px;
    min-height: auto;
    background: #F1F5F9;
}

/* 2. Twilio */
.section-twilio {
    border: 2px dashed #FECACA;
    background: rgba(254, 242, 242, 0.5);
    margin: 0 1rem;
}

/* 3. Google */
.section-google {
    border: 2px dashed #BFDBFE;
    background: rgba(239, 246, 255, 0.5);
    flex-grow: 1;
    max-width: 600px;
    display: flex;
    flex-direction: row;
    /* CRF | Services */
    gap: 2rem;
    justify-content: center;
    align-items: flex-start;
    padding-bottom: 3rem;
    /* Space for return arrow */
}

/* Revert to column on mobile */
@media (max-width: 767px) {
    .section-google {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
    }
}

.google-core {
    display: flex;
    flex-direction: row;
    gap: 3rem;
    /* Space for arrows between CRF and SubIcons */
    align-items: center;
}

@media (max-width: 767px) {
    .google-core {
        flex-direction: column;
        gap: 2rem;
    }
}

.main-commander {
    /* Cloud Run Functions */
    border: 2px solid #6366F1;
    background: #EEF2FF;
    width: 130px;
    height: 130px;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.1);
}

.google-subicons {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Arrows & Steps */
.tel-arrow-group {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1rem;
    height: 50px;
    /* Force height on mobile stack */
}

@media (min-width: 1024px) {
    .tel-arrow-group {
        height: auto;
        padding: 0;
        min-width: 80px;
    }
}

.tel-arrow {
    position: relative;
    height: 2px;
    background: #CBD5E1;
    width: 100%;
    min-width: 60px;
    transition: all 0.3s;
}

/* Arrow Heads */
.arrow-bidirectional::before,
.arrow-bidirectional::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    border-top: 2px solid #CBD5E1;
    border-right: 2px solid #CBD5E1;
    top: 50%;
}

.arrow-bidirectional::before {
    left: 0;
    transform: translateY(-50%) rotate(225deg);
}

.arrow-bidirectional::after {
    right: 0;
    transform: translateY(-50%) rotate(45deg);
}

.arrow-right::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    border-top: 2px solid #CBD5E1;
    border-right: 2px solid #CBD5E1;
    top: 50%;
    right: 0;
    transform: translateY(-50%) rotate(45deg);
}

/* Steps (Bubbles) */
.tel-step {
    position: absolute;
    background: var(--color-popo-primary);
    color: white;
    font-size: 0.6rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 20;
    transform: scale(0.9);
    transition: transform 0.2s;
}

.tel-step:hover {
    transform: scale(1.1);
    background: var(--color-popo-secondary);
}

/* Step Positioning on Arrows */
.step-1 {
    top: -20px;
    left: 10%;
}

.step-9 {
    bottom: -20px;
    right: 10%;
    background: #64748B;
}

.step-2 {
    top: -20px;
    left: 10%;
}

.step-8 {
    bottom: -20px;
    right: 10%;
    background: #64748B;
}

/* Sub-service Arrows (CRF -> Services) */
.sub-service-row {
    display: flex;
    align-items: center;
    position: relative;
}

/* On desktop, arrows are left of the cards */
.arrow-short {
    width: 40px;
    min-width: 40px;
    margin-right: 10px;
    position: absolute;
    left: -50px;
    /* Pull left towards CRF */
    top: 50%;
}

@media (max-width: 767px) {
    .arrow-short {
        position: relative;
        left: auto;
        top: auto;
        margin: 0;
        margin-bottom: 10px;
        transform: rotate(90deg);
        /* Vertical flow */
        width: 30px;
        min-width: 30px;
    }

    .sub-service-row {
        flex-direction: column;
    }
}

.step-3 {
    top: -18px;
    left: 0;
}

.step-4 {
    bottom: -18px;
    right: 0;
    background: #A855F7;
}

.step-5 {
    top: -18px;
    left: 20%;
    background: #6366F1;
}

/* Special Down-Right Arrow (TTS -> GCS) */
.arrow-down-right {
    /* Logic handled by position mostly, simplified */
    display: none;
    /* Hide standard arrow, use border trick? */
}

/* Let's keep it simple: GCS just gets a label */
.card-gcs {
    border-color: #F59E0B;
}

.step-6 {
    /* positioned relatively to GCS card */
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: #F59E0B;
}

/* Return Path (GCS -> CRF) */
.tel-return-path {
    position: absolute;
    bottom: 10px;
    left: 0;
    width: 100%;
}

.arrow-left-long {
    height: 2px;
    background: #CBD5E1;
    width: 80%;
    margin: 0 auto;
    position: relative;
}

.arrow-left-long::before {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    border-top: 2px solid #CBD5E1;
    border-right: 2px solid #CBD5E1;
    top: 50%;
    left: 0;
    transform: translateY(-50%) rotate(225deg);
}

.step-7 {
    top: -10px;
    left: 40%;
    background: #EF4444;
}