/**
 * CodesinoDev-Style Hero Styles for Devv Plug Tech
 * 
 * Split-screen hero with animated orbs, particles, depth cards,
 * and smooth transitions. Maintains Devv Plug Tech color scheme.
 * 
 * Color Palette:
 * - Primary: #0A2463 (Navy Blue)
 * - Accent: #3A86FF (Light Blue)
 * - Success: #10B981 (Green)
 * - Background: #0F172A (Dark Navy)
 * - Text: #FFFFFF
 * 
 * @author Devv Plug Tech
 * @version 1.0.0
 */

/* ============================================
   1. BASE HERO CONTAINER
   ============================================ */

.cs-hero {
    position: relative;
    width: 100%;
    min-height: 100vh;
    background: linear-gradient(135deg, #0F172A 0%, #0A2463 100%);
    overflow: visible; /* Changed from hidden to allow proper flow */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 0 80px; /* Reduced from 120px to 60px */
    z-index: 1; /* Ensure hero stays below next sections */
}

/* ============================================
   2. BACKGROUND EFFECTS
   ============================================ */

/* Mesh Gradient Background */
.cs-hero-mesh {
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(
            circle at 20% 80%, 
            rgba(58, 134, 255, 0.15) 0%, 
            transparent 50%
        ),
        radial-gradient(
            circle at 80% 20%, 
            rgba(16, 185, 129, 0.1) 0%, 
            transparent 50%
        );
    pointer-events: none;
    z-index: 1;
}

/* Grid Overlay */
.cs-grid {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 2;
}

/* ============================================
   3. ANIMATED ORBS
   ============================================ */

.cs-orb {
    position: absolute;
    width: calc(100px + var(--i) * 20px);
    height: calc(100px + var(--i) * 20px);
    border-radius: 50%;
    background: radial-gradient(
        circle at 30% 30%,
        rgba(58, 134, 255, 0.3),
        rgba(16, 185, 129, 0.1)
    );
    filter: blur(40px);
    opacity: calc(0.3 + var(--i) * 0.02);
    animation: orbit calc(30s + var(--i) * 3s) linear infinite;
    pointer-events: none;
    z-index: 3;
}

/* Position orbs strategically */
.cs-orb:nth-child(3) { top: 10%; left: 5%; }
.cs-orb:nth-child(4) { top: 20%; right: 10%; }
.cs-orb:nth-child(5) { top: 60%; left: 15%; }
.cs-orb:nth-child(6) { top: 80%; right: 20%; }
.cs-orb:nth-child(7) { top: 40%; right: 5%; }
.cs-orb:nth-child(8) { top: 70%; left: 8%; }
.cs-orb:nth-child(9) { top: 30%; left: 25%; }
.cs-orb:nth-child(10) { top: 50%; right: 25%; }
.cs-orb:nth-child(11) { top: 15%; left: 40%; }
.cs-orb:nth-child(12) { top: 85%; right: 35%; }
.cs-orb:nth-child(13) { top: 45%; left: 50%; }
.cs-orb:nth-child(14) { top: 25%; right: 45%; }
.cs-orb:nth-child(15) { top: 65%; left: 30%; }
.cs-orb:nth-child(16) { top: 55%; right: 15%; }
.cs-orb:nth-child(17) { top: 35%; left: 70%; }
.cs-orb:nth-child(18) { top: 75%; right: 60%; }

@keyframes orbit {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(50px, -30px) scale(1.1);
    }
    50% {
        transform: translate(30px, 50px) scale(0.9);
    }
    75% {
        transform: translate(-40px, 20px) scale(1.05);
    }
}

/* ============================================
   4. GLOW TRACKING (Mouse Follow)
   ============================================ */

.cs-glow-track {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(58, 134, 255, 0.15) 0%,
        transparent 70%
    );
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
    z-index: 4;
    opacity: 0;
}

.cs-hero:hover .cs-glow-track {
    opacity: 1;
}

/* ============================================
   5. PARTICLE CANVAS
   ============================================ */

#cs-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 5;
}

/* ============================================
   6. MAIN CONTENT CONTAINER
   ============================================ */

.cs-inner {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 40px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}

/* ============================================
   7. LEFT CONTENT AREA
   ============================================ */

.cs-left {
    color: #ffffff;
}

/* Badge */
.cs-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 24px;
    position: relative;
    z-index: 20; /* Ensure badge stays above header */
}

