/* ============================================
   Agent AI Plant Manager - Custom Styles
   Unarvu AI - A division of Cre8 IOT
   ============================================ */

/* CSS Custom Properties */
:root {
    --color-dark: #0a1628;
    --color-darker: #070f1a;
    --color-blue: #1e3a5f;
    --color-cyan: #00d4ff;
    --color-accent: #00b8e6;
    --color-green: #10b981;
    --transition-fast: 150ms ease;
    --transition-base: 300ms ease;
    --transition-slow: 500ms ease;
}

/* ============================================
   Base Styles & Reset
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    min-height: 100vh;
    line-height: 1.6;
    background-color: var(--color-dark);
    color: #ffffff;
}

/* ============================================
   Selection Styles
   ============================================ */
::selection {
    background-color: rgba(0, 212, 255, 0.3);
    color: #ffffff;
}

::-moz-selection {
    background-color: rgba(0, 212, 255, 0.3);
    color: #ffffff;
}

/* ============================================
   Scrollbar Styles
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-darker);
}

::-webkit-scrollbar-thumb {
    background: var(--color-blue);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-cyan);
}

/* ============================================
   Focus Styles for Accessibility
   ============================================ */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid var(--color-cyan);
    outline-offset: 2px;
}

/* ============================================
   Animation Keyframes
   ============================================ */

/* Fade In Up Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Slide In Left Animation */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide In Right Animation */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Bounce Slow Animation */
@keyframes bounceSlow {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Glow Animation */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(0, 212, 255, 0.6);
    }
}

/* Shimmer Animation */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* ============================================
   Animation Utility Classes
   ============================================ */
.animate-fade-in {
    animation: fadeIn 0.6s ease forwards;
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s ease forwards;
}

.animate-slide-in-left {
    animation: slideInLeft 0.8s ease forwards;
}

.animate-slide-in-right {
    animation: slideInRight 0.8s ease forwards;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

.animate-bounce-slow {
    animation: bounceSlow 2s ease-in-out infinite;
}

.animate-glow {
    animation: glow 2s ease-in-out infinite;
}

/* Animation Delays */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }

/* ============================================
   Scroll Reveal Animation
   ============================================ */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* ============================================
   Navigation Styles
   ============================================ */
#navbar {
    transition: background-color var(--transition-base), 
                box-shadow var(--transition-base),
                transform var(--transition-base);
}

#navbar.scrolled {
    background-color: rgba(10, 22, 40, 0.98);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

#navbar.hidden {
    transform: translateY(-100%);
}

/* Nav Link Hover Effect */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--color-cyan), var(--color-accent));
    transition: width var(--transition-base);
}

.nav-link:hover::after {
    width: 100%;
}

/* ============================================
   Mobile Menu Styles
   ============================================ */
#mobile-menu {
    transition: max-height var(--transition-base), opacity var(--transition-base);
    max-height: 0;
    opacity: 0;
    overflow: hidden;
}

#mobile-menu.active {
    max-height: 500px;
    opacity: 1;
}

/* ============================================
   Card Hover Effects
   ============================================ */
.card-hover {
    transition: transform var(--transition-base),
                box-shadow var(--transition-base),
                border-color var(--transition-base);
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 212, 255, 0.15);
}

/* ============================================
   Button Styles
   ============================================ */
.btn-primary {
    position: relative;
    overflow: hidden;
    transition: all var(--transition-base);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left var(--transition-slow);
}

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

/* ============================================
   Image Styles
   ============================================ */
.img-zoom {
    overflow: hidden;
}

.img-zoom img {
    transition: transform var(--transition-slow);
}

.img-zoom:hover img {
    transform: scale(1.05);
}

/* ============================================
   Gradient Text
   ============================================ */
.gradient-text {
    background: linear-gradient(135deg, var(--color-cyan), #60a5fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   Glass Morphism Effect
   ============================================ */
.glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ============================================
   Floating WhatsApp Button
   ============================================ */
.whatsapp-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 50;
    width: 56px;
    height: 56px;
    background-color: #22c55e;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.4);
    transition: all var(--transition-base);
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(34, 197, 94, 0.6);
}

/* ============================================
   Form Styles
   ============================================ */
input,
textarea,
select {
    transition: border-color var(--transition-base),
                box-shadow var(--transition-base);
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--color-cyan);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.2);
}

