/* Services Page Styles */

/* Hero Section with Animated Squares */
.services-hero {
    height: 60vh;
    background: linear-gradient(135deg, var(--capa-bg) 0%, var(--capa-surface-alt) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    margin-top: calc(var(--header-height) + var(--spacing-xl));
    overflow: hidden;
}

.services-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(184, 136, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(184, 136, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(184, 136, 255, 0.05) 0%, transparent 50%);
    z-index: 1;
}

.animated-squares {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.floating-square {
    position: absolute;
    background: rgba(184, 136, 255, 0.12);
    border: 1px solid rgba(184, 136, 255, 0.3);
    border-radius: var(--radius-lg);
    animation: floatSquare linear infinite;
}

.floating-square:nth-child(1) {
    width: 60px;
    height: 60px;
    left: 10%;
    animation-duration: 20s;
    animation-delay: 0s;
}

.floating-square:nth-child(2) {
    width: 40px;
    height: 40px;
    left: 20%;
    animation-duration: 25s;
    animation-delay: -5s;
}

.floating-square:nth-child(3) {
    width: 80px;
    height: 80px;
    left: 35%;
    animation-duration: 30s;
    animation-delay: -10s;
}

.floating-square:nth-child(4) {
    width: 50px;
    height: 50px;
    left: 50%;
    animation-duration: 22s;
    animation-delay: -15s;
}

.floating-square:nth-child(5) {
    width: 70px;
    height: 70px;
    left: 65%;
    animation-duration: 28s;
    animation-delay: -8s;
}

.floating-square:nth-child(6) {
    width: 45px;
    height: 45px;
    left: 80%;
    animation-duration: 35s;
    animation-delay: -20s;
}

.floating-square:nth-child(7) {
    width: 55px;
    height: 55px;
    left: 15%;
    animation-duration: 32s;
    animation-delay: -12s;
}

.floating-square:nth-child(8) {
    width: 65px;
    height: 65px;
    left: 75%;
    animation-duration: 26s;
    animation-delay: -18s;
}

.floating-square:nth-child(9) {
    width: 38px;
    height: 38px;
    left: 5%;
    animation-duration: 18s;
    animation-delay: -3s;
}

.floating-square:nth-child(10) {
    width: 72px;
    height: 72px;
    left: 25%;
    animation-duration: 24s;
    animation-delay: -7s;
}

.floating-square:nth-child(11) {
    width: 52px;
    height: 52px;
    left: 42%;
    animation-duration: 29s;
    animation-delay: -14s;
}

.floating-square:nth-child(12) {
    width: 68px;
    height: 68px;
    left: 58%;
    animation-duration: 21s;
    animation-delay: -11s;
}

.floating-square:nth-child(13) {
    width: 44px;
    height: 44px;
    left: 72%;
    animation-duration: 27s;
    animation-delay: -16s;
}

.floating-square:nth-child(14) {
    width: 61px;
    height: 61px;
    left: 88%;
    animation-duration: 31s;
    animation-delay: -9s;
}

.floating-square:nth-child(15) {
    width: 49px;
    height: 49px;
    left: 12%;
    animation-duration: 23s;
    animation-delay: -21s;
}

.floating-square:nth-child(16) {
    width: 76px;
    height: 76px;
    left: 30%;
    animation-duration: 33s;
    animation-delay: -6s;
}

.floating-square:nth-child(17) {
    width: 41px;
    height: 41px;
    left: 47%;
    animation-duration: 19s;
    animation-delay: -13s;
}

.floating-square:nth-child(18) {
    width: 63px;
    height: 63px;
    left: 63%;
    animation-duration: 25s;
    animation-delay: -4s;
}

.floating-square:nth-child(19) {
    width: 56px;
    height: 56px;
    left: 78%;
    animation-duration: 28s;
    animation-delay: -19s;
}

.floating-square:nth-child(20) {
    width: 47px;
    height: 47px;
    left: 92%;
    animation-duration: 34s;
    animation-delay: -2s;
}

@keyframes floatSquare {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

.services-hero-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: var(--font-weight-display);
    color: var(--text);
    margin: 0;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    position: relative;
    z-index: 2;
    opacity: 0;
    transform: translateY(30px);
    animation: titleFadeIn 800ms var(--easing-smooth) 0.5s forwards;
}

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

/* Services Grid */
.services-grid {
    padding: var(--spacing-3xl) var(--container-padding);
    background: var(--capa-surface);
}

.services-container {
    max-width: var(--container-max);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-xl);
}

.service-card {
    background: var(--white);
    border: 1px solid rgba(172, 130, 254, 0.3);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    opacity: 0;
    transform: translateY(30px);
    transition: all var(--duration-normal) var(--easing-smooth);
}

.service-card.in-view {
    opacity: 1;
    transform: translateY(0);
}

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

.service-icon {
    width: 56px;
    height: 56px;
    background: var(--capa-purple);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--spacing-lg);
    color: var(--white);
}

