/* ============================================ */
/* ANSTECHNOLOGY — AGENTIC ENHANCEMENTS          */
/* Futuristic / AI-Inspired Premium Design       */
/* ============================================ */

/* ============================================ */
/* 1. ADVANCED ANIMATIONS & KEYFRAMES           */
/* ============================================ */

/* Morphing gradient background */
@keyframes morphGradient {
    0% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
    25% { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
    50% { border-radius: 50% 60% 30% 60% / 40% 50% 60% 50%; }
    75% { border-radius: 70% 30% 50% 50% / 30% 70% 40% 60%; }
    100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
}

@keyframes floatSlow {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-15px) rotate(2deg); }
    66% { transform: translateY(8px) rotate(-1deg); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes ripple {
    to { transform: scale(4); opacity: 0; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes typewriter {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink {
    0%, 100% { border-right-color: transparent; }
    50% { border-right-color: var(--primary-light); }
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(13, 148, 136, 0.3); }
    50% { box-shadow: 0 0 40px rgba(13, 148, 136, 0.6), 0 0 80px rgba(13, 148, 136, 0.2); }
}

@keyframes orbit {
    from { transform: rotate(0deg) translateX(100px) rotate(0deg); }
    to { transform: rotate(360deg) translateX(100px) rotate(-360deg); }
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(60px, 60px); }
}

@keyframes floatParticle {
    0%, 100% { transform: translateY(0) translateX(0); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    50% { transform: translateY(-100px) translateX(50px); }
}

/* ============================================ */
/* 2. AGENTIC HERO — NEXT-GEN                   */
/* ============================================ */

/* Hero ambient orb — morphing blob */
.hero-orb {
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle at 30% 50%, rgba(13, 148, 136, 0.15), rgba(6, 182, 212, 0.05), transparent 70%);
    border-radius: 50%;
    animation: morphGradient 12s ease-in-out infinite, floatSlow 8s ease-in-out infinite;
    filter: blur(40px);
    z-index: 1;
    pointer-events: none;
}

.hero-orb:nth-child(2) {
    width: 350px;
    height: 350px;
    top: auto;
    bottom: 10%;
    right: 5%;
    background: radial-gradient(circle at 70% 50%, rgba(217, 119, 6, 0.12), rgba(245, 158, 11, 0.04), transparent 70%);
    animation-delay: -4s;
    animation-duration: 15s;
}

.hero-orb:nth-child(3) {
    width: 200px;
    height: 200px;
    top: 15%;
    left: 60%;
    background: radial-gradient(circle at 50% 50%, rgba(94, 234, 212, 0.1), transparent 70%);
    animation-delay: -8s;
    animation-duration: 10s;
}

/* Particle grid */
.hero-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.hero-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary-light);
    border-radius: 50%;
    animation: floatParticle 6s ease-in-out infinite;
    opacity: 0;
}

.hero-particle:nth-child(1) { left: 10%; top: 20%; animation-delay: 0s; animation-duration: 7s; }
.hero-particle:nth-child(2) { left: 25%; top: 60%; animation-delay: -1.5s; animation-duration: 9s; width: 3px; height: 3px; }
.hero-particle:nth-child(3) { left: 45%; top: 30%; animation-delay: -3s; animation-duration: 8s; width: 5px; height: 5px; background: var(--accent-light); }
.hero-particle:nth-child(4) { left: 65%; top: 70%; animation-delay: -4.5s; animation-duration: 10s; width: 3px; height: 3px; }
.hero-particle:nth-child(5) { left: 80%; top: 25%; animation-delay: -2s; animation-duration: 7.5s; width: 4px; height: 4px; background: var(--accent-light); }
.hero-particle:nth-child(6) { left: 35%; top: 80%; animation-delay: -5.5s; animation-duration: 8.5s; width: 2px; height: 2px; }
.hero-particle:nth-child(7) { left: 55%; top: 15%; animation-delay: -1s; animation-duration: 6.5s; width: 6px; height: 6px; background: rgba(255,255,255,0.3); }
.hero-particle:nth-child(8) { left: 90%; top: 50%; animation-delay: -3.5s; animation-duration: 9.5s; width: 3px; height: 3px; }

