/* ═══════════════════════════════════════════════════════════════
   KAVASOGLU - GSAP ANIMATIONS STYLES
   Process Timeline | Gear Animations | Vites Transitions
   ═══════════════════════════════════════════════════════════════ */

/* ─── PROCESS SECTION ─── */
.process-section {
    position: relative;
    background: var(--bg-secondary);
    padding: var(--space-xxl) 0;
    overflow: hidden;
}

.process-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--metal-mid), transparent);
}

/* Process Timeline */
.process-timeline {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
    margin-top: var(--space-xl);
}

/* Timeline Connecting Line */
.timeline-line {
    position: absolute;
    top: 45px;
    left: 12.5%;
    right: 12.5%;
    height: 2px;
    background: var(--metal-dark);
    z-index: 0;
}

.timeline-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: var(--accent);
    transition: width 0.5s ease;
    box-shadow: 0 0 10px var(--accent-glow);
}

/* Process Step */
.process-step {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    opacity: 0;
    transform: translateY(30px);
}

.process-step.visible {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Step Connector */
.step-connector {
    position: relative;
    margin-bottom: var(--space-lg);
}

.connector-dot {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 2px solid var(--metal-mid);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s ease;
    position: relative;
}

.process-step.active .connector-dot,
.process-step.completed .connector-dot {
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

.dot-inner {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--metal-mid);
    transition: all 0.4s ease;
}

.process-step.active .dot-inner,
.process-step.completed .dot-inner {
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
}

.connector-number {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--metal-mid);
    letter-spacing: 2px;
    transition: color 0.4s ease;
}

.process-step.active .connector-number,
.process-step.completed .connector-number {
    color: var(--accent);
}

/* Step Content */
.step-content {
    max-width: 220px;
}

.step-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto var(--space-md);
    color: var(--metal-silver);
    transition: color 0.4s ease;
}

.step-icon svg {
    width: 100%;
    height: 100%;
}

.process-step.active .step-icon,
.process-step.completed .step-icon {
    color: var(--accent);
}

.step-title {
    font-family: var(--font-display);
    font-size: 1rem;
    letter-spacing: 2px;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.step-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-md);
}

.step-time {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--metal-silver);
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-primary);
    border: 1px solid var(--metal-dark);
    border-radius: var(--radius-sm);
}

.time-icon {
    font-size: 0.8rem;
}

/* Process Stats */
.process-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xl);
    margin-top: var(--space-xxl);
    padding: var(--space-xl);
    background: var(--bg-primary);
    border: 1px solid var(--metal-dark);
    border-left: 3px solid var(--accent);
}

.pstat-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.pstat-icon {
    font-size: 2rem;
}

.pstat-content {
    display: flex;
    flex-direction: column;
}

.pstat-number {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
}

.pstat-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 1px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.pstat-divider {
    width: 1px;
    height: 50px;
    background: var(--metal-dark);
}

/* Responsive Process */
@media (max-width: 1024px) {
    .process-timeline {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-xl);
    }
    
    .timeline-line {
        display: none;
    }
}

