/* Careers Page Styles - Enhanced Material 3 */

/* --- Hero Section --- */
.career-hero {
    padding: 120px 0 80px;
    text-align: center;
    background: radial-gradient(circle at 50% 50%, rgba(66, 133, 244, 0.05) 0%, transparent 70%);
    position: relative;
    overflow: hidden;
}

.career-hero h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    line-height: 1.1;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.career-hero .text-highlight {
    color: var(--google-blue);
    position: relative;
    display: inline-block;
}

.career-hero .sub-headline {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto 40px;
    font-weight: 300;
}

/* --- Ecosystem Section (3D Hybrid) --- */
.ecosystem-visual-section {
    padding: 140px 0;
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at 50% 50%, #1a1a1a 0%, #000 100%);
    color: #fff;
    font-family: 'Inter', sans-serif;
    perspective: 1200px;
    /* Essential for 3D */
}

.ecosystem-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 80px;
    z-index: 2;
    position: relative;
    transform-style: preserve-3d;
}

.ecosystem-graphic {
    position: relative;
    width: 600px;
    height: 600px;
    display: flex;
    justify-content: center;
    align-items: center;
    transform-style: preserve-3d;
    transform: rotateX(60deg) rotateZ(-20deg);
    /* 3D TILT */
}

/* Central Hub (Billboarding to face user) */
.central-hub {
    position: absolute;
    width: 140px;
    height: 140px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    box-shadow:
        0 0 50px rgba(66, 133, 244, 0.4),
        inset 0 0 20px rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    /* Counter-rotate to face viewer */
    transform: rotateZ(20deg) rotateX(-60deg);
}

.hub-title {
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: 2px;
    line-height: 1.2;
    background: linear-gradient(135deg, #fff 0%, #8ab4f8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(66, 133, 244, 0.5);
}

/* Orbit Rings */
.orbit-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform-style: preserve-3d;
    box-shadow: 0 0 15px rgba(66, 133, 244, 0.1);
}

.ring-inner {
    width: 320px;
    height: 320px;
    animation: rotate 20s linear infinite;
    border-color: rgba(66, 133, 244, 0.3);
}

.ring-outer {
    width: 500px;
    height: 500px;
    animation: rotate 35s linear infinite reverse;
    border: 1px dashed rgba(255, 255, 255, 0.15);
}

/* Orbit Items (Satellites) */
.orbit-item {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    background: rgba(20, 20, 20, 0.85);
    /* Darker bg for contrast */
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    white-space: nowrap;
    transition: all 0.3s ease;
    cursor: default;

    /* CRITICAL: Billboarding technique 
       Since parent rings rotate, we need complex counter-rotation.
       Actually, simpler approach for CSS 3D rings: 
       The item itself needs to counter the Ring's rotation AND the Container's Tilt.
    */
}

/* 
   Advanced 3D Animation Strategy:
   The Ring rotates around Z axis (flat on the tilted plane).
   The Items need to:
   1. Be positioned on the ring.
   2. Counter-rotate the Ring's Z rotation (so they don't spin).
   3. Counter-rotate the Container's Tilt (X and Z) so they face the screen.
*/

.ring-inner .orbit-item {
    animation: counter-inner 20s linear infinite;
}

.ring-outer .orbit-item {
    animation: counter-outer 35s linear infinite reverse;
}

@keyframes rotate {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* 
   Counter Animations:
   1. Un-rotate the ring's current angle.
   2. Un-tilt the container (rotateZ(20deg) rotateX(-60deg)).
*/
@keyframes counter-inner {
    0% {
        transform: rotate(0deg) rotateZ(20deg) rotateX(-60deg);
    }

    100% {
        transform: rotate(-360deg) rotateZ(20deg) rotateX(-60deg);
    }
}

@keyframes counter-outer {
    0% {
        transform: rotate(0deg) rotateZ(20deg) rotateX(-60deg);
    }

    100% {
        transform: rotate(360deg) rotateZ(20deg) rotateX(-60deg);
    }

    /* Reverse direction */
}


.orbit-item:hover {
    background: rgba(66, 133, 244, 0.3);
    border-color: #8ab4f8;
    z-index: 100;
    box-shadow: 0 0 20px rgba(66, 133, 244, 0.6);
}

.node-icon {
    font-family: 'Material Icons', sans-serif;
    font-size: 1.2rem;
    color: #8ab4f8;
}

.node-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.5px;
}