.service-icon svg {
    width: 28px;
    height: 28px;
}

.service-card h3 {
    font-size: 1.5rem;
    font-weight: var(--font-weight-display);
    color: var(--capa-purple);
    margin-bottom: var(--spacing-md);
}

.service-card p {
    color: #333333; /* Dark gray text for readability on white cards */
    line-height: 1.7;
    margin: 0;
    font-weight: 400;
}

/* 3D Model Showcase */
.model-showcase {
    padding: var(--spacing-3xl) var(--container-padding);
    background: var(--capa-surface-alt);
    text-align: center;
}

.model-container {
    max-width: 800px;
    margin: 0 auto;
}

.model-container h2 {
    font-size: 2.5rem;
    font-weight: var(--font-weight-display);
    color: var(--capa-purple);
    margin-bottom: var(--spacing-xl);
}

.model-viewer {
    width: 100%;
    height: 500px;
    background: var(--white);
    border: 1px solid rgba(172, 130, 254, 0.25);
    border-radius: var(--radius-xl);
    position: relative;
    overflow: hidden;
    margin-bottom: var(--spacing-lg);
}

.model-controls {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    margin-bottom: var(--spacing-lg);
}

.model-btn {
    background: rgba(184, 136, 255, 0.12);
    border: 1px solid rgba(184, 136, 255, 0.3);
    color: var(--text);
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all var(--duration-fast) var(--easing-smooth);
}

.model-btn:hover,
.model-btn.active {
    background: var(--capa-purple);
    color: var(--white);
    border-color: var(--capa-purple);
}

.model-description {
    color: var(--text); /* This is fine as it's on dark background */
    font-size: 1rem;
    line-height: 1.7;
    max-width: 600px;
    margin: 0 auto;
}

/* FAQ Section */
.faq-section {
    padding: var(--spacing-3xl) var(--container-padding);
    background: var(--white);
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-title {
    font-size: 2.5rem;
    font-weight: var(--font-weight-display);
    color: var(--capa-purple);
    text-align: center;
    margin-bottom: var(--spacing-2xl);
}

.faq-item {
    border-bottom: 1px solid rgba(172, 130, 254, 0.15);
    margin-bottom: var(--spacing-md);
}

.faq-question {
    width: 100%;
    background: none;
    border: none;
    padding: var(--spacing-lg) 0;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    font-weight: var(--font-weight-display);
    color: #1a1a1a; /* High contrast dark text on white background */
    transition: color var(--duration-fast) var(--easing-smooth);
}

.faq-question:hover {
    color: var(--capa-purple);
}

.faq-question[aria-expanded="true"] {
    color: var(--capa-purple);
}

.faq-icon {
    font-size: 1.2rem;
    color: var(--capa-purple);
    transition: transform var(--duration-fast) var(--easing-smooth);
}

.faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--duration-normal) var(--easing-smooth);
}

.faq-answer.open {
    max-height: 300px; /* Increased to accommodate longer answers */
}

.faq-answer-content {
    padding: 0 0 var(--spacing-lg) 0;
    color: #333333; /* Dark gray for good readability on white background */
    line-height: 1.7;
    font-weight: 400;
}

/* Responsive */
@media (max-width: 768px) {
    .services-hero {
        height: 50vh;
    }
    
    .services-hero-title {
        font-size: 2.5rem;
    }
    
    .model-viewer {
        height: 300px;
    }
    
    .floating-square {
        display: none; /* Hide squares on mobile for performance */
    }
    
    .services-container {
        grid-template-columns: 1fr;
        gap: var(--spacing-2xl);
    }
    
    .services-description {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .services-hero {
        height: 40vh;
    }
    
    .services-hero-title {
        font-size: 2rem;
    }
    
    .model-viewer {
        height: 250px;
        min-height: 250px; /* Ensure fallback content fits */
    }
    
    /* Mobile fallback styling */
    .model-viewer .mobile-fallback {
        font-size: 14px !important;
        padding: 20px !important;
        height: 100% !important;
    }
    
    .model-viewer .mobile-fallback h3 {
        font-size: 18px !important;
    }
    
    .model-viewer .mobile-fallback ul {
        font-size: 13px !important;
    }
    
    .services-section {
        padding: var(--spacing-2xl) var(--container-padding);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .floating-square {
        animation: none;
        opacity: 0.05;
        position: static;
    }
    
    .animated-squares {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: var(--spacing-xl);
        padding: var(--spacing-xl);
        position: relative;
    }
    
    .floating-square {
        width: 100%;
        height: 60px;
        opacity: 0.05;
    }
}