/* Custom Select Arrow */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
}

/* ============================================
   Timeline Styles
   ============================================ */
.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--color-cyan), var(--color-blue), transparent);
    transform: translateX(-50%);
}

/* ============================================
   Feature Card Icon Animation
   ============================================ */
.feature-icon {
    transition: transform var(--transition-base),
                background-color var(--transition-base);
}

.group:hover .feature-icon {
    transform: scale(1.1) rotate(5deg);
}

/* ============================================
   Stats Counter Animation
   ============================================ */
.stat-number {
    font-variant-numeric: tabular-nums;
}

/* ============================================
   Loading Skeleton
   ============================================ */
.skeleton {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.05) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* ============================================
   Tooltip Styles
   ============================================ */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 8px 12px;
    background-color: var(--color-darker);
    color: white;
    font-size: 12px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-4px);
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    #navbar,
    .whatsapp-float,
    .no-print {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    a {
        text-decoration: underline;
    }
}

/* ============================================
   Reduced Motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .scroll-reveal {
        opacity: 1;
        transform: none;
    }
}

/* ============================================
   High Contrast Mode
   ============================================ */
@media (prefers-contrast: high) {
    .glass {
        background: rgba(0, 0, 0, 0.9);
        border: 2px solid white;
    }
}

/* ============================================
   Responsive Typography
   ============================================ */
@media (max-width: 640px) {
    html {
        font-size: 14px;
    }
}

@media (min-width: 1536px) {
    html {
        font-size: 18px;
    }
}

/* ============================================
   Hero Section Background Animation
   ============================================ */
.hero-bg-animation {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.hero-bg-animation::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.03) 0%, transparent 50%);
    animation: rotate 30s linear infinite;
}

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

/* ============================================
   Border Gradient Effect
   ============================================ */
.border-gradient {
    position: relative;
    background: var(--color-dark);
    border-radius: 12px;
}

.border-gradient::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, var(--color-cyan), var(--color-blue), var(--color-cyan));
    border-radius: 14px;
    z-index: -1;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.border-gradient:hover::before {
    opacity: 1;
}

/* ============================================
   FAQ Accordion Styles
   ============================================ */
.faq-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-base), padding var(--transition-base);
}

.faq-content:not(.hidden) {
    max-height: 500px;
}

/* ============================================
   Link Underline Animation
   ============================================ */
.link-underline {
    position: relative;
    display: inline-block;
}

.link-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--color-cyan);
    transition: width var(--transition-base);
}

.link-underline:hover::after {
    width: 100%;
}

/* ============================================
   Badge/Pill Styles
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-cyan {
    background-color: rgba(0, 212, 255, 0.1);
    color: var(--color-cyan);
    border: 1px solid rgba(0, 212, 255, 0.3);
}

.badge-green {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--color-green);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* ============================================
   Grid Pattern Background
   ============================================ */
.grid-pattern {
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
}

/* ============================================
   Dot Pattern Background
   ============================================ */
.dot-pattern {
    background-image: radial-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* ============================================
   Noise Texture Overlay
   ============================================ */
.noise-overlay {
    position: relative;
}

.noise-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.02;
    pointer-events: none;
}

/* ============================================
   Focus Visible Polyfill
   ============================================ */
.js-focus-visible :focus:not(.focus-visible) {
    outline: none;
}

/* ============================================
   Lazy Load Image Placeholder
   ============================================ */
img[loading="lazy"] {
    background-color: rgba(255, 255, 255, 0.05);
}

/* ============================================
   Aspect Ratio Utilities
   ============================================ */
.aspect-video {
    aspect-ratio: 16 / 9;
}

.aspect-square {
    aspect-ratio: 1 / 1;
}

