/* glassmorphism.css */

/* Global Glass Background Generator for Web Pages */
.glass-bg-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: #f4f6fa; /* Light mode base */
    transition: background 0.3s ease;
}

body.dark-mode .glass-bg-mesh {
    background: #0f172a; /* Dark mode base */
}

/* Animated Mesh Orbs */
.glass-bg-mesh::before, .glass-bg-mesh::after {
    content: '';
    position: absolute;
    width: 60vw;
    height: 60vw;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.6;
    animation: orbFloat 20s infinite ease-in-out alternate;
}

.glass-bg-mesh::before {
    top: -10vw;
    left: -10vw;
    background: radial-gradient(circle, rgba(99,102,241,0.5) 0%, rgba(139,92,246,0) 70%);
}

.glass-bg-mesh::after {
    bottom: -10vw;
    right: -10vw;
    background: radial-gradient(circle, rgba(59,130,246,0.5) 0%, rgba(14,165,233,0) 70%);
    animation-delay: -10s;
}

body.dark-mode .glass-bg-mesh::before {
    background: radial-gradient(circle, rgba(99,102,241,0.3) 0%, rgba(139,92,246,0) 70%);
}
body.dark-mode .glass-bg-mesh::after {
    background: radial-gradient(circle, rgba(59,130,246,0.3) 0%, rgba(14,165,233,0) 70%);
}

@keyframes orbFloat {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(10vw, 10vh) scale(1.2); }
}

/* Glass Panels (Sidebars, Modals, Heavy Containers) */
.glass-panel {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    color: #1e293b;
}

body.dark-mode .glass-panel {
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    color: #f8fafc;
}

/* Glass Cards (Order items, product cards, stats) */
.glass-card {
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.04);
    border-radius: 16px;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px 0 rgba(0, 0, 0, 0.08);
}

body.dark-mode .glass-card {
    background: rgba(30, 41, 59, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.2);
}

body.dark-mode .glass-card:hover {
    background: rgba(30, 41, 59, 0.65);
    box-shadow: 0 10px 30px 0 rgba(0, 0, 0, 0.3);
}

/* Glass Navbar (Top Navigation, Bottom Navigation) */
.glass-nav {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.03);
}

body.dark-mode .glass-nav {
    background: rgba(15, 23, 42, 0.75);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.3);
}

.glass-nav-bottom {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 -4px 20px 0 rgba(0, 0, 0, 0.03);
}

body.dark-mode .glass-nav-bottom {
    background: rgba(15, 23, 42, 0.75);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 -4px 20px 0 rgba(0, 0, 0, 0.3);
}

/* Glass Input (Search bars, forms) */
.glass-input {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
    border-radius: 12px;
    color: #1e293b;
    transition: all 0.3s ease;
}

.glass-input:focus {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    outline: none;
}

body.dark-mode .glass-input {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f8fafc;
}

body.dark-mode .glass-input:focus {
    background: rgba(30, 41, 59, 0.7);
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Base override for existing body background to support mesh */
body {
    background-color: transparent !important;
}

/* Scrollbar styling for glass theme */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.15);
    border-radius: 4px;
}
body.dark-mode ::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
}
