/* Enhanced Services Page Styles */

/* Hero Section Refinements */
.services-hero {
    position: relative;
    background: linear-gradient(135deg, 
        rgba(248, 250, 252, 0.9) 0%, 
        rgba(255, 255, 255, 0.95) 50%, 
        rgba(248, 250, 252, 0.9) 100%);
    overflow: hidden;
    padding-top: 2rem; /* Adjusted padding */
}

.services-hero-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.4;
    background: 
        radial-gradient(circle at 25% 25%, rgba(225, 29, 72, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(100, 116, 139, 0.05) 0%, transparent 50%),
        linear-gradient(45deg, rgba(226, 232, 240, 0.3) 1px, transparent 1px);
    background-size: 800px 800px, 800px 800px, 24px 24px;
    animation: patternFloat 20s ease-in-out infinite;
    will-change: transform, opacity;
    backface-visibility: hidden;
}

@keyframes patternFloat {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-12px, 12px); }
}

.text-accent {
    position: relative;
    display: inline-block;
    color: rgb(225 29 72);
    background: linear-gradient(135deg, rgb(225 29 72), rgb(190 18 60));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-accent::after {
    content: '';
    position: absolute;
    bottom: 0.1em;
    left: 0;
    width: 100%;
    height: 0.1em;
    background: linear-gradient(90deg, 
        rgba(225, 29, 72, 0.3), 
        rgba(225, 29, 72, 0.6), 
        rgba(225, 29, 72, 0.3));
    transform: scaleX(0);
    transform-origin: left;
    animation: accentLine 0.6s ease-out 0.3s forwards;
    will-change: transform, opacity;
}

@keyframes accentLine {
    to { transform: scaleX(1); }
}

/* Enhanced hero text animation */
.services-hero h1 {
    opacity: 0;
    transform: translateY(20px) translateZ(0);
    animation: fadeUp 0.6s ease-out forwards;
    will-change: transform, opacity;
    backface-visibility: hidden;
}

.services-hero p {
    opacity: 0;
    transform: translateY(20px) translateZ(0);
    animation: fadeUp 0.6s ease-out 0.3s forwards;
    will-change: transform, opacity;
    backface-visibility: hidden;
}

/* Service Section Enhancements */
.service-section {
    opacity: 0;
    transform: translateY(30px) translateZ(0);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    will-change: transform, opacity;
    backface-visibility: hidden;
    contain: paint; /* isolate paint for animations */
}

.service-section.visible {
    opacity: 1;
    transform: translateY(0) translateZ(0);
}

.service-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, 
        rgba(226, 232, 240, 0), 
        rgba(226, 232, 240, 1), 
        rgba(226, 232, 240, 0));
    transform: translateY(-100%);
}

/* Service Badge Correction */
.service-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.5rem;
    background: linear-gradient(135deg, rgb(255 228 230), rgb(254 242 242));
    color: rgb(225 29 72);
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: 9999px; /* Changed to circular */
    border: 1px solid rgba(225, 29, 72, 0.2);
    box-shadow: 0 4px 6px -1px rgba(225, 29, 72, 0.1);
    margin-bottom: 1.5rem;
}

.service-badge i {
    font-size: 1rem;
    transition: transform 0.3s ease;
    will-change: transform;
}

/* Service Header Refinement */
.service-header {
    text-align: center;
    margin-bottom: 4rem;
}

.service-header h2 {
    font-size: 2.25rem;
    font-weight: 700;
    color: rgb(15, 23, 42);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.service-header p {
    font-size: 1.125rem;
    color: rgb(100, 116, 139);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Enhanced Feature Cards */
.service-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    perspective: 1000px;
}

.feature-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    will-change: transform, opacity;
    backface-visibility: hidden;
    transform: translateZ(0);
    contain: paint;
}

.feature-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, 
        transparent, 
        rgba(255, 255, 255, 0.4), 
        transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
    will-change: transform;
}

.feature-card:hover::before {
    transform: translateX(100%);
}

.feature-card:hover {
    transform: translateY(-8px) translateZ(0);
    border-color: rgba(225, 29, 72, 0.2);
    box-shadow: 
        0 20px 30px -10px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(225, 29, 72, 0.1);
}

.feature-card i {
    font-size: 1.75rem;
    color: rgb(225 29 72);
    margin-bottom: 1.25rem;
    transition: all 0.3s ease;
    display: inline-block;
    will-change: transform, color;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.feature-card:hover i {
    transform: scale(1.1) rotate(5deg) translateZ(0);
    color: rgb(190 18 60);
}

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: rgb(15, 23, 42);
    margin-bottom: 0.75rem;
    transition: color 0.3s ease;
}

.feature-card:hover h3 {
    color: rgb(225 29 72);
}