.cs-badge svg {
    width: 14px;
    height: 14px;
    stroke: #3A86FF;
}

/* Headline */
.cs-headline {
    font-family: 'Montserrat', sans-serif;
    font-size: 72px;
    font-weight: 700;
    line-height: 1.1;
    margin: 0 0 32px;
}

.cs-headline .cs-accent {
    background: linear-gradient(135deg, #3A86FF 0%, #10B981 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Description */
.cs-description {
    font-size: 20px;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
    max-width: 640px;
    margin: 0 0 40px;
}

/* Stats */
.cs-stats {
    display: flex;
    gap: 40px;
    margin: 0 0 40px;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards 0.8s;
}

.cs-stat {
    text-align: left;
}

.cs-stat-number {
    font-family: 'Montserrat', sans-serif;
    font-size: 48px;
    font-weight: 700;
    color: #10B981;
    line-height: 1;
    margin-bottom: 8px;
}

.cs-stat-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.6);
}

/* CTA Buttons */
.cs-cta-buttons {
    display: flex;
    gap: 16px;
    position: relative;
    z-index: 15; /* Ensure buttons stay above other sections */
}

/* Fade In Up Animation */
@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   8. RIGHT SLIDER AREA
   ============================================ */

.cs-right {
    position: relative;
    padding: 40px 0;
}

/* Depth Cards Container */
.cs-card-wrap {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

/* Depth Cards (3D Effect) */
.cs-depth-card {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease;
}

.cs-depth-card-1 {
    transform: translateZ(-20px) scale(0.95);
    opacity: 0.6;
    z-index: 1;
}

.cs-depth-card-2 {
    transform: translateZ(-40px) scale(0.9);
    opacity: 0.3;
    z-index: 0;
}

/* Active Slide */
.cs-slide-active {
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    overflow: hidden;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 2;
    transition: all 0.4s ease;
}

.cs-slide-active:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.4);
}

/* Slide Image */
.cs-slide-image {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.cs-slide-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease, opacity 0.4s ease, filter 0.4s ease;
}

.cs-slide-active:hover .cs-slide-image img {
    transform: scale(1.05);
}

/* Missing slide image: degrade to the brand gradient instead of an empty void.
   Driven by the .is-fallback class that hero-slider.js toggles per slide, so the
   shared <img> is never left permanently hidden by a sticky inline style. */
.cs-slide-image.is-fallback {
    background: linear-gradient(135deg, #0A2463 0%, #3A86FF 100%);
}

.cs-slide-image.is-fallback img {
    display: none;
}

/* Image Overlay */
.cs-img-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(10, 36, 99, 0.8) 100%
    );
    pointer-events: none;
}

/* Tag */
.cs-tag {
    position: absolute;
    top: 20px;
    left: 20px;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #ffffff;
}

/* Slide Body */
.cs-slide-body {
    padding: 32px;
    color: #ffffff;
}

.cs-slide-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 16px;
    color: #ffffff;
}

.cs-slide-desc {
    font-size: 16px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

/* ============================================
   9. CUSTOM CONTROLS
   ============================================ */

.cs-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-top: 32px;
    position: relative;
    z-index: 15; /* Ensure controls stay above other sections */
}

.cs-control-prev,
.cs-control-next {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #ffffff;
}

.cs-control-prev:hover,
.cs-control-next:hover {
    background: rgba(58, 134, 255, 0.2);
    border-color: #3A86FF;
    transform: scale(1.1);
}

.cs-control-prev svg,
.cs-control-next svg {
    width: 20px;
    height: 20px;
}

/* Counter */
.cs-counter {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
}

.cs-current {
    color: #3A86FF;
}

.cs-separator {
    color: rgba(255, 255, 255, 0.3);
}

.cs-total {
    color: rgba(255, 255, 255, 0.5);
}

/* Legacy slider markup (hero-slider.css / hero-slider.js).
   The <ul class="hero-slider-list"> is kept in the DOM only as a data source
   (data-title / data-desc / data-image attributes), but hero-slider.css gives it
   height:100% and hero-slider.js forces the first item to position:static, so it
   stays in the layout flow *below* the visible card. That made .cs-hero a scroll
   container with ~900px of hidden overflow (a big empty dark area under the
   prev/next controls on touch devices). Taken out of the layout here; the visible
   slide is rendered by .cs-slide-active. */
