/* Services Section */
.services {
    padding-top: var(--spacing-lg); /* Consistent top padding */
    padding-bottom: var(--spacing-xl);
    position: relative;
    overflow: visible;
    z-index: 5; /* Lower than hero-header's z-index */
    background-color: var(--primary-bg);
    min-height: 600px;
    box-shadow: 0 -10px 20px rgba(0, 0, 0, 0.1); /* Add subtle shadow at top */
    border-top: 1px solid rgba(255, 255, 255, 0.05); /* Subtle border for visual separation */
    scroll-margin-top: var(--header-height); /* Account for fixed header when scrolled */
}

.services::before, .services::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.services::before {
    background-image: url('../images/services-bg.jpeg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    opacity: 0.4;
}

.services::after {
    background-color: transparent;
    background-image: linear-gradient(
        to bottom,
        transparent 0%, 
        transparent 100px,
        var(--teal-bg) 250px
    );
}

.services h2 {
    text-align: center;
    margin: var(--spacing-xl) auto 0;
    padding-top: 60px;
    position: relative;
    z-index: 2;
    color: var(--neutral-text);
    text-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}

.services h2::after {
    background-color: var(--accent-green);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.7);
}

.service-cards {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
    margin-top: var(--spacing-xl);
    padding-bottom: var(--spacing-xl);
}

/* Card Styles */
.card {
    background-color: rgba(19, 31, 46, 0.95);
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    overflow: hidden;
    position: relative;
    min-height: 180px;
    opacity: 0;
    transform: translateY(30px);
    padding: 0 20px 0 0;
    transition: box-shadow 0.4s ease, padding-bottom 0.4s ease, opacity 0.6s ease, transform 0.6s ease;
}

.card.animate {
    opacity: 1;
    transform: translateY(0);
}

.card:nth-child(1) { transition-delay: 0s; }
.card:nth-child(2) { transition-delay: 0.2s; }
.card:nth-child(3) { transition-delay: 0.4s; }
.card:nth-child(4) { transition-delay: 0.6s; }

/* Accent line */
.card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 8px;
    height: 100%;
    z-index: 1;
}

.card[data-accent="green"]::before { background-color: var(--accent-green); }
.card[data-accent="blue"]::before { background-color: var(--highlight-blue); }
.card[data-accent="purple"]::before { background-color: var(--gaming-purple); }
.card[data-accent="orange"]::before { background-color: var(--devops-orange); }

/* Icon wrapper */
.card-icon-wrapper {
    position: relative;
    margin: 0;
    padding: 20px;
    flex-shrink: 0;
    z-index: 2;
    transition: transform 0.4s ease;
}

.card-icon-wrapper::before { display: none; }

.card-icon {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    z-index: 2;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: width 0.4s ease, height 0.4s ease, border-color 0.4s ease;
    border: 5px solid;
}

/* Icon border colors */
.card[data-accent="green"] .card-icon { border-color: rgba(16, 185, 129, 0.7); }
.card[data-accent="blue"] .card-icon { border-color: rgba(59, 130, 246, 0.7); }
.card[data-accent="purple"] .card-icon { border-color: rgba(168, 85, 247, 0.7); }
.card[data-accent="orange"] .card-icon { border-color: rgba(249, 115, 22, 0.7); }

.card[data-accent="green"]:hover .card-icon, .card[data-accent="green"].active .card-icon { border-color: rgba(84, 207, 166, 0.9); }
.card[data-accent="blue"]:hover .card-icon, .card[data-accent="blue"].active .card-icon { border-color: rgba(111, 165, 252, 0.9); }
.card[data-accent="purple"]:hover .card-icon, .card[data-accent="purple"].active .card-icon { border-color: rgba(195, 132, 255, 0.9); }
.card[data-accent="orange"]:hover .card-icon, .card[data-accent="orange"].active .card-icon { border-color: rgba(251, 146, 60, 0.9); }

.card-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease, filter 0.4s ease;
}

.card-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 25px 0 20px 0;
    position: relative;
    z-index: 2;
}

.card-header { 
    transition: transform 0.4s ease;
    position: relative;
    z-index: 3; /* Ensure header stays above brief during animation */
}

/* Card titles with accent colors */
.card[data-accent="green"] h3 { color: var(--accent-green); }
.card[data-accent="blue"] h3 { color: var(--highlight-blue); }
.card[data-accent="purple"] h3 { color: var(--gaming-purple); }
.card[data-accent="orange"] h3 { color: var(--devops-orange); }

.card h3 {
    margin-bottom: 12px;
    font-size: 1.7rem;
    transition: margin-bottom 0.4s ease;
}

.card-brief {
    color: var(--muted-text);
    margin-bottom: 0;
    font-size: 1.05rem;
    line-height: 1.5;
    opacity: 1;
    transform: translateX(0) translateY(0);
    transition: opacity 0.3s ease, transform 0.4s ease, color 0.3s ease, font-weight 0.3s ease, margin-bottom 0.4s ease;
}

/* Expandable content */
.card-expandable-content {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    margin-top: 40px;
    padding-left: 10px;
}

.card-description {
    color: var(--neutral-text);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 16px;
}

.card-features { margin-bottom: 16px; }

.card-features li {
    position: relative;
    padding-left: 20px;
    margin-bottom: var(--spacing-sm);
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.1s;
    visibility: hidden;
}

.card-features li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 10px;
    height: 2px;
    background-color: var(--accent-green);
}