.feature-card p {
    color: rgb(100, 116, 139);
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

/* Enhanced CTA Section */
.services-cta {
    background: linear-gradient(135deg, 
        rgba(248, 250, 252, 0.8), 
        rgba(255, 255, 255, 0.9));
    border-top: 1px solid rgba(226, 232, 240, 0.5);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, rgb(225 29 72), rgb(190 18 60));
    color: white;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 4px 6px -1px rgba(225, 29, 72, 0.2),
        0 2px 4px -1px rgba(225, 29, 72, 0.1);
    will-change: transform, opacity;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.2), 
        transparent);
    transition: left 0.6s ease;
    will-change: left;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px) translateZ(0);
    box-shadow: 
        0 12px 20px -6px rgba(225, 29, 72, 0.3),
        0 4px 6px -2px rgba(225, 29, 72, 0.2);
}

.btn-primary i {
    transition: transform 0.3s ease;
    will-change: transform;
}

.btn-primary:hover i {
    transform: translateX(4px) translateZ(0);
}

/* Animations */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px) translateZ(0);
    }
    to {
        opacity: 1;
        transform: translateY(0) translateZ(0);
    }
}

/* Scroll Reveal Animation */
.scroll-reveal {
    --delay: 0s;
    opacity: 0;
    transform: translateY(30px) translateZ(0);
    animation: fadeUp 0.6s ease-out forwards;
    animation-delay: var(--delay);
    will-change: transform, opacity;
}

/* Responsive Enhancements */
@media (max-width: 768px) {
    .services-hero {
        padding-top: 1rem;
    }
    
    .services-hero h1 {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    .services-hero p {
        font-size: 1.125rem;
        padding: 0 1rem;
    }
    
    .service-header h2 {
        font-size: 1.875rem;
    }
    
    .feature-card {
        padding: 1.5rem;
    }
    
    .service-features {
        gap: 1rem;
    }
}

/* Performance Optimizations */
.feature-card,
.btn-primary {
    will-change: transform;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .services-hero-pattern,
    .feature-card::before,
    .btn-primary::before {
        animation: none;
        transition: none;
    }
    
    .feature-card:hover,
    .btn-primary:hover {
        transform: none;
    }
}

/* Two Column Layout Styles */
.service-vision {
    padding: 2rem;
}

.service-interactive-card {
    transition: transform 0.3s ease;
    will-change: transform;
    backface-visibility: hidden;
}

.feature-card {
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.card-overlay {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    will-change: opacity;
    contain: paint;
}

.feature-card:hover .card-overlay {
    opacity: 1;
}

/* Modal Styles */
.solutions-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    will-change: opacity, transform;
    backface-visibility: hidden;
}

.solutions-modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    position: relative;
    background: white;
    margin: auto;
    padding: 2rem;
    border-radius: 16px;
    max-width: 800px;
    width: 90%;
    transform: translateY(-20px) translateZ(0);
    transition: transform 0.3s ease;
    will-change: transform, opacity;
    backface-visibility: hidden;
}

.solutions-modal.active .modal-content {
    transform: translateY(0) translateZ(0);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: rgb(100, 116, 139);
    transition: color 0.3s ease;
    will-change: color, transform;
    backface-visibility: hidden;
}

.modal-close:hover {
    color: rgb(225, 29, 72);
}

.modal-title {
    font-size: 2rem;
    font-weight: 700;
    color: rgb(15, 23, 42);
    margin-bottom: 2rem;
    text-align: center;
}

.modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.modal-feature {
    padding: 1.5rem;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s ease;
    will-change: transform, opacity;
    backface-visibility: hidden;
}

.modal-feature:hover {
    transform: translateY(-4px) translateZ(0);
    border-color: rgba(225, 29, 72, 0.2);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Alternating Layout Styles */
.service-section {
    opacity: 0;
    transform: translateY(20px) translateZ(0);
    animation: fadeInUp 0.6s ease-out forwards;
    will-change: transform, opacity;
    backface-visibility: hidden;
}

.service-interactive-card {
    position: relative;
}

@media (max-width: 768px) {
    .service-vision {
        order: -1; /* Always show vision statement first on mobile */
    }
}

/* Enhanced card styles for better visibility */
.feature-card {
    border: 1px solid rgba(226, 232, 240, 0.8);
    transform: translateY(0) translateZ(0);
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-8px) translateZ(0);
    border-color: rgba(225, 29, 72, 0.2);
    box-shadow: 
        0 20px 30px -10px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(225, 29, 72, 0.1);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px) translateZ(0);
    }
    to {
        opacity: 1;
        transform: translateY(0) translateZ(0);
    }
} 