.cs-hero .hero-slider-list,
.cs-hero .hero-slider-item {
    display: none;
}

/* ============================================
   10. RESPONSIVE DESIGN
   ============================================ */

/* Large Desktop (1200px+) - Default styles above */

/* Tablet and Small Desktop (768px - 1199px) */
@media (max-width: 1199px) {
    .cs-hero {
        min-height: auto;
        padding: 100px 0 60px;
    }
    
    /* Let the section hug its content so no empty dark band remains
       above/below the prev & next controls on tablet (desktop untouched) */
    .hero-slider.cs-hero {
        height: auto;
    }
    
    .cs-inner {
        grid-template-columns: 1fr;
        gap: 60px;
        padding: 0 32px;
        max-width: 100%;
    }
    
    .cs-left {
        text-align: center;
        max-width: 800px;
        margin: 0 auto;
    }
    
    .cs-headline {
        font-size: 48px;
        line-height: 1.2;
    }
    
    .cs-description {
        font-size: 18px;
        max-width: 100%;
        margin: 0 auto 32px;
    }
    
    .cs-badge {
        justify-content: center;
        margin: 0 auto 24px;
    }
    
    .cs-cta-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .cs-right {
        max-width: 600px;
        margin: 0 auto;
        width: 100%;
        padding: 0; /* Remove default 40px top/bottom padding */
    }
    
    .cs-card-wrap {
        height: 400px;
    }
    
    .cs-controls {
        margin-top: 12px; /* Reduced top spacing above prev/next controls */
        margin-bottom: 0;
        padding-top: 0;   /* Remove vertical padding around controls */
        padding-bottom: 0;
    }
    
    /* Prev / Next buttons: no extra top & bottom padding on tablet */
    .cs-control-prev,
    .cs-control-next {
        padding-top: 0;
        padding-bottom: 0;
        margin-top: 0;
        margin-bottom: 0;
    }
    
    .cs-card-wrap {
        padding-bottom: 8px; /* Tighten gap between slide card and controls */
    }
}

/* Mobile (< 768px) */
@media (max-width: 767px) {
    .cs-hero {
        min-height: auto;
        padding: 70px 0 20px; /* Reduced bottom padding from 40px to 20px */
        overflow: visible;
        display: block; /* Changed from flex to prevent vertical centering issues */
    }
    
    /* Remove the fixed viewport height on mobile so the controls row keeps
       no extra space above/below it */
    .hero-slider.cs-hero {
        height: auto;
    }
    
    .cs-inner {
        padding: 20px 20px 0; /* Add top padding */
        gap: 40px;
        display: flex;
        flex-direction: column;
    }
    
    .cs-left {
        text-align: center;
        padding-top: 0;
    }
    
    .cs-badge {
        font-size: 10px;
        padding: 6px 12px;
        gap: 6px;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        position: relative;
        z-index: 100000;
        margin-top: 0;
        margin-bottom: 16px;
    }
    
    .cs-badge svg {
        width: 12px;
        height: 12px;
        flex-shrink: 0;
    }
    
    .cs-badge span {
        font-size: 9px;
    }
    
    .cs-headline {
        font-size: 32px;
        line-height: 1.3;
        margin-bottom: 20px;
    }
    
    .cs-description {
        font-size: 16px;
        line-height: 1.6;
        margin-bottom: 24px;
        max-width: 100%;
    }
    
    .cs-cta-buttons {
        flex-direction: column;
        width: 100%;
        gap: 12px;
    }
    
    .btn-w240 {
        width: 100% !important;
        max-width: 100%;
    }
    
    .cs-right {
        width: 100%;
        max-width: 100%;
        padding: 0; /* Remove default 40px top/bottom padding */
    }
    
    .cs-card-wrap {
        height: auto; /* Changed from fixed height */
        width: 100%;
        position: relative;
        padding-bottom: 4px; /* Minimal space for controls */
    }
    
    .cs-depth-card-1,
    .cs-depth-card-2 {
        display: none; /* Hide depth cards on mobile for cleaner look */
    }
    
    .cs-slide-active {
        width: 100%;
        max-width: 100%;
        position: relative;
    }
    
    .cs-slide-image {
        height: 250px;
    }
    
    .cs-slide-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .cs-slide-title {
        font-size: 20px;
        margin-bottom: 8px;
    }
    
    .cs-slide-desc {
        font-size: 14px;
    }
    
    .cs-slide-body {
        padding: 20px;
    }
    
    .cs-controls {
        margin-top: 4px; /* Reduced top spacing above prev/next controls */
        margin-bottom: 0;
        gap: 16px;
        position: relative; /* Changed from absolute */
        bottom: auto; /* Reset positioning */
        left: auto;
        right: auto;
        width: 100%;
        padding: 0; /* No vertical padding around controls on mobile */
    }
    
    /* Prev / Next buttons: reduced top & bottom padding on mobile */
    .cs-control-prev,
    .cs-control-next {
        width: 40px;
        height: 40px;
        padding-top: 0;
        padding-bottom: 0;
        margin-top: 0;
        margin-bottom: 0;
    }
    
    .cs-counter {
        font-size: 16px;
    }
    
    /* Hide orbs on mobile for performance */
    .cs-orb {
        display: none;
    }
    
    /* Reduce particle count on mobile */
    #cs-particles {
        opacity: 0.3;
    }
}

