/* ═══════════════════════════════════════════════════
   Phillips Electrical — Premium CSS v3.0
   ═══════════════════════════════════════════════════ */

/* ── Critical / Base ────────────────────────────── */
html { scroll-behavior: smooth; }
::selection { background: rgba(0, 212, 255, 0.3); color: #fff; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #0A0E17; }
::-webkit-scrollbar-thumb { background: #1E2540; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #00D4FF; }

/* ── Preloader ──────────────────────────────────── */
#preloader {
    position: fixed; inset: 0; z-index: 9999;
    background: #0A0E17;
    display: flex; align-items: center; justify-content: center; flex-direction: column;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}
#preloader.loaded { opacity: 0; visibility: hidden; pointer-events: none; }
#preloader svg { width: 80px; height: 80px; }
#preloader .bolt-path {
    stroke: #00D4FF; stroke-width: 2; fill: none;
    stroke-dasharray: 200; stroke-dashoffset: 200;
    animation: drawBolt 1.2s ease-in-out infinite;
    filter: drop-shadow(0 0 8px rgba(0, 212, 255, 0.6));
}
@keyframes drawBolt {
    0% { stroke-dashoffset: 200; opacity: 0.3; }
    50% { stroke-dashoffset: 0; opacity: 1; }
    100% { stroke-dashoffset: -200; opacity: 0.3; }
}
#preloader .preloader-text {
    font-family: 'Oswald', sans-serif; color: #fff;
    font-size: 0.75rem; letter-spacing: 0.3em; text-transform: uppercase;
    margin-top: 1.5rem; opacity: 0.5;
    animation: preloaderPulse 1.2s ease-in-out infinite;
}
@keyframes preloaderPulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 0.8; } }

/* ── Scroll Progress Bar ────────────────────────── */
#scroll-progress {
    position: fixed; top: 0; left: 0; height: 3px; z-index: 60;
    background: linear-gradient(90deg, #00D4FF, #FFB800, #00D4FF);
    background-size: 200% 100%;
    width: 0%; transition: width 0.1s linear;
    animation: gradientShift 3s linear infinite;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}
@keyframes gradientShift { 0% { background-position: 0% 50%; } 100% { background-position: 200% 50%; } }

/* ── Glassmorphism Navbar ───────────────────────── */
#navbar { background: transparent; transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
#navbar.scrolled {
    background: rgba(10, 14, 23, 0.75);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(0, 212, 255, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 -1px 0 rgba(255, 255, 255, 0.03);
}

/* Active nav link indicator */
.nav-link { position: relative; }
.nav-link::after {
    content: ''; position: absolute; bottom: -4px; left: 50%; width: 0; height: 2px;
    background: #00D4FF; transform: translateX(-50%);
    transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 1px; box-shadow: 0 0 8px rgba(0, 212, 255, 0.4);
}
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

/* ── Hero Grid ──────────────────────────────────── */
.hero-grid {
    background-image:
        linear-gradient(rgba(0, 212, 255, 0.3) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.3) 1px, transparent 1px);
    background-size: 60px 60px;
}