/* Inner Ring Placement */
.item-dev {
    top: 0%;
    left: 50%;
    transform-origin: center center;
    margin-top: -20px;
    margin-left: -50px;
}

.item-learn {
    top: 73%;
    left: 90%;
    transform-origin: center center;
}

.item-ent {
    top: 73%;
    left: 10%;
    transform-origin: center center;
}

/* Outer Ring Placement */
.item-inn {
    top: 0%;
    left: 50%;
    transform-origin: center center;
}

.item-growth {
    top: 50%;
    left: 100%;
    transform-origin: center center;
}

.item-comm {
    top: 100%;
    left: 50%;
    transform-origin: center center;
}

.item-future {
    top: 50%;
    left: 0%;
    transform-origin: center center;
}

/* Mobile Adjustment for 3D */
@media (max-width: 768px) {
    .ecosystem-visual-section {
        padding: 80px 0;
    }

    .ecosystem-graphic {
        /* Flatten for mobile as 3D can be glitchy or too small */
        transform: scale(0.65) rotateX(0deg) rotateZ(0deg);
    }

    .central-hub {
        transform: none;
    }

    .ring-inner .orbit-item {
        animation: rotate-counter 20s linear infinite;
    }

    .ring-outer .orbit-item {
        animation: rotate-counter-reverse 35s linear infinite reverse;
    }
}


/* --- Values Section (Cards) --- */
.values-section {
    padding: 100px 0;
    background-color: var(--surface-light);
}

.values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 40px auto 0;
}

.value-card {
    background: #fff;
    padding: 40px 30px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.03);
    text-align: center;
}

.value-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(66, 133, 244, 0.1);
    border-color: rgba(66, 133, 244, 0.2);
}

.value-icon {
    font-size: 3rem;
    margin-bottom: 24px;
    background: linear-gradient(135deg, #e8f0fe 0%, #fff 100%);
    width: 80px;
    height: 80px;
    line-height: 80px;
    border-radius: 50%;
    margin-left: auto;
    margin-right: auto;
}

.value-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    letter-spacing: -0.01em;
}

.value-card p {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.6;
}


/* --- Culture Section (Bento Grid with Images) --- */
.culture-section {
    padding: 100px 0;
    background: #f8f9fa;
}

.culture-bento {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 300px);
    /* Taller rows for images */
    gap: 24px;
    max-width: 1100px;
    margin: 0 auto;
}

.bento-card {
    border-radius: 24px;
    position: relative;
    overflow: hidden;
    /* transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); REMOVE simple transition to avoid conflict with hover effects */
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background: #000;
    /* Fallback */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    /* Soft shadow */
    cursor: pointer;
}

.bento-bg-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
    opacity: 0.9;
}

.bento-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.2) 50%, rgba(0, 0, 0, 0) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 30px;
    transition: background 0.3s ease;
}

.bento-content {
    transform: translateY(10px);
    transition: transform 0.3s ease;
}

.bento-card:hover .bento-bg-img {
    transform: scale(1.1);
    opacity: 1;
}

.bento-card:hover .bento-content {
    transform: translateY(0);
}

.large {
    grid-column: span 2;
    grid-row: span 1;
}

.medium {
    grid-column: span 1;
    grid-row: span 1;
}

.wide {
    grid-column: span 3;
    grid-row: span 1;
}

.bento-content h4 {
    font-size: 1.75rem;
    margin-bottom: 8px;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.bento-content p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 300;
}

@media (max-width: 768px) {
    .culture-bento {
        grid-template-columns: 1fr;
        /* Stack on mobile */
        grid-auto-rows: 250px;
    }

    .large,
    .medium,
    .wide {
        grid-column: span 1;
    }
}


/* --- Benefits Section (New Grid Layout) --- */
.benefits-section {
    padding: 100px 0;
    background: #fff;
}

.benefits-grid-card {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
    max-width: 1200px;
    margin: 0 auto;
}

.benefit-card {
    padding: 40px 32px;
    border-radius: 24px;
    background: var(--surface-light);
    border: 1px solid var(--surface-border);
    transition: all 0.3s ease;
    text-align: left;
}

.benefit-card:hover {
    background: #fff;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    /* Premium lift */
    transform: translateY(-8px);
    border-color: transparent;
}

.benefit-icon {
    font-size: 2.5rem;
    margin-bottom: 24px;
    display: inline-block;
}

.benefit-card h4 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.benefit-card p {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
}


