/* ========================================
   styles.css – Premium IDRO Education Styles
   Enhanced with visual hierarchy & micro-interactions
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,300;14..32,400;14..32,500;14..32,600;14..32,700&family=Poppins:wght@400;500;600;700&display=swap');

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #a5b4fc;
    --secondary: #f59e0b;
    --dark: #1e293b;
    --light: #f8fafc;
    --gray: #64748b;
    --gray-light: #e2e8f0;
    --danger: #ef4444;
    --success: #10b981;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --transition: all 0.3s ease;
    --radius: 0.5rem;
    --radius-lg: 1rem;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--light);
    color: var(--dark);
    line-height: 1.5;
    overflow-x: hidden;
}
h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
}
a { text-decoration: none; color: inherit; }
.container { max-width: 1280px; margin: 0 auto; padding: 0 1.5rem; }

/* ---------- Premium Glass Navbar ---------- */
.glass-navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(10, 25, 47, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}
.glass-navbar.scrolled {
    background: rgba(10, 25, 47, 0.95);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}
.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.nav-logo img {
    max-height: 42px;
    transition: transform 0.2s;
}
.nav-logo:hover img { transform: scale(1.02); }
.nav-menu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.nav-menu .menu {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}
.nav-menu .menu-item {
    position: relative;
    list-style: none;
}
.nav-menu a {
    color: #fff;
    font-weight: 500;
    transition: color 0.2s;
}
.nav-menu a:hover { color: var(--primary); }

.sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(8px);
    min-width: 200px;
    padding: 0.5rem 0;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    z-index: 1001;
    list-style: none;
}
.menu-item:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.sub-menu a {
    display: block;
    padding: 0.5rem 1rem;
    color: #fff;
    white-space: nowrap;
}
.sub-menu a:hover {
    background: rgba(255,255,255,0.1);
    color: var(--primary);
}
.sub-menu .sub-menu { left: 100%; top: 0; }

.cart-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #fff;
}
.cart-icon .cart-count {
    position: absolute;
    top: -8px;
    right: -12px;
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    border-radius: 20px;
    padding: 0 6px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-primary-sm {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    padding: 0.5rem 1.2rem;
    border-radius: 40px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    display: inline-block;
    color: white;
}
.btn-primary-sm:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99,102,241,0.4);
    color: white;
}
.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: white;
    cursor: pointer;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    font-family: inherit;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }

/* ---------- Product Cards (Enhanced) ---------- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}
.product-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.4s cubic-bezier(0.2, 0.9, 0.4, 1.1), box-shadow 0.3s;
    position: relative;
}
.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.05);
}
.product-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1 / 1;
}
.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}
.product-card:hover .product-image img { transform: scale(1.05); }
.product-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--secondary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 1;
}
.product-info { padding: 1.25rem; }
.product-title { font-size: 1.125rem; font-weight: 600; margin-bottom: 0.5rem; }
.product-price { font-weight: 700; color: var(--primary); font-size: 1.25rem; }
.compare-price { text-decoration: line-through; color: var(--gray); font-size: 0.875rem; margin-left: 0.5rem; }
.add-to-cart {
    width: 100%;
    margin-top: 1rem;
    transition: all 0.2s;
}
.add-to-cart:active {
    transform: scale(0.95);
}

/* ---------- Hero Carousel ---------- */
.hero { position: relative; height: 500px; overflow: hidden; }
.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.5s;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
}
.hero-slide.active { opacity: 1; }
.hero-content {
    background: rgba(0,0,0,0.5);
    padding: 2rem;
    border-radius: var(--radius-lg);
    backdrop-filter: blur(4px);
}

/* ---------- Floating Elements ---------- */
.floating-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}
.hero, .section { position: relative; overflow-x: hidden; }
.float-item {
    position: absolute;
    font-size: 2.4rem;
    opacity: 0.35;
    animation: float 8s infinite ease-in-out;
    will-change: transform;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.08));
}
.robot-1    { color: #5eead4; top: 12%; left: 3%; animation-duration: 14s; animation-delay: 0s; }
.gear-1     { color: #f9a8d4; top: 45%; left: 88%; animation-duration: 12s; animation-delay: 2s; }
.atom-1     { color: #bef264; top: 75%; left: 8%; animation-duration: 18s; animation-delay: 1s; }
.bulb-1     { color: #fdba74; top: 20%; left: 72%; animation-duration: 11s; animation-delay: 3s; }
.gear-2     { color: #93c5fd; top: 85%; left: 65%; animation-duration: 16s; animation-delay: 0.5s; }
.microchip-1{ color: #fda4af; top: 35%; left: 12%; animation-duration: 22s; animation-delay: 1.5s; }
.rocket-1   { color: #a78bfa; top: 8%; left: 92%; animation-duration: 9s; animation-delay: 4s; }
@keyframes float {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-25px) rotate(3deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}
.circuit-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle at 20% 40%, rgba(99,102,241,0.08) 2px, transparent 2px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: -1;
}

/* ---------- Toast ---------- */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--dark);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 1100;
    transform: translateX(400px);
    transition: transform 0.3s;
}
.toast.show { transform: translateX(0); }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

/* ---------- Admin ---------- */
.admin-container { display: flex; min-height: 100vh; }
.admin-sidebar {
    width: 260px;
    background: var(--dark);
    color: white;
    padding: 2rem 1rem;
}
.admin-sidebar a {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    transition: var(--transition);
}
.admin-sidebar a:hover, .admin-sidebar a.active { background: var(--primary); }
.admin-content { flex: 1; padding: 2rem; }
.admin-card {
    background: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .nav-toggle { display: block; }
    .nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        background: rgba(10,25,47,0.98);
        padding: 1rem;
        border-radius: 20px;
        margin-top: 1rem;
    }
    .nav-menu.open { display: flex; }
    .nav-menu .menu { flex-direction: column; gap: 0.5rem; }
    .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: transparent;
        padding-left: 1rem;
        border: none;
        box-shadow: none;
    }
    .sub-menu a { white-space: normal; }
    .product-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
    .hero { height: 300px; }
    .admin-sidebar { width: 200px; }
    .floating-elements { display: none; }
}

/* ---------- Utilities ---------- */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }

/* ===== NEW PREMIUM ADDITIONS ===== */

/* Stats Ribbon (Social Proof) */
.stats-ribbon {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    padding: 3rem 0;
    text-align: center;
    margin: 2rem 0;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}
.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: white;
    line-height: 1.2;
}
.stat-label {
    font-size: 1rem;
    color: rgba(255,255,255,0.9);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Lazy Loading Style */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease;
}
img.loaded {
    opacity: 1;
}