/* ── Animated Gradient Mesh (Hero BG) ───────────── */
.gradient-mesh {
    position: absolute; inset: 0; overflow: hidden; opacity: 0.15;
}
.gradient-mesh .orb {
    position: absolute; border-radius: 50%; filter: blur(80px);
    animation: orbFloat 20s ease-in-out infinite;
}
.gradient-mesh .orb:nth-child(1) {
    width: 600px; height: 600px; background: radial-gradient(circle, #00D4FF 0%, transparent 70%);
    top: -200px; left: -100px; animation-delay: 0s;
}
.gradient-mesh .orb:nth-child(2) {
    width: 500px; height: 500px; background: radial-gradient(circle, #FFB800 0%, transparent 70%);
    bottom: -150px; right: -100px; animation-delay: -7s;
}
.gradient-mesh .orb:nth-child(3) {
    width: 400px; height: 400px; background: radial-gradient(circle, #00D4FF 0%, transparent 70%);
    top: 50%; left: 50%; transform: translate(-50%, -50%); animation-delay: -14s;
}
@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(80px, -60px) scale(1.1); }
    50% { transform: translate(-40px, 80px) scale(0.9); }
    75% { transform: translate(60px, 40px) scale(1.05); }
}

/* ── Hero Text Reveal ───────────────────────────── */
.text-reveal { overflow: hidden; display: inline-block; }
.text-reveal span {
    display: inline-block;
    transform: translateY(110%);
    transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.text-reveal.visible span { transform: translateY(0); }

/* ── Typing Effect ──────────────────────────────── */
.typing-cursor::after {
    content: '|'; animation: blink 0.8s step-end infinite; color: #00D4FF;
    font-weight: 300; margin-left: 2px;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* ── Scroll Indicator ───────────────────────────── */
@keyframes scrollDot {
    0% { transform: translateY(0); opacity: 1; }
    50% { transform: translateY(12px); opacity: 0.3; }
    100% { transform: translateY(0); opacity: 1; }
}
.animate-scroll-dot { animation: scrollDot 1.8s ease-in-out infinite; }
.scroll-indicator { animation: fadeInUp 1s ease 1.5s both; }

/* ── Spark Particles (Enhanced) ─────────────────── */
.spark {
    position: absolute; border-radius: 50%; pointer-events: none;
    animation: sparkle var(--duration, 2s) ease-out var(--delay, 0s) infinite;
}
.spark--blue { background: #00D4FF; box-shadow: 0 0 8px 3px rgba(0, 212, 255, 0.7); }
.spark--amber { background: #FFB800; box-shadow: 0 0 8px 3px rgba(255, 184, 0, 0.7); }
.spark--white { background: #fff; box-shadow: 0 0 6px 2px rgba(255, 255, 255, 0.6); }

/* Spark with trail */
.spark::after {
    content: ''; position: absolute; inset: 0; border-radius: 50%;
    background: inherit; filter: blur(3px); opacity: 0.4;
    animation: trailFade 0.5s ease-out infinite;
}
@keyframes trailFade { 0% { transform: scale(1); opacity: 0.4; } 100% { transform: scale(2.5); opacity: 0; } }

@keyframes sparkle {
    0% { opacity: 0; transform: translate(0, 0) scale(0); }
    10% { opacity: 1; transform: translate(var(--tx1, 10px), var(--ty1, -20px)) scale(1); }
    50% { opacity: 0.6; transform: translate(var(--tx2, 20px), var(--ty2, -60px)) scale(0.8); }
    100% { opacity: 0; transform: translate(var(--tx3, 30px), var(--ty3, -100px)) scale(0); }
}

/* ── Cursor Glow (Hero) ─────────────────────────── */
#cursor-glow {
    position: fixed; width: 400px; height: 400px; border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.08) 0%, transparent 70%);
    pointer-events: none; z-index: 1;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
    opacity: 0;
}
#cursor-glow.active { opacity: 1; }

/* ── Scroll Reveal Animations ───────────────────── */
.reveal {
    opacity: 0; transform: translateY(50px);
    transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1), transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

.reveal-left {
    opacity: 0; transform: translateX(-80px);
    transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1), transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-left.visible { opacity: 1; transform: translateX(0); }

.reveal-right {
    opacity: 0; transform: translateX(80px);
    transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1), transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-right.visible { opacity: 1; transform: translateX(0); }

.reveal-scale {
    opacity: 0; transform: scale(0.85);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-scale.visible { opacity: 1; transform: scale(1); }

/* ── 3D Tilt Service Cards ──────────────────────── */
.service-card {
    position: relative; overflow: hidden;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.5s ease;
    transform-style: preserve-3d; perspective: 800px;
}
.service-card::before {
    content: ''; position: absolute; inset: 0; z-index: 0;
    background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(0, 212, 255, 0.06) 0%, transparent 50%);
    opacity: 0; transition: opacity 0.4s ease;
}
.service-card:hover::before { opacity: 1; }
.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 60px -15px rgba(0, 212, 255, 0.2), 0 0 0 1px rgba(0, 212, 255, 0.1);
}

/* Animated gradient border */
.service-card::after {
    content: ''; position: absolute; inset: -1px; z-index: -1;
    background: conic-gradient(from var(--angle, 0deg), transparent 60%, #00D4FF, #FFB800, transparent 40%);
    border-radius: inherit; opacity: 0;
    transition: opacity 0.5s ease;
    animation: rotateBorder 4s linear infinite;
}
.service-card:hover::after { opacity: 1; }
@property --angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
@keyframes rotateBorder { to { --angle: 360deg; } }

/* ── Feature Cards ──────────────────────────────── */
.feature-card {
    background: rgba(15, 20, 32, 0.5); border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 1rem;
    transition: transform 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}
.feature-card:hover {
    border-color: rgba(0, 212, 255, 0.2); transform: translateY(-6px);
    box-shadow: 0 20px 50px -15px rgba(0, 212, 255, 0.12);
}

/* ── Glowing Stats ──────────────────────────────── */
.stat-glow {
    text-shadow: 0 0 40px rgba(0, 212, 255, 0.4), 0 0 80px rgba(0, 212, 255, 0.2);
}

/* ── Area Pulse Pins ────────────────────────────── */
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 8px 2px rgba(0, 212, 255, 0.4); transform: scale(1); }
    50% { box-shadow: 0 0 24px 8px rgba(0, 212, 255, 0.7); transform: scale(1.4); }
}
.area-pulse { animation: pulseGlow 3s ease-in-out infinite; }
.animate-pulse-glow { animation: pulseGlow 2s ease-in-out infinite; }

/* ── Gallery Items ──────────────────────────────── */
.gallery-item { cursor: pointer; overflow: hidden; border-radius: 0.75rem; }
.gallery-item img { transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1); }