@media (max-width: 768px) {
    .process-timeline {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
    
    .process-step {
        flex-direction: row;
        text-align: left;
        gap: var(--space-lg);
    }
    
    .step-connector {
        margin-bottom: 0;
        flex-shrink: 0;
    }
    
    .step-content {
        max-width: none;
    }
    
    .step-icon {
        margin: 0 0 var(--space-sm) 0;
        width: 36px;
        height: 36px;
    }
    
    .process-stats {
        flex-direction: column;
        gap: var(--space-lg);
    }
    
    .pstat-divider {
        width: 100%;
        height: 1px;
    }
}

/* Exploded View Container */
.exploded-view-container {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Engine Blueprint SVG */
.engine-blueprint {
    width: 100%;
    max-width: 900px;
    height: auto;
    filter: drop-shadow(0 0 20px rgba(255, 69, 0, 0.1));
}

/* Engine Parts */
.engine-part {
    cursor: pointer;
    transition: filter 0.3s ease;
    will-change: transform, opacity;
}

.engine-part:hover {
    filter: url(#glow);
}

.engine-part:hover .part-outline {
    stroke-width: 3;
}

.engine-part .part-outline {
    transition: stroke-width 0.3s ease;
}

/* Part Labels */
.part-label {
    font-family: var(--font-mono);
    font-size: 10px;
    fill: var(--metal-silver);
    letter-spacing: 1px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.engine-part:hover .part-label,
.engine-part.active .part-label {
    opacity: 1;
}

.dimension-text {
    font-family: var(--font-mono);
    font-size: 8px;
    fill: var(--metal-mid);
}

/* Part Info Panel */
.part-info-panel {
    position: absolute;
    top: var(--space-lg);
    right: var(--space-lg);
    width: 280px;
    background: rgba(26, 26, 26, 0.95);
    border: 1px solid var(--metal-dark);
    border-left: 3px solid var(--accent);
    backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.3s ease;
}

.part-info-panel.visible {
    opacity: 1;
    transform: translateX(0);
}

.panel-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    border-bottom: 1px solid var(--metal-dark);
}

.panel-icon {
    color: var(--accent);
}

.panel-title {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 2px;
    color: var(--metal-silver);
}

.panel-content {
    padding: var(--space-md);
}

.panel-content h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.panel-content p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Scroll Progress */
.scroll-progress {
    position: absolute;
    bottom: var(--space-lg);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    z-index: 10;
}

.progress-bar {
    width: 200px;
    height: 4px;
    background: var(--metal-dark);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--metal-mid);
}

.progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.05s linear;
    box-shadow: 0 0 10px var(--accent-glow);
}

.progress-text {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 3px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.progress-text::before {
    content: '◆';
    color: var(--accent);
    font-size: 0.5rem;
    animation: pulse 2s ease infinite;
}

.progress-percent {
    color: var(--accent);
    font-weight: 500;
    min-width: 35px;
    text-align: right;
}

/* ─── VITES (GEAR SHIFT) MENU TRANSITIONS ─── */
.nav-link {
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: none;
}

.nav-link.shifting::before {
    left: auto;
}

/* Gear Shift Indicator */
.gear-shift-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 100px;
    height: 100px;
    pointer-events: none;
    z-index: 9998;
    opacity: 0;
}

.gear-shift-indicator.active {
    animation: gearShift 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes gearShift {
    0% {
        transform: translate(-50%, -50%) scale(0) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2) rotate(45deg);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(0) rotate(90deg);
        opacity: 0;
    }
}

.gear-shift-indicator svg {
    width: 100%;
    height: 100%;
    color: var(--accent);
}

/* ─── PAGE TRANSITION OVERLAY ─── */
.page-transition {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    z-index: 9997;
    pointer-events: none;
    clip-path: polygon(0 0, 0 0, 0 100%, 0 100%);
}

.page-transition.active {
    animation: wipeTransition 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes wipeTransition {
    0% {
        clip-path: polygon(0 0, 0 0, 0 100%, 0 100%);
    }
    50% {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
    100% {
        clip-path: polygon(100% 0, 100% 0, 100% 100%, 100% 100%);
    }
}

/* ─── MECHANICAL BUTTON EFFECTS ─── */
.btn {
    position: relative;
    overflow: hidden;
}

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

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

/* Mechanical click effect */
.btn.clicked {
    animation: mechanicalPress 0.15s ease;
}

@keyframes mechanicalPress {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

/* ─── SERVICE CARDS REVEAL ─── */
.service-card {
    clip-path: none;
}

.service-card.revealed {
    clip-path: none;
}

/* ─── HERO TITLE ANIMATION ─── */
.hero-title .title-line {
    opacity: 0;
    transform: translateX(-30px);
}

.hero-title .title-line.animate {
    opacity: 1;
    transform: translateX(0);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-title .title-line:nth-child(1).animate { transition-delay: 0.1s; }
.hero-title .title-line:nth-child(2).animate { transition-delay: 0.2s; }
.hero-title .title-line:nth-child(3).animate { transition-delay: 0.3s; }

/* ─── STATS COUNTER REVEAL ─── */
.hero-stats {
    opacity: 0;
    transform: translateY(20px);
}

.hero-stats.animate {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.5s;
}

/* ─── FLOATING GEARS ENHANCED ─── */
.floating-gears .gear-float {
    opacity: 0;
    transform: scale(0) rotate(0deg);
}

.floating-gears .gear-float.animate {
    opacity: 0.15;
    transform: scale(1) rotate(0deg);
    transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.gear-float.animate {
    animation: floatAndRotate 20s ease-in-out infinite;
}

@keyframes floatAndRotate {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-15px) rotate(90deg);
    }
    50% {
        transform: translateY(0) rotate(180deg);
    }
    75% {
        transform: translateY(15px) rotate(270deg);
    }
}

/* ─── SCROLL TRIGGERED ANIMATIONS ─── */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ─── SECTION HEADERS ─── */
.section-header .section-tag {
    opacity: 0;
    transform: translateY(10px);
}

.section-header .section-title {
    opacity: 0;
    transform: translateY(20px);
}

.section-header .section-desc {
    opacity: 0;
    transform: translateY(15px);
}

.section-header.animate .section-tag {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.5s ease 0.1s;
}

.section-header.animate .section-title {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.5s ease 0.2s;
}

.section-header.animate .section-desc {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.5s ease 0.3s;
}

/* ─── MAGNETIC HOVER EFFECT (for buttons) ─── */
.magnetic-btn {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── CURSOR TRAIL (Optional - subtle) ─── */
.cursor-trail {
    position: fixed;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
    mix-blend-mode: screen;
}

.cursor-trail.visible {
    opacity: 0.5;
}

/* ─── LOADING STATES ─── */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--metal-dark) 25%,
        var(--metal-mid) 50%,
        var(--metal-dark) 75%
    );
    background-size: 200% 100%;
    animation: skeleton 1.5s ease infinite;
}

@keyframes skeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ─── RESPONSIVE ADJUSTMENTS ─── */
@media (max-width: 1024px) {
    .blueprint-section {
        min-height: 150vh;
    }
    
    .part-info-panel {
        position: static;
        width: 100%;
        margin-top: var(--space-lg);
        opacity: 1;
        transform: none;
    }
    
    .engine-blueprint {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .blueprint-section {
        min-height: auto;
        padding: var(--space-xl) 0;
    }
    
    .blueprint-section .container {
        position: static;
        height: auto;
    }
    
    .bg-gear {
        display: none;
    }
    
    .scroll-progress {
        display: none;
    }
    
    .part-label {
        font-size: 8px;
        opacity: 1;
    }
}

/* ─── REDUCED MOTION ─── */
@media (prefers-reduced-motion: reduce) {
    .bg-gear,
    .gear-float,
    .engine-part,
    .btn::before,
    .nav-link::before {
        animation: none !important;
        transition: none !important;
    }
    
    .blueprint-section {
        min-height: auto;
    }
    
    .blueprint-section .container {
        position: static;
    }
}

/* ─── GPU OPTIMIZATION ─── */
.engine-part,
.bg-gear,
.gear-float,
.gear-shift-indicator,
.page-transition {
    will-change: transform, opacity;
    transform: translateZ(0);
    backface-visibility: hidden;
}