/* Services detail pages layout */
.services-detail .modal-content {
    max-width: 1280px;
    padding: 1.5rem 2rem; /* further reduced vertical padding */
}

.services-detail .service-overview {
    max-width: 1000px;
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 1rem; /* even tighter spacing */
}

.services-detail .overview-text {
    max-width: 1000px;
}

.services-detail .categories-grid {
    max-width: 1000px;
    margin-left: 0;
    margin-right: 0;
}

/* Tighter spacing between categories */
.services-detail .category-section { margin-bottom: 1rem; }

/* Compress category list spacing (no horizontal line) */
.services-detail .category-title { margin-bottom: 0.75rem; font-weight: 700; }
.services-detail .category-list { margin: 0; }
.services-detail .category-item { border-bottom: none; margin-bottom: 0.25rem; padding-bottom: 0.25rem; }
.services-detail .category-item-header { padding: 0.2rem 0; }
.services-detail .category-item.active .category-item-header { padding-bottom: 0.15rem; }
.services-detail .category-item-description { margin-top: 0; padding: 0; }
.services-detail .category-item.active .category-item-description { padding: 0.35rem 0; max-height: 220px; }

/* Elegant back link button */
.services-detail .back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    border: 1px solid rgba(148, 163, 184, 0.35); /* slate-400 */
    border-radius: 0.5rem;
    color: #475569; /* slate-600 */
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    transition: color 180ms ease, border-color 180ms ease, box-shadow 200ms ease, transform 180ms ease, background-color 180ms ease;
    position: relative;
    z-index: 10; /* Ensure it's above other elements */
    text-decoration: none;
}
.services-detail .back-link i { 
    transition: transform 180ms ease; 
}
.services-detail .back-link:hover {
    color: #e11d48; /* rose-600 */
    border-color: rgba(225, 29, 72, 0.35);
    box-shadow: 0 8px 18px -6px rgba(225, 29, 72, 0.22);
    transform: translateY(-1px);
    text-decoration: none;
}
.services-detail .back-link:hover i { 
    transform: translateX(-3px); 
}
.services-detail .back-link:active { 
    transform: translateY(0); 
}

@media (min-width: 1024px) {
    .services-detail .categories-grid {
        max-width: 1200px;
    }
    .services-detail .overview-text {
        max-width: 1100px;
    }
} 

/* Two-column category sections on detail pages */
.services-detail .categories-two-col {
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    gap: 2rem;
    align-items: start;
}

.services-detail .categories-content { min-width: 0; }

.services-detail .categories-media .category-media {
    position: sticky;
    top: 6rem;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 12px 24px -12px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
    background: #f8fafc;
    aspect-ratio: 3 / 4; /* portrait */
}

.services-detail .categories-media .category-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 240ms ease;
}

.services-detail .categories-media .category-media img.is-fading {
    opacity: 0;
}

@media (max-width: 1024px) {
    .services-detail .categories-two-col {
        grid-template-columns: 1fr;
    }
    .services-detail .categories-media .category-media {
        position: relative;
        top: 0;
        margin-top: 1rem;
        aspect-ratio: 4 / 3; /* wider on mobile */
    }
} 

/* --- Service Row Enhancements --- */
.service-row-card {
    border: 1px solid rgba(226, 232, 240, 0.8);
    transition: transform 240ms cubic-bezier(0.22, 0.61, 0.36, 1), box-shadow 240ms ease, border-color 240ms ease;
    will-change: transform, box-shadow;
}
.service-row-card:hover {
    transform: translateY(-2px);
    border-color: rgba(148, 163, 184, 0.35);
    box-shadow: 0 14px 24px -12px rgba(15, 23, 42, 0.14), 0 1px 6px rgba(15, 23, 42, 0.06);
}
.service-row-icon {
    transition: transform 240ms ease, background-color 240ms ease, color 240ms ease;
}
.service-row-card:hover .service-row-icon {
    transform: scale(1.05);
    background-color: rgba(225, 29, 72, 0.12);
    color: rgb(190, 18, 60);
}
.service-row-title {
    letter-spacing: -0.01em;
}
.service-row-desc {
    font-size: 1.0625rem;
}
.inline-highlight {
    background: none;
    padding: 0;
}

/* Enter animation per row */
.service-section { opacity: 0; transform: translateY(20px); }
.service-section { animation: serviceRowFadeUp 520ms cubic-bezier(0.22, 0.61, 0.36, 1) forwards; }
.service-section:nth-child(1) { animation-delay: 60ms; }
.service-section:nth-child(2) { animation-delay: 120ms; }
.service-section:nth-child(3) { animation-delay: 180ms; }
.service-section:nth-child(4) { animation-delay: 240ms; }
.service-section:nth-child(5) { animation-delay: 300ms; }
.service-section:nth-child(6) { animation-delay: 360ms; }
@keyframes serviceRowFadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
} 