/* --- Detailed FAQ (Contact Page Style) --- */
.faq-container {
    max-width: 800px;
    margin: 40px auto 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.faq-item {
    background: var(--surface-light);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item:hover {
    box-shadow: var(--shadow-1);
    border-color: var(--google-blue);
}

.faq-item.active {
    box-shadow: var(--shadow-2);
    border-color: var(--google-blue);
    background: var(--surface-dim);
}

.faq-question {
    padding: 24px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
}

.faq-question h3 {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
}

.faq-toggle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    transition: transform 0.3s ease, color 0.3s;
    line-height: 1;
}

.faq-item.active .faq-toggle {
    transform: rotate(45deg);
    color: var(--google-blue);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-item.active .faq-answer {
    max-height: 300px;
}

.faq-answer p {
    padding: 0 24px 24px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}


/* --- CTA Section (High Impact) --- */
.cta-section {
    padding: 100px 0;
    background: var(--google-blue);
    /* High impact solid color */
    color: #fff;
    text-align: center;
}

.cta-content h2 {
    font-size: 2.5rem;
    color: #fff;
    margin-bottom: 24px;
}

.cta-content p {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 600px;
    margin: 0 auto 40px;
}

.cta-section .cta-button.primary {
    background: #fff;
    color: var(--google-blue);
    border: none;
}

.cta-section .cta-button.primary:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.stories-section {
    padding: 80px 0;
    background: var(--surface-dim);
}

.stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
}

.story-card {
    background: var(--surface-light);
    padding: 2rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-1);
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.story-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--google-blue);
    flex-shrink: 0;
    display: flex;
    /* Placeholder for img */
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: bold;
    font-size: 1.5rem;
}

.story-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.story-content blockquote {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin: 0 0 1rem 0;
    font-style: italic;
    line-height: 1.6;
}

.story-content footer cite {
    display: block;
    font-weight: 600;
    font-style: normal;
    color: var(--text-primary);
}

.story-content footer span {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* --- Roles Filter & List --- */
.roles-header {
    text-align: center;
    margin-bottom: 40px;
}

.filter-bar {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 32px;
    flex-wrap: wrap;
}

.filter-group {
    position: relative;
    max-width: 300px;
    width: 100%;
}

.search-input,
.filter-select {
    padding: 12px 16px;
    border: 1px solid var(--surface-border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    width: 100%;
    background: #fff;
    color: var(--text-primary);
}

.search-input {
    padding-right: 40px;
}

.search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.filter-select {
    width: auto;
    min-width: 160px;
    cursor: pointer;
}

.roles-list {
    display: grid;
    gap: 16px;
    max-width: 900px;
    margin: 0 auto;
}

.role-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    background: #fff;
    transition: all 0.2s ease;
    animation: fadeIn 0.5s ease forwards;
}

.role-card:hover {
    box-shadow: var(--shadow-2);
    border-color: transparent;
    transform: translateY(-2px);
}

.role-meta {
    display: flex;
    gap: 24px;
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.role-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge.engineering {
    background: #E8F0FE;
    color: var(--google-blue);
}

.badge.design {
    background: #FCE8E6;
    color: var(--google-red);
}

.badge.research {
    background: #E6F4EA;
    color: var(--google-green);
}

.badge.sales {
    background: #FEF7E0;
    color: #EA8600;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- FAQ Section --- */
.faq-section {
    padding: 80px 0;
    background: #fff;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.faq-item {
    border-bottom: 1px solid var(--surface-border);
}

.faq-question {
    padding: 24px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-question h4 {
    margin: 0;
    font-weight: 500;
    color: var(--text-primary);
}

.toggle-icon {
    font-size: 1.5rem;
    color: var(--google-blue);
    transition: transform 0.3s;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 200px;
    /* Arbitrary height for animation */
}

.faq-item.active .toggle-icon {
    transform: rotate(45deg);
}

/* --- Modal Styles --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: #fff;
    width: 90%;
    max-width: 500px;
    border-radius: 24px;
    box-shadow: var(--shadow-3);
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.modal-overlay.active .modal-container {
    transform: scale(1);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--surface-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.modal-body {
    padding: 24px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--surface-border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--google-blue);
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.1);
}

.form-note {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 12px;
    text-align: center;
}

.full-width {
    width: 100%;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .culture-bento {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
    }

    .large,
    .medium,
    .wide {
        grid-column: span 1;
    }

    .role-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .role-action,
    .role-action button {
        width: 100%;
    }

    .ecosystem-graphic-3d {
        width: 300px;
        height: 300px;
    }
}