/* Very Small Mobile (< 375px) */
@media (max-width: 374px) {
    .cs-headline {
        font-size: 28px;
    }
    
    .cs-description {
        font-size: 14px;
    }
    
    .cs-badge span {
        font-size: 8px;
    }
    
    .cs-slide-image {
        height: 200px;
    }
}

/* ============================================
   11. PERFORMANCE OPTIMIZATIONS
   ============================================ */

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .cs-orb,
    .cs-glow-track,
    #cs-particles {
        animation: none;
        transition: none;
    }
    
    .cs-badge,
    .cs-headline,
    .cs-description,
    .cs-stats,
    .cs-cta-buttons {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

/* GPU Acceleration */
.cs-slide-active,
.cs-depth-card,
.cs-control-prev,
.cs-control-next {
    will-change: transform;
    transform: translateZ(0);
}

/* ============================================
   CS HERO TRANSITION ANIMATION
   ============================================ */

.cs-transitioning .cs-headline,
.cs-transitioning .cs-description,
.cs-transitioning .cs-badge {
  animation: csSlideContentFade 0.8s ease-out;
}

@keyframes csSlideContentFade {
  0% {
    opacity: 0.7;
    transform: translateY(10px);
  }
  50% {
    opacity: 0.85;
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Depth cards scale animation during transition */
.cs-transitioning .cs-depth-card-1 {
  animation: csDepthCardTransition1 0.8s ease-out;
}

.cs-transitioning .cs-depth-card-2 {
  animation: csDepthCardTransition2 0.8s ease-out;
}

@keyframes csDepthCardTransition1 {
  0% {
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0.8;
  }
  100% {
    transform: translate(-50%, -50%) scale(0.95);
    opacity: 1;
  }
}

@keyframes csDepthCardTransition2 {
  0% {
    transform: translate(-50%, -50%) scale(0.85);
    opacity: 0.7;
  }
  100% {
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 1;
  }
}


/* ============================================
   ADDITIONAL RESPONSIVE FIXES
   ============================================ */

/* Ensure canvas doesn't overflow */
#cs-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Ensure proper spacing on mobile */
@media (max-width: 767px) {
    .cs-hero {
        /* clip (not hidden): overflow-x:hidden would force overflow-y to auto and
           turn the section into a scroll container again */
        overflow-x: clip;
        overflow-y: visible;
    }
    
    body {
        overflow-x: hidden;
    }
    
    /* Ensure buttons don't cause horizontal scroll */
    .cs-cta-buttons .btn {
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* Ensure text doesn't overflow */
    .cs-headline,
    .cs-description {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
}

/* Fix for very small screens */
@media (max-width: 374px) {
    .cs-inner {
        padding: 0 16px;
    }
    
    .cs-badge {
        max-width: calc(100% - 32px);
    }
}


/* ============================================
   BUTTON STYLING OVERRIDES
   ============================================ */

/* Border button style for Schedule Meeting */
.cs-cta-buttons .btn-border {
    background: transparent !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    color: #ffffff !important;
    transition: all 0.3s ease;
}

.cs-cta-buttons .btn-border:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: #ffffff !important;
    transform: translateY(-2px);
}

.cs-cta-buttons .btn-border:active {
    transform: translateY(0);
}

/* Ensure calendar icon visibility */
.cs-cta-buttons .btn-border .btn-icon-right {
    fill: currentColor;
}