/* ── Pulsing CTA Button ─────────────────────────── */
@keyframes btnPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 212, 255, 0.5); }
    50% { box-shadow: 0 0 0 14px rgba(0, 212, 255, 0); }
}
.btn-pulse { animation: btnPulse 2.5s ease-in-out infinite; }
.btn-pulse:hover {
    animation: none;
    box-shadow: 0 0 40px rgba(0, 212, 255, 0.4), 0 8px 25px rgba(0, 212, 255, 0.2);
}

/* ── Button Ripple ──────────────────────────────── */
.btn-ripple { position: relative; overflow: hidden; }
.btn-ripple::after {
    content: ''; position: absolute; width: 100%; height: 100%;
    top: 0; left: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 10%, transparent 10.01%);
    background-repeat: no-repeat; background-position: 50%;
    transform: scale(10); opacity: 0;
    transition: transform 0.5s, opacity 0.5s;
}
.btn-ripple:active::after { transform: scale(0); opacity: 0.3; transition: 0s; }

/* ── CTA Spark Border ───────────────────────────── */
@keyframes sparkBorder { 0% { background-position: 0% 50%; } 100% { background-position: 200% 50%; } }
.cta-spark-border {
    background: linear-gradient(90deg, transparent, rgba(0,212,255,0.3), rgba(255,184,0,0.3), rgba(0,212,255,0.3), transparent);
    background-size: 200% 100%; animation: sparkBorder 4s linear infinite;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude; -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor; padding: 1px; pointer-events: none;
}

/* ── Testimonial Cards ──────────────────────────── */
.testimonial-card {
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.testimonial-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.3);
}
.testimonial-card .quote-mark {
    font-size: 4rem; line-height: 1; color: rgba(0, 212, 255, 0.1);
    font-family: Georgia, serif; position: absolute; top: 10px; left: 16px;
}