/* Service row unique accents */
.accent-rose .service-row-icon { background-color: #fff1f2; color: #e11d48; }
.accent-violet .service-row-icon { background-color: #f5f3ff; color: #7c3aed; }
.accent-sky .service-row-icon { background-color: #f0f9ff; color: #0284c7; }
.accent-slate .service-row-icon { background-color: #f1f5f9; color: #0f172a; }
.accent-amber .service-row-icon { background-color: #fffbeb; color: #b45309; }
.accent-emerald .service-row-icon { background-color: #ecfdf5; color: #047857; }

/* Highlights list */
.service-highlights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.375rem 0.75rem;
  margin: 0.25rem 0 0.25rem;
  padding: 0;
  list-style: none;
}
.service-highlight {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.5rem;
  color: #0f172a;
  font-weight: 500;
}
.service-highlight i {
  flex-shrink: 0;
  margin-top: 0.2rem;
  color: #0ea5e9;
}
.service-highlight span { color: #334155; font-weight: 500; }

/* Meta info removed for simplified, modern layout */
.service-meta { display: none; }
.service-meta-item { display: none; }

/* Hover polish */
.service-row-card:hover .service-row-title { color: #0f172a; }
.service-row-card:hover .service-highlights .service-highlight i { transform: none; }

/* Reduce motion respect */
@media (prefers-reduced-motion: reduce) {
  .service-row-card, .service-row-icon, .service-highlight i {
    transition: none !important;
  }
} 

/* Background decorative icon for service rows */
.service-row-card { position: relative; overflow: hidden; }
.service-row-decor {
  position: absolute;
  top: 50%;
  right: 1rem;
  transform: translateY(-50%);
  opacity: 0.06;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}
.service-row-decor i {
  font-size: 12rem;
  line-height: 1;
  color: #0f172a; /* base slate */
}
@media (max-width: 768px) {
  .service-row-decor i { font-size: 8rem; }
  .service-row-decor { right: 0.5rem; }
} 

/* Services 2x3 grid */
.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 1024px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
} 

/* Service row structure for consistent footer button */
.service-row-card { display: flex; flex-direction: column; min-height: 100%; }
.service-row-body { flex: 1 1 auto; }
.service-row-footer { display: flex; justify-content: flex-end; margin-top: 0.5rem; }

/* Tighter preview spacing */
.service-row-desc { margin-bottom: 0.25rem; }
.service-highlights { margin-top: 0.25rem; } 

/* Primary button: subtle size reduction for services page */
.services-main .btn-primary {
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  border-radius: 10px;
}
.services-main .btn-primary i { font-size: 0.9em; }

/* Smooth scroll reveal for service sections */
.service-section { opacity: 0; transform: translateY(16px); }
.service-section.is-visible { opacity: 1; transform: translateY(0); }
.service-section { transition: opacity 420ms cubic-bezier(0.22, 0.61, 0.36, 1), transform 420ms cubic-bezier(0.22, 0.61, 0.36, 1); }

/* Stagger effect via nth-child delays on desktop */
@media (min-width: 1024px) {
  .services-grid .service-section:nth-child(1) { transition-delay: 40ms; }
  .services-grid .service-section:nth-child(2) { transition-delay: 80ms; }
  .services-grid .service-section:nth-child(3) { transition-delay: 120ms; }
  .services-grid .service-section:nth-child(4) { transition-delay: 160ms; }
  .services-grid .service-section:nth-child(5) { transition-delay: 200ms; }
  .services-grid .service-section:nth-child(6) { transition-delay: 240ms; }
}

@media (prefers-reduced-motion: reduce) {
  .service-section { transition: none !important; opacity: 1 !important; transform: none !important; }
} 

/* Subtle hint animation in service detail pages */
.services-detail .categories-content.show-hints .category-item-header span::after {
  content: '';
  display: inline-block;
  margin-left: 0.5rem;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid rgba(100,116,139,0.7);
  border-bottom: 2px solid rgba(100,116,139,0.7);
  transform: rotate(-45deg);
  opacity: 0.7;
  animation: hintNudge 1400ms ease-in-out infinite;
}

@keyframes hintNudge {
  0% { transform: translateX(0) rotate(-45deg); opacity: 0.7; }
  40% { transform: translateX(2px) rotate(-45deg); opacity: 0.9; }
  60% { transform: translateX(0) rotate(-45deg); opacity: 0.7; }
  100% { transform: translateX(0) rotate(-45deg); opacity: 0.7; }
}

@media (prefers-reduced-motion: reduce) {
  .services-detail .categories-content.show-hints .category-item-header span::after {
    animation: none;
  }
} 