/**
 * Creative Base CSS
 * Core styles for the creative overhaul animations
 */

/* ===================================
   Custom Cursor
=================================== */

.custom-cursor {
    position: fixed;
    pointer-events: none;
    z-index: 99999;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
}

.cursor-ring {
    width: 40px;
    height: 40px;
    border: 2px solid var(--primary);
    border-radius: 50%;
    transition: transform 0.2s ease, border-color 0.2s ease;
    opacity: 0.5;
}

.cursor-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
}

.cursor-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15), transparent 70%);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Cursor States */
.custom-cursor.is-hovering .cursor-ring {
    transform: scale(1.5);
    border-color: var(--accent);
}

.custom-cursor.is-hovering .cursor-glow {
    opacity: 1;
}

.custom-cursor.is-magnetic .cursor-ring {
    transform: scale(2);
}

.custom-cursor.is-clicking .cursor-ring {
    transform: scale(0.8);
}

.custom-cursor.is-btn-primary .cursor-ring {
    border-color: white;
}

.custom-cursor.is-card .cursor-ring {
    transform: scale(2);
    border-radius: 10px;
}

.custom-cursor.is-input .cursor-ring {
    transform: scale(0.5);
    border-color: var(--text-muted);
}

.custom-cursor.is-link .cursor-ring {
    transform: scale(1.3);
}

.custom-cursor.is-selecting .cursor-ring {
    border-style: dashed;
}

/* Cursor Trail */
.cursor-trail-dot {
    position: fixed;
    pointer-events: none;
    z-index: 99998;
    background: var(--primary);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

/* ===================================
   Geometric Shapes
=================================== */

.geometric-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.geometric-shape {
    position: absolute;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.geometric-shape svg {
    filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.5));
}

.geometric-shape:hover {
    opacity: 0.8;
}

/* ===================================
   Scroll Progress
=================================== */

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(99, 102, 241, 0.1);
    z-index: 10000;
}

.scroll-progress-fill {
    height: 100%;
    width: 0;
    background: var(--gradient-primary);
    transition: width 0.1s ease;
}

/* ===================================
   Ripple Effects
=================================== */

.ripple-effect {
    position: absolute;
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    animation: rippleExpand 0.6s ease-out forwards;
    pointer-events: none;
}

@keyframes rippleExpand {
    to {
        transform: translate(-50%, -50%) scale(20);
        opacity: 0;
    }
}

/* ===================================
   Particle Burst
=================================== */

.particle-burst {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    pointer-events: none;
}

/* ===================================
   Stats Progress Rings
=================================== */

/* Ensure hero-stat has positioning context */
.hero-stat {
    position: relative;
}

.stat-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90px;
    height: 90px;
    z-index: 0;
    pointer-events: none;
}

.stat-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.stat-ring .ring-bg {
    fill: none;
    stroke: rgba(99, 102, 241, 0.15);
    stroke-width: 2;
}