/* Hero title — gradient text animation */
.hero-title {
    background: linear-gradient(135deg, #ffffff 0%, var(--primary-light) 40%, var(--accent-light) 70%, #ffffff 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 4s ease-in-out infinite alternate;
}

.hero-title .highlight {
    background: linear-gradient(135deg, var(--primary-light), #06b6d4, var(--accent-light));
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease-in-out infinite alternate;
}

/* Typewriter subtitle */
.hero-subtitle.typewriter {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid var(--primary-light);
    animation: typewriter 3s steps(40) 1s forwards, blink 0.8s step-end infinite;
    max-width: fit-content;
}

/* Hero CTA — 3D glow effect */
.hero-btn-primary {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.hero-btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hero-btn-primary:hover::after {
    opacity: 1;
}

.hero-btn-primary:hover {
    animation: pulseGlow 1.5s ease-in-out infinite;
    transform: translateY(-3px) scale(1.03);
}

/* ============================================ */
/* 3. GLASSMORPHISM 2.0 — DEEP GLASS           */
/* ============================================ */

.glass-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

.glass-card:hover {
    border-color: rgba(94, 234, 212, 0.25);
    box-shadow: 0 12px 48px rgba(13, 148, 136, 0.15);
    transform: translateY(-4px);
}

.glass-card-dark {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(20px) saturate(1.3);
    -webkit-backdrop-filter: blur(20px) saturate(1.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ============================================ */
/* 4. MAGNETIC BUTTON / RIPPLE EFFECT          */
/* ============================================ */

.btn-ripple {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: ripple 0.6s ease-out;
    pointer-events: none;
}

/* Modern gradient button */
.btn-gradient {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border: none;
    color: #fff;
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: all 0.4s ease;
}

.btn-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--accent), var(--primary));
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
}

.btn-gradient:hover::before {
    opacity: 1;
}

.btn-gradient:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 30px rgba(13, 148, 136, 0.35);
}

/* ============================================ */
/* 5. 3D TILT CARDS                            */
/* ============================================ */

.tilt-card {
    transform-style: preserve-3d;
    perspective: 1000px;
    transition: transform 0.1s ease;
}

.tilt-card-inner {
    transition: transform 0.3s ease;
}

.tilt-card:hover .tilt-card-inner {
    transform: translateZ(20px) rotateX(2deg) rotateY(2deg);
}

.tilt-card .tilt-icon {
    transition: transform 0.3s ease;
}

.tilt-card:hover .tilt-icon {
    transform: translateZ(40px) scale(1.1);
}

.tilt-card .tilt-text {
    transition: transform 0.3s ease;
}

.tilt-card:hover .tilt-text {
    transform: translateZ(15px);
}

/* ============================================ */
/* 6. DARK / LIGHT MODE TOGGLE                 */
/* ============================================ */

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.78);
    cursor: pointer;
    transition: var(--transition);
    font-size: 16px;
}

.theme-toggle:hover {
    background: rgba(94, 234, 212, 0.12);
    border-color: rgba(94, 234, 212, 0.35);
    color: #fff;
    transform: rotate(15deg);
}

/* Dark mode variables */
body.dark-mode {
    --surface: #0f172a;
    --light: #1e293b;
    --white: #1e293b;
    --dark: #f1f5f9;
    --darker: #f8fafc;
    --secondary: #94a3b8;
}

body.dark-mode .navbar {
    background: rgba(2, 6, 23, 0.98);
}

body.dark-mode .card,
body.dark-mode .admin-card {
    background: #1e293b;
    border-color: rgba(255,255,255,0.08);
}

body.dark-mode .section-heading .section-title,
body.dark-mode h1, body.dark-mode h2, body.dark-mode h3,
body.dark-mode h4, body.dark-mode h5, body.dark-mode h6 {
    color: #f1f5f9;
}

