/* ================================================================
   EcoVision Pro - Enhanced Effects & Animations
   Beautiful, Clean, and Working Perfectly
   ================================================================ */

/* ================================================================
   LIQUID ETHER ANIMATED BACKGROUND
   ================================================================ */
.liquid-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

@keyframes liquidFloat {
    0%, 100% { 
        transform: translate(0, 0) scale(1);
        opacity: 0.5;
    }
    25% {
        transform: translate(40px, -40px) scale(1.15);
        opacity: 0.7;
    }
    50% {
        transform: translate(-30px, 30px) scale(0.9);
        opacity: 0.6;
    }
    75% {
        transform: translate(25px, -15px) scale(1.05);
        opacity: 0.65;
    }
}

.liquid-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.5;
    animation: liquidFloat ease-in-out infinite;
}

.liquid-orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(78, 205, 196, 0.45), transparent);
    top: -200px;
    left: -200px;
    animation-duration: 20s;
    animation-delay: 0s;
}

.liquid-orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255, 230, 109, 0.35), transparent);
    top: 50%;
    right: -150px;
    animation-duration: 18s;
    animation-delay: 7s;
}

.liquid-orb-3 {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(255, 107, 107, 0.3), transparent);
    bottom: -100px;
    left: 30%;
    animation-duration: 22s;
    animation-delay: 14s;
}

/* ================================================================
   TOGGLE BUTTONS (Top Right Corner)
   ================================================================ */
.toggle-buttons-container {
    position: fixed;
    top: 25px;
    right: 25px;
    z-index: 1000;
    display: flex;
    gap: 12px;
    animation: slideInRight 0.6s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toggle-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.toggle-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(78, 205, 196, 0.3);
    border-color: rgba(78, 205, 196, 0.5);
    background: rgba(255, 255, 255, 0.15);
}

.toggle-btn:active {
    transform: translateY(-1px);
}

.btn-icon {
    font-size: 18px;
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.toggle-btn:hover .btn-icon {
    transform: rotate(15deg) scale(1.1);
}

.btn-text {
    font-family: 'Poppins', sans-serif;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.3);
    }
}

.demo-active {
    background: #FFE66D;
    box-shadow: 0 0 12px #FFE66D;
}

.live-active {
    background: #4ECDC4;
    box-shadow: 0 0 12px #4ECDC4;
}

.demo-btn.active {
    background: linear-gradient(135deg, rgba(255, 230, 109, 0.25), rgba(255, 165, 0, 0.25));
    border-color: rgba(255, 230, 109, 0.5);
}

.login-btn {
    background: linear-gradient(135deg, rgba(78, 205, 196, 0.2), rgba(68, 160, 141, 0.2));
}

.login-btn:hover {
    background: linear-gradient(135deg, rgba(78, 205, 196, 0.3), rgba(68, 160, 141, 0.3));
}

/* ================================================================
   ENHANCED CARD EFFECTS (Keep Your Beautiful Gradients!)
   ================================================================ */
.metric-card {
    position: relative;
    overflow: visible;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.metric-card:hover {
    transform: translateY(-10px) scale(1.02);
}

.metric-card::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(
        45deg,
        transparent 0%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 100%
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.metric-card:hover::after {
    opacity: 1;
}

/* Glow effects on hover (keep your original gradients!) */
.voltage-card:hover {
    box-shadow: 0 20px 50px rgba(0, 210, 255, 0.4);
}

.current-card:hover {
    box-shadow: 0 20px 50px rgba(247, 151, 30, 0.4);
}

.power-card:hover {
    box-shadow: 0 20px 50px rgba(255, 210, 0, 0.4);
}

.temperature-card:hover {
    box-shadow: 0 20px 50px rgba(255, 99, 132, 0.4);
}

/* ================================================================
   CHART ANIMATIONS
   ================================================================ */
.chart-card {
    transition: all 0.3s ease;
}

.chart-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.chart-badge {
    animation: fadeInBadge 0.5s ease-out;
}

@keyframes fadeInBadge {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ================================================================
   SMOOTH SCROLLING
   ================================================================ */
html {
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
}

/* ================================================================
   MOBILE RESPONSIVE
   ================================================================ */
@media (max-width: 768px) {
    .toggle-buttons-container {
        top: 15px;
        right: 15px;
        flex-direction: row;
        gap: 8px;
    }

    .toggle-btn {
        padding: 10px 16px;
        font-size: 13px;
    }

    .btn-text {
        display: none;
    }

    .btn-icon {
        font-size: 16px;
    }

    .status-dot {
        display: none;
    }

    .liquid-orb {
        transform: scale(0.6);
    }

    .metric-card {
        min-height: 140px;
    }

    .metric-card:hover {
        transform: translateY(-5px) scale(1.01);
    }
}

@media (max-width: 576px) {
    .toggle-buttons-container {
        top: 10px;
        right: 10px;
        gap: 6px;
    }

    .toggle-btn {
        padding: 8px 12px;
    }

    .btn-icon {
        font-size: 14px;
    }

    .liquid-orb {
        transform: scale(0.4);
    }
}

/* ================================================================
   LOADING STATES
   ================================================================ */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.loading-shimmer {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* ================================================================
   ACCESSIBILITY
   ================================================================ */
.toggle-btn:focus {
    outline: 2px solid rgba(78, 205, 196, 0.6);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ================================================================
   PERFORMANCE OPTIMIZATIONS
   ================================================================ */
.metric-card,
.chart-card,
.toggle-btn {
    will-change: transform;
}

.liquid-orb {
    will-change: transform, opacity;
}

/* Force GPU acceleration */
.metric-card,
.chart-card,
.toggle-btn,
.liquid-orb {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* ================================================================
   PRINT STYLES
   ================================================================ */
@media print {
    .toggle-buttons-container,
    .liquid-background {
        display: none !important;
    }

    .metric-card,
    .chart-card {
        page-break-inside: avoid;
    }
}

.chart-container {
    height: 280px;
}

canvas {
    width: 100% !important;
    height: 100% !important;
}