.stat-ring .ring-progress {
    fill: none;
    stroke: url(#ringGradient);
    stroke-width: 2;
    stroke-linecap: round;
    transition: stroke-dashoffset 2s ease;
}

/* Position the stat value above the ring */
.hero-stat-value {
    position: relative;
    z-index: 1;
}

.hero-stat-label {
    position: relative;
    z-index: 1;
}

/* ===================================
   Process Timeline Animated Line
=================================== */

.process-line-animated {
    position: absolute;
    left: 50%;
    top: 0;
    width: 2px;
    height: 0;
    background: linear-gradient(180deg, var(--primary), var(--accent));
    transform: translateX(-50%);
    z-index: 1;
}

@media (max-width: 1024px) {
    .process-line-animated {
        left: 30px;
    }
}

@media (max-width: 768px) {
    .process-line-animated {
        left: 20px;
    }
}

/* ===================================
   Terminal Response Lines
=================================== */

.terminal-response {
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* ===================================
   Quote Marks
=================================== */

.quote-marks {
    font-family: Georgia, serif;
    font-size: 4rem;
    line-height: 1;
    color: var(--primary);
    opacity: 0.2;
    position: absolute;
    top: 10px;
    left: 15px;
}

/* ===================================
   Sticky Section Badge
=================================== */

/* Disabled - was causing overlap issues
.section-badge.is-sticky {
    position: sticky;
    top: 100px;
    z-index: 10;
}
*/

/* ===================================
   Enhanced Card Styles
=================================== */

.card,
.service-card,
.testimonial-card,
.team-card {
    transform-style: preserve-3d;
    transition: transform 0.5s ease, box-shadow 0.5s ease;
}

.service-icon,
.project-overlay,
.testimonial-stars {
    transition: transform 0.5s ease;
}

/* ===================================
   Form Focus Animations
=================================== */

.form-group {
    position: relative;
}

.form-group.focused label {
    color: var(--accent);
}

/* ===================================
   Submit Button Loading
=================================== */

.btn.is-loading {
    position: relative;
    pointer-events: none;
}

.btn.is-loading span {
    opacity: 0;
}

.btn.is-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: btnSpinner 0.8s linear infinite;
}

@keyframes btnSpinner {
    to { transform: rotate(360deg); }
}

/* ===================================
   Gradient Text Animated
=================================== */

.gradient-animated {
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

/* ===================================
   Style Switcher
=================================== */

.style-switcher {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.style-switcher-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    background: var(--dark-lighter);
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
}

.style-switcher-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
}

.style-switcher-btn.active {
    background: var(--gradient-primary);
    border-color: transparent;
}

.style-switcher-btn::before {
    content: attr(data-tooltip);
    position: absolute;
    right: 60px;
    background: var(--dark-lighter);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.style-switcher-btn:hover::before {
    opacity: 1;
}

.style-switcher-toggle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    background: var(--dark);
    color: var(--accent);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.style-switcher-toggle:hover {
    transform: rotate(90deg);
}

.style-switcher-options {
    display: none;
    flex-direction: column;
    gap: 8px;
}

.style-switcher.open .style-switcher-options {
    display: flex;
}

/* ===================================
   Mobile Adjustments
=================================== */

@media (max-width: 768px) {
    .custom-cursor,
    .cursor-trail-dot {
        display: none !important;
    }

    .geometric-shapes {
        display: none;
    }

    .style-switcher {
        bottom: 20px;
        right: 20px;
    }

    .style-switcher-btn {
        width: 40px;
        height: 40px;
        font-size: 10px;
    }

    .stat-ring {
        display: none;
    }
}

/* ===================================
   Reduced Motion
=================================== */

@media (prefers-reduced-motion: reduce) {
    .custom-cursor,
    .cursor-trail-dot,
    .geometric-shapes,
    .particle-burst,
    .ripple-effect {
        display: none !important;
    }

    .scroll-progress-fill {
        transition: none;
    }

    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===================================
   Performance Optimizations
=================================== */

.custom-cursor,
.cursor-trail-dot,
.geometric-shape,
.scroll-progress-fill,
.particle-burst {
    will-change: transform;
    transform: translateZ(0);
}

/* ===================================
   Hero Enhanced Styles
=================================== */

/* Ensure hero elements stay visible after GSAP animations */
/* This rule applies to all style variants */
.hero-section .animate-on-scroll.animated,
body.style-glassmorphism .hero-section .animate-on-scroll.animated,
body.style-3d-immersive .hero-section .animate-on-scroll.animated,
body.style-kinetic .hero-section .animate-on-scroll.animated,
body.style-cyber-grid .hero-section .animate-on-scroll.animated {
    opacity: 1 !important;
    transform: translateY(0) !important;
    visibility: visible !important;
}

.hero-title .word {
    display: inline-block;
    margin-right: 0.25em;
}

.hero-title .char {
    display: inline-block;
    will-change: transform, opacity;
}

/* Ensure kinetic typography works properly */
.hero-title[data-kinetic-animated="true"] {
    opacity: 1 !important;
    visibility: visible !important;
}

.hero-title[data-kinetic-animated="true"] .char {
    /* Initial state set by GSAP, allow animation */
    will-change: transform, opacity;
}

/* ===================================
   Section Entrance Variations
=================================== */

.entrance-fade-scale {
    opacity: 0;
    transform: scale(0.9);
}

.entrance-fade-scale.animated {
    opacity: 1;
    transform: scale(1);
}

.entrance-slide-left {
    opacity: 0;
    transform: translateX(-50px);
}

.entrance-slide-left.animated {
    opacity: 1;
    transform: translateX(0);
}

.entrance-slide-right {
    opacity: 0;
    transform: translateX(50px);
}

.entrance-slide-right.animated {
    opacity: 1;
    transform: translateX(0);
}

.entrance-rotate-in {
    opacity: 0;
    transform: rotate(-10deg) scale(0.9);
}

.entrance-rotate-in.animated {
    opacity: 1;
    transform: rotate(0) scale(1);
}