body.dark-mode .section {
    background: #0f172a;
}

body.dark-mode .services-section,
body.dark-mode .products-section {
    background: #0a0f1e;
}

body.dark-mode .service-card,
body.dark-mode .product-card,
body.dark-mode .stat-item {
    background: #1e293b;
    border-color: rgba(255,255,255,0.06);
}

body.dark-mode .footer {
    background: #020617 !important;
}

body.dark-mode .text-muted {
    color: #94a3b8 !important;
}

/* Smooth theme transition */
body, body *,
body *::before,
body *::after {
    transition: background-color 0.3s ease,
                color 0.3s ease,
                border-color 0.3s ease,
                box-shadow 0.3s ease;
}

/* ============================================ */
/* 7. FLOATING LABELS & MODERN FORMS           */
/* ============================================ */

.floating-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.floating-group .form-control,
.floating-group .form-select {
    height: 56px;
    padding-top: 24px;
    padding-bottom: 8px;
    border: 2px solid rgba(0,0,0,0.08);
    border-radius: 12px;
    background: var(--white);
    transition: var(--transition);
    font-size: 15px;
}

.floating-group .form-control:focus,
.floating-group .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.1);
}

.floating-group label {
    position: absolute;
    top: 50%;
    left: 16px;
    transform: translateY(-50%);
    font-size: 14px;
    color: var(--secondary);
    pointer-events: none;
    transition: all 0.2s ease;
    background: transparent;
    padding: 0 4px;
}

.floating-group .form-control:focus ~ label,
.floating-group .form-control:not(:placeholder-shown) ~ label,
.floating-group .form-select:focus ~ label,
.floating-group .form-select:not([value=""]):valid ~ label {
    top: 12px;
    transform: translateY(0);
    font-size: 11px;
    color: var(--primary);
    font-weight: 600;
}

.floating-group textarea.form-control ~ label {
    top: 18px;
    transform: none;
}

.floating-group textarea.form-control:focus ~ label,
.floating-group textarea.form-control:not(:placeholder-shown) ~ label {
    top: 8px;
    transform: none;
}

/* ============================================ */
/* 8. SKELETON LOADING                        */
/* ============================================ */