/* ============================================
   Line Clamp Utilities
   ============================================ */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================
   Screen Reader Only
   ============================================ */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sr-only-focusable:focus {
    position: static;
    width: auto;
    height: auto;
    padding: inherit;
    margin: inherit;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* ============================================
   MOBILE FOOTER - Custom Layout
   ============================================ */

/* Hide mobile footer on desktop */
.footer-mobile {
    display: none;
}

/* Show desktop footer on desktop */
.footer-desktop {
    display: block;
}

/* Mobile breakpoint */
@media (max-width: 768px) {
    /* Hide desktop footer on mobile */
    .footer-desktop {
        display: none;
    }
    
    /* Show mobile footer on mobile */
    .footer-mobile {
        display: block;
    }
    
    /* Mobile footer styles */
    .footer-mobile {
        padding: 2rem 0;
    }
    
    .footer-mobile .footer-brand {
        text-align: center;
        margin-bottom: 1.5rem;
    }
    
    .footer-mobile .footer-brand img {
        height: 2.5rem;
        margin: 0 auto;
    }
    
    .footer-mobile .footer-tagline {
        text-align: center;
        color: #9ca3af;
        font-size: 0.875rem;
        margin-bottom: 1.5rem;
        line-height: 1.6;
    }
    
    .footer-mobile .footer-social {
        display: flex;
        justify-content: center;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .footer-mobile .footer-social a {
        width: 2.5rem;
        height: 2.5rem;
        border-radius: 0.5rem;
        background: rgba(255, 255, 255, 0.05);
        display: flex;
        align-items: center;
        justify-content: center;
        color: #9ca3af;
        transition: all 0.3s ease;
    }
    
    .footer-mobile .footer-social a:hover {
        background: rgba(0, 212, 255, 0.2);
        color: #00d4ff;
    }
    
    .footer-mobile .footer-links {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.75rem 1.5rem;
        margin-bottom: 1.5rem;
        padding-bottom: 1.5rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .footer-mobile .footer-links a {
        color: #9ca3af;
        font-size: 0.875rem;
        transition: color 0.3s ease;
    }
    
    .footer-mobile .footer-links a:hover {
        color: #00d4ff;
    }
    
    .footer-mobile .footer-contact {
        text-align: center;
        margin-bottom: 1.5rem;
    }
    
    .footer-mobile .footer-contact a {
        display: block;
        color: #9ca3af;
        font-size: 0.875rem;
        margin-bottom: 0.5rem;
        transition: color 0.3s ease;
    }
    
    .footer-mobile .footer-contact a:hover {
        color: #00d4ff;
    }
    
    .footer-mobile .footer-parent {
        text-align: center;
        padding-top: 1.5rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .footer-mobile .footer-parent-text {
        color: #6b7280;
        font-size: 0.75rem;
        margin-bottom: 0.5rem;
    }
    
    .footer-mobile .footer-parent-logo {
        height: 2rem;
        margin: 0 auto;
        opacity: 0.8;
    }
    
    .footer-mobile .footer-copyright {
        text-align: center;
        color: #6b7280;
        font-size: 0.75rem;
        margin-top: 1.5rem;
        padding-top: 1.5rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
}

/* Icon styles */
.icon {
    width: 1.5rem;
    height: 1.5rem;
    display: inline-block;
    vertical-align: middle;
}
/* ============================================
   NAVBAR & MOBILE MENU - FIXED ANIMATIONS
   ============================================ */

/* Smooth navbar hide/show transition */
#navbar {
    transition: transform 0.3s ease-in-out, background-color 0.3s ease, box-shadow 0.3s ease;
    will-change: transform;
}

/* Mobile menu smooth animation */
#mobile-menu {
    transition: max-height 0.35s ease-in-out, opacity 0.35s ease-in-out, padding 0.35s ease-in-out;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
}

#mobile-menu.active {
    max-height: 600px;
    opacity: 1;
}

/* Prevent body scroll when menu is open */
body.menu-open {
    overflow: hidden;
}

/* Mobile menu button - prevent double-tap zoom */
#mobile-menu-btn {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* FAQ Accordion - smoother animation */
.faq-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease-in-out, opacity 0.35s ease-in-out;
    opacity: 0;
}

.faq-content:not(.hidden) {
    max-height: 500px;
    opacity: 1;
}

.faq-icon {
    transition: transform 0.3s ease-in-out;
}

/* Scroll reveal - ensure smooth animation */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    will-change: opacity, transform;
}

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

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    #navbar,
    #mobile-menu,
    .faq-content,
    .faq-icon,
    .scroll-reveal {
        transition: none !important;
        animation: none !important;
    }
    
    .scroll-reveal {
        opacity: 1;
        transform: none;
    }
}