/* ── Carousel ───────────────────────────────────── */
.carousel-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: rgba(255, 255, 255, 0.2); cursor: pointer;
    transition: all 0.3s ease;
}
.carousel-dot.active {
    background: #00D4FF; box-shadow: 0 0 10px rgba(0, 212, 255, 0.6);
    width: 28px; border-radius: 4px;
}

/* ── Contact Form ───────────────────────────────── */
.form-group { position: relative; }
.form-group label {
    transition: color 0.3s ease;
}
.form-group input:focus ~ label,
.form-group textarea:focus ~ label,
.form-group select:focus ~ label { color: #00D4FF; }

#contact-form input:focus,
#contact-form select:focus,
#contact-form textarea:focus {
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.15), 0 0 20px rgba(0, 212, 255, 0.05);
}

#contact-form select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2300D4FF' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 1rem center; padding-right: 2.5rem;
}

.form-success {
    background: rgba(0, 212, 255, 0.08); border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 1rem; padding: 2rem; text-align: center;
    animation: successPop 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes successPop {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* ── Floating Mobile CTA ────────────────────────── */
#floating-cta {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
    background: rgba(10, 14, 23, 0.95);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(0, 212, 255, 0.15);
    padding: 12px 16px;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: none;
}
#floating-cta.show { transform: translateY(0); }
@media (max-width: 1023px) { #floating-cta { display: block; } }

/* ── Page Transition ────────────────────────────── */
.page-transition {
    position: fixed; inset: 0; z-index: 9998;
    background: #0A0E17; pointer-events: none;
    transform: scaleY(0); transform-origin: bottom;
}

/* ── Keyframe Helpers ───────────────────────────── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ── Section Divider ────────────────────────────── */
.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.2), rgba(255, 184, 0, 0.2), rgba(0, 212, 255, 0.2), transparent);
}

/* ── Image Shine Effect on Hover ────────────────── */
.img-shine { position: relative; overflow: hidden; }
.img-shine::after {
    content: ''; position: absolute; top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.7s ease;
}
.img-shine:hover::after { left: 100%; }

/* ── Badge Shimmer ──────────────────────────────── */
@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}
.badge-shimmer {
    background: linear-gradient(90deg, transparent 30%, rgba(255,255,255,0.08) 50%, transparent 70%);
    background-size: 200% 100%;
    animation: shimmer 3s ease-in-out infinite;
}

/* ── Responsive ─────────────────────────────────── */

/* Bottom padding so footer isn't hidden behind floating CTA on mobile */
@media (max-width: 1023px) {
    body { padding-bottom: 80px; }
}

@media (max-width: 640px) {
    .reveal, .reveal-left, .reveal-right { transform: translateY(30px) !important; }
    .reveal.visible, .reveal-left.visible, .reveal-right.visible { transform: translateY(0) !important; }
    .service-card:hover { transform: translateY(-4px); }

    /* Prevent horizontal overflow from large elements */
    .gradient-mesh .orb { filter: blur(60px); }
    .gradient-mesh .orb:nth-child(1) { width: 300px; height: 300px; }
    .gradient-mesh .orb:nth-child(2) { width: 250px; height: 250px; }
    .gradient-mesh .orb:nth-child(3) { width: 200px; height: 200px; }

    /* Tighter gallery grid on small phones */
    .gallery-grid { gap: 6px !important; }

    /* Service page images full width */
    .aspect-\[4\/3\] { aspect-ratio: 16/10; }
}

/* ── Reduced Motion ─────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .reveal, .reveal-left, .reveal-right, .reveal-scale {
        opacity: 1 !important; transform: none !important; transition: none !important;
    }
    .spark, #cursor-glow { display: none; }
    .btn-pulse, .area-pulse, .animate-pulse-glow { animation: none; }
    #preloader { display: none; }
    .gradient-mesh .orb { animation: none; }
}