.skeleton {
    background: linear-gradient(90deg, rgba(0,0,0,0.04) 25%, rgba(0,0,0,0.08) 50%, rgba(0,0,0,0.04) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
    width: 80%;
}

.skeleton-title {
    height: 24px;
    margin-bottom: 12px;
    width: 60%;
}

.skeleton-image {
    height: 200px;
    width: 100%;
    border-radius: 12px;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

/* ============================================ */
/* 9. TOAST NOTIFICATIONS                      */
/* ============================================ */

.agentic-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.agentic-toast-item {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    color: #fff;
    padding: 16px 24px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    transform: translateX(120%);
    animation: slideInRight 0.5s ease forwards;
    pointer-events: auto;
    max-width: 380px;
}

.agentic-toast-item.success { border-left: 4px solid #10b981; }
.agentic-toast-item.error { border-left: 4px solid #ef4444; }
.agentic-toast-item.info { border-left: 4px solid #06b6d4; }
.agentic-toast-item.warning { border-left: 4px solid #f59e0b; }

.agentic-toast-item i {
    font-size: 20px;
}

.agentic-toast-item .toast-close {
    margin-left: auto;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
}

.agentic-toast-item .toast-close:hover {
    opacity: 1;
}

/* ============================================ */
/* 10. SCROLL REVEAL ANIMATIONS                */
/* ============================================ */

.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-scale.visible {
    opacity: 1;
    transform: scale(1);
}

/* ============================================ */
/* 11. MODERN PRODUCT CARD ENHANCEMENTS         */
/* ============================================ */

.product-card {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.4s ease;
}

.product-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 60px rgba(13, 148, 136, 0.15);
}

.product-img img {
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.product-card:hover .product-img img {
    transform: scale(1.12);
}

.product-card .product-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    background: linear-gradient(transparent, rgba(0,0,0,0.5));
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.product-card:hover .product-actions {
    opacity: 1;
    transform: translateY(0);
}

/* Add to cart animation */
@keyframes cartBounce {
    0% { transform: scale(1); }
    30% { transform: scale(1.3); }
    50% { transform: scale(0.9); }
    70% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.cart-bounce {
    animation: cartBounce 0.5s ease;
}

/* ============================================ */
/* 12. MODERN PAGE HERO                        */
/* ============================================ */

.page-hero {
    position: relative;
    padding: 140px 0 80px;
    background: linear-gradient(135deg, #0f172a, #1e293b, #0d9488);
    overflow: hidden;
}

.page-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(13, 148, 136, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(6, 182, 212, 0.1) 0%, transparent 50%);
}

.page-hero-title {
    font-size: 48px;
    font-weight: 800;
    color: #fff;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 20px rgba(0,0,0,0.2);
}

.page-hero .breadcrumb {
    position: relative;
    z-index: 1;
}

/* ============================================ */
/* 13. ANIMATED COUNTERS                       */
/* ============================================ */

.stat-number .counter-prefix,
.stat-number .counter-suffix {
    display: inline;
}

.counter-animate {
    display: inline-block;
}

/* ============================================ */
/* 14. MODERN SCROLLBAR — AGENTIC              */
/* ============================================ */

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--darker);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary), var(--accent));
    border-radius: 10px;
    border: 2px solid var(--darker);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--primary-dark), var(--accent-dark));
}

/* ============================================ */
/* 15. MISC ENHANCEMENTS                       */
/* ============================================ */

/* Smooth image loading with blur transition */
img {
    transition: filter 0.4s ease, opacity 0.4s ease;
}

img.loading {
    filter: blur(10px);
    opacity: 0.5;
}

img.loaded {
    filter: blur(0);
    opacity: 1;
}

/* Gradient border cards */
.gradient-border {
    position: relative;
    background: var(--white);
    border-radius: var(--radius-md);
}

.gradient-border::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, var(--primary), var(--accent), var(--info), var(--primary));
    background-size: 300% 300%;
    border-radius: calc(var(--radius-md) + 2px);
    z-index: -1;
    animation: gradientShift 4s ease-in-out infinite;
    opacity: 0.6;
}

/* Floating action button */
.float-btn-agentic {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 8px 30px rgba(13, 148, 136, 0.35);
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.float-btn-agentic:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 40px rgba(13, 148, 136, 0.5);
    color: #fff;
}

/* Pulse ring animation */
.pulse-ring {
    position: relative;
}

.pulse-ring::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: inherit;
    border: 2px solid var(--primary-light);
    animation: pulseRing 2s ease-out infinite;
}

@keyframes pulseRing {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(1.3); opacity: 0; }
}

/* Glow text effect */
.text-glow {
    text-shadow: 0 0 20px rgba(13, 148, 136, 0.3),
                 0 0 40px rgba(13, 148, 136, 0.15),
                 0 0 80px rgba(13, 148, 136, 0.05);
}

.text-glow-accent {
    text-shadow: 0 0 20px rgba(217, 119, 6, 0.3),
                 0 0 40px rgba(217, 119, 6, 0.15),
                 0 0 80px rgba(217, 119, 6, 0.05);
}

/* ============================================ */
/* 16. RESPONSIVE — AGENTIC TWEAKS              */
/* ============================================ */

@media (max-width: 991px) {
    .page-hero-title {
        font-size: 36px;
    }
    .hero-title {
        font-size: 42px;
    }
    .theme-toggle {
        margin: 0 8px;
    }
}

@media (max-width: 576px) {
    .page-hero-title {
        font-size: 28px;
    }
    .hero-title {
        font-size: 32px;
    }
    .hero-desc {
        font-size: 16px;
    }
    .agentic-toast {
        left: 20px;
        right: 20px;
    }
    .agentic-toast-item {
        max-width: 100%;
    }
}