.cta-button {
    align-self: flex-start;
    margin-top: 15px;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.3s ease;
    display: inline-block;
    visibility: hidden;
}

/* Expand indicator */
.card-expand-indicator {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 32px;
    background-color: rgba(30, 41, 59, 0.7);
    border-radius: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.4s ease, transform 0.4s ease;
    opacity: 0.9;
    z-index: 5;
}

.card-expand-indicator i {
    color: var(--neutral-text);
    font-size: 24px;
    transition: transform 0.4s ease;
}

/* Hover/Active States */
.card:hover, .card.active {
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    padding-bottom: 30px;
}

.card:hover .card-expand-indicator, .card.active .card-expand-indicator {
    opacity: 0;
    transform: translateX(-50%) translateY(15px) scale(0.8);
}

.card:hover .card-expand-indicator i, .card.active .card-expand-indicator i {
    transform: rotate(180deg);
}

.card:hover .card-icon-wrapper, .card.active .card-icon-wrapper {
    transform: translateY(15px);
}

.card:hover .card-icon, .card.active .card-icon {
    width: 180px;
    height: 180px;
}

.card:hover .card-icon img, .card.active .card-icon img {
    transform: scale(1.1);
    filter: brightness(1.1);
}

.card:hover .card-header, .card.active .card-header {
    transform: translateX(19px) translateY(20px);
}

.card:hover h3, .card.active h3 {
    margin-bottom: 8px; /* Reduce bottom margin to bring brief closer */
    transition-delay: 0.05s; /* Slightly delay the margin change */
}

.card:hover .card-expandable-content, .card.active .card-expandable-content {
    max-height: 400px;
    opacity: 1;
    transition: max-height 0.5s ease, opacity 0.4s ease 0.1s;
}

.card:hover .card-features li, .card.active .card-features li {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.card:hover .cta-button, .card.active .cta-button {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

/* Staggered animation for list items and button */
.card:hover .card-features li:nth-child(1), .card.active .card-features li:nth-child(1) { 
    transition-delay: 0.25s; 
}
.card:hover .card-features li:nth-child(2), .card.active .card-features li:nth-child(2) { 
    transition-delay: 0.3s; 
}
.card:hover .card-features li:nth-child(3), .card.active .card-features li:nth-child(3) { 
    transition-delay: 0.35s; 
}
.card:hover .card-features li:nth-child(4), .card.active .card-features li:nth-child(4) { 
    transition-delay: 0.4s; 
}
.card:hover .cta-button, .card.active .cta-button { 
    transition-delay: 0.45s; 
}

.card:hover .card-brief, .card.active .card-brief {
    opacity: 1;
    transform: translateX(15px) translateY(-10px); /* Slightly less vertical movement for better positioning */
    color: rgba(241, 245, 249, 0.9); /* Lighter version */
    font-weight: 300; /* Make it lighter */
    transition-delay: 0.2s; /* Slightly slower than title */
    margin-bottom: -8px; /* Reduce space between brief and expandable content */
}

/* Responsive Services */
@media (max-width: 768px) {
    .services::before { opacity: 0.3; }
    .service-cards { gap: var(--spacing-lg); }
    
    .card {
        flex-direction: column;
        min-height: auto;
        padding: 0 0 20px 0;
    }
    
    .card-icon-wrapper {
        display: flex;
        justify-content: center;
    }
    
    .card-icon {
        width: 100px;
        height: 100px;
        margin: 20px auto 0;
    }
    
    .card-content {
        padding: 15px 20px 20px;
        text-align: center;
        width: 100%;
    }
    
    .card-header { text-align: center; }
    .card-brief {
        padding: 0 20px;
        font-size: 1rem;
        margin-bottom: 15px;
        text-align: center;
    }
    
    .card-expandable-content {
        padding: 0 20px;
        margin-top: 10px;
    }
    
    .card-description {
        text-align: center;
    }
    
    .card:hover .card-header, .card.active .card-header { transform: translateX(0) translateY(0); }
    .card:hover h3, .card.active h3 {
        margin-bottom: 10px; /* Less reduction on mobile */
    }
    
    .card:hover .card-brief, .card.active .card-brief {
        transform: translateX(0) translateY(-5px); /* Less vertical movement on mobile */
        margin-bottom: 0; /* Reset margin on mobile */
    }
    
    .card:hover .card-icon, .card.active .card-icon {
        width: 120px;
        height: 120px;
    }
    
    .cta-button {
        align-self: center;
        margin-left: 0;
        margin-top: 20px; /* Increased spacing for mobile */
    }
    
    /* Ensure list items and button still animate properly on mobile */
    .card-features li {
        text-align: center;
        transform: translateY(10px); /* Slightly less movement on mobile */
    }
    
    /* Adjust animation timing for mobile */
    .card:hover .card-features li:nth-child(1), .card.active .card-features li:nth-child(1) { transition-delay: 0.25s; }
    .card:hover .card-features li:nth-child(2), .card.active .card-features li:nth-child(2) { transition-delay: 0.3s; }
    .card:hover .card-features li:nth-child(3), .card.active .card-features li:nth-child(3) { transition-delay: 0.35s; }
    .card:hover .card-features li:nth-child(4), .card.active .card-features li:nth-child(4) { transition-delay: 0.4s; }
    .card:hover .cta-button, .card.active .cta-button { transition-delay: 0.45s; }
} 