/* ============================================================
   PrintShop Pro — App CSS v2
   Modern e-commerce styles with mega menu, animations & more
   ============================================================ */

/* ── Fonts & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body { font-family: 'Inter', system-ui, sans-serif; }

/* ── Custom Scrollbar ──────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #9333ea; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #7c3aed; }
.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }

/* ── Announcement Bar ─────────────────────────────────────── */
.announcement-bar {
    background: linear-gradient(90deg, #4c1d95, #7c3aed, #a855f7, #7c3aed, #4c1d95);
    background-size: 300% 100%;
    animation: announcementScroll 8s linear infinite;
    color: #fff;
    text-align: center;
    padding: 10px 40px;
    position: relative;
    font-size: 13px;
    font-weight: 500;
    overflow: hidden;
    line-height: 1.4;
}
@keyframes announcementScroll {
    0%   { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}
.announcement-close {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.7;
    font-size: 18px;
    line-height: 1;
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
}
.announcement-close:hover { opacity: 1; }

/* ── Category Nav Links ────────────────────────────────────── */
.nav-cat-link {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #4b5563;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
    position: relative;
}
.dark .nav-cat-link { color: #d1d5db; }
.nav-cat-link:hover {
    background: #f3e8ff;
    color: #7c3aed;
}
.dark .nav-cat-link:hover {
    background: rgba(124,58,237,0.2);
    color: #c084fc;
}
.nav-cat-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 12px;
    right: 12px;
    height: 2px;
    background: #7c3aed;
    border-radius: 2px;
    transform: scaleX(0);
    transition: transform 0.2s ease;
}
.nav-cat-link:hover::after { transform: scaleX(1); }

/* ── Mega Menu ─────────────────────────────────────────────── */
.mega-parent {
    position: relative;
}
.mega-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 999;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}
.mega-parent:hover .mega-menu {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.mega-menu-panel {
    width: 100%;
    max-width: 520px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25), 0 0 0 1px rgba(0,0,0,0.05);
}
.mega-menu-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    align-items: start;
}
@media (min-width: 768px) {
    .mega-menu-grid {
        grid-template-columns: 200px 1fr 140px;
    }
}
.mega-col-main { border-right: 1px solid #f3f4f6; padding-right: 20px; }
.dark .mega-col-main { border-right-color: #374151; }
.mega-col-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9ca3af;
    margin-bottom: 8px;
    padding-left: 12px;
}
.mega-col-promo { border-left: 1px solid #f3f4f6; padding-left: 16px; }
.dark .mega-col-promo { border-left-color: #374151; }

.mega-promo-card { backdrop-filter: blur(4px); }

/* Hide mega menu on touch devices/mobile */
@media (max-width: 1024px) {
    .mega-parent .mega-menu { display: none !important; }
}

/* ── Mobile Nav Link ───────────────────────────────────────── */
.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 8px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    transition: background 0.15s;
}
.dark .mobile-nav-link { color: #d1d5db; }
.mobile-nav-link:hover { background: #f3e8ff; color: #7c3aed; }
.dark .mobile-nav-link:hover { background: rgba(124,58,237,0.15); }

/* ── User Menu Item ────────────────────────────────────────── */
.user-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    font-size: 13.5px;
    color: #374151;
    text-decoration: none;
    transition: background 0.15s;
}
.dark .user-menu-item { color: #d1d5db; }
.user-menu-item:hover { background: #f9fafb; }
.dark .user-menu-item:hover { background: #374151; }

/* ── Glassmorphism ─────────────────────────────────────────── */
.glass {
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.14);
}
.glass-dark {
    background: rgba(0,0,0,0.25);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.1);
}

/* ── Product Card ─────────────────────────────────────────── */
.product-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    position: relative;
    overflow: hidden;
}
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 24px 48px -12px rgba(124, 58, 237, 0.22);
}
.product-card .card-actions {
    transition: opacity 0.2s ease, transform 0.2s ease;
    opacity: 0; transform: translateY(8px);
}
.product-card:hover .card-actions { opacity: 1; transform: translateY(0); }
.product-img-wrap { overflow: hidden; background: #f3f4f6; }
.dark .product-img-wrap { background: #1f2937; }
.product-img-wrap img { transition: transform 0.45s ease; }
.product-card:hover .product-img-wrap img { transform: scale(1.07); }

/* ── Discount Badge ───────────────────────────────────────── */
.discount-badge {
    background: linear-gradient(135deg, #f97316, #ef4444);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
}

/* ── Star Rating ──────────────────────────────────────────── */
.stars { color: #f59e0b; }
.stars-empty { color: #d1d5db; }

/* ── Hero Gradient ────────────────────────────────────────── */
.hero-gradient {
    background: linear-gradient(135deg, #1e1b4b 0%, #4c1d95 40%, #7c3aed 70%, #a21caf 100%);
    position: relative;
    overflow: hidden;
}
.hero-gradient::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* ── Hero Banner Carousel ─────────────────────────────────── */
.banner-carousel { position: relative; overflow: hidden; }
.banner-slides { display: flex; transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1); }
.banner-slide {
    min-width: 100%;
    position: relative;
    min-height: 500px;
    display: flex;
    align-items: center;
}
@media (max-width: 768px) { .banner-slide { min-height: 400px; } }
@media (max-width: 480px) { .banner-slide { min-height: 350px; } }
.banner-slide-img {
    position: absolute;
    inset: 0;
    object-fit: cover;
    width: 100%;
    height: 100%;
}
.banner-slide-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(30,27,75,0.92) 0%, rgba(76,29,149,0.75) 50%, rgba(124,58,237,0.3) 100%);
}
.banner-slide-content {
    position: relative;
    z-index: 2;
    max-width: 7xl;
    margin: 0 auto;
    padding: 48px 24px;
    width: 100%;
}
.banner-dots {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 5;
}
.banner-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    padding: 0;
}
.banner-dot.active {
    background: white;
    width: 24px;
    border-radius: 4px;
}
.banner-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    backdrop-filter: blur(4px);
}
.banner-arrow:hover { background: rgba(255,255,255,0.3); }
@media (max-width: 640px) {
    .banner-arrow { width: 32px; height: 32px; }
    .banner-arrow-prev { left: 8px; }
    .banner-arrow-next { right: 8px; }
}
.banner-arrow-prev { left: 16px; }
.banner-arrow-next { right: 16px; }

/* ── Animated Gradient Button ─────────────────────────────── */
.btn-gradient {
    background: linear-gradient(135deg, #7c3aed, #a855f7, #7c3aed);
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
    color: white;
    border: none;
    cursor: pointer;
}
@keyframes gradientShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ── Pulse Badge ──────────────────────────────────────────── */
.pulse-badge { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ── Skeleton Loading ─────────────────────────────────────── */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 8px;
}
.dark .skeleton {
    background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
    background-size: 200% 100%;
}
@keyframes skeleton-loading { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Category Cards ───────────────────────────────────────── */
.cat-card { transition: transform 0.25s ease, box-shadow 0.25s ease; }
.cat-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 30px -8px rgba(124, 58, 237, 0.25);
}

/* ── Admin Sidebar ────────────────────────────────────────── */
.admin-sidebar {
    width: 260px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
}
.admin-sidebar.collapsed { transform: translateX(-260px); }
.admin-main {
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-left: 260px;
}
.admin-main.expanded { margin-left: 0; }
@media (max-width: 768px) {
    .admin-sidebar { transform: translateX(-260px); }
    .admin-sidebar.mobile-open { transform: translateX(0); }
    .admin-main { margin-left: 0 !important; }
}

/* ── Sidebar Nav Items ────────────────────────────────────── */
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 14px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 500;
    color: #cbd5e1;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
    margin: 2px 4px;
}
.sidebar-link:hover { background: rgba(124,58,237,0.2); color: #c084fc; }
.sidebar-link.active { background: rgba(124,58,237,0.3); color: #a78bfa; }
.sidebar-link i { width: 18px; text-align: center; font-size: 14px; flex-shrink: 0; }

/* ── Stat Cards ───────────────────────────────────────────── */
.stat-card {
    border-radius: 16px;
    padding: 22px;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 12px 24px -6px rgba(0,0,0,0.2); }
.stat-card::after {
    content: '';
    position: absolute;
    bottom: -20px;
    right: -20px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
}

/* ── Table ────────────────────────────────────────────────── */
.data-table { border-collapse: separate; border-spacing: 0; width: 100%; }
.data-table th { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.data-table tbody tr { transition: background 0.15s; }
.data-table tbody tr:hover { background: rgba(124,58,237,0.04); }

/* ── Status Badges ────────────────────────────────────────── */
.status-pending    { background: #fef3c7; color: #92400e; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.status-processing { background: #dbeafe; color: #1e40af; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.status-shipped    { background: #e0e7ff; color: #3730a3; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.status-delivered  { background: #d1fae5; color: #065f46; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.status-cancelled  { background: #fee2e2; color: #991b1b; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.status-refunded   { background: #f3e8ff; color: #6b21a8; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }

/* ── Sidebar Overlay (mobile) ─────────────────────────────── */
#sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
    backdrop-filter: blur(2px);
}
#sidebar-overlay.active { display: block; }

/* ── Range Slider ─────────────────────────────────────────── */
input[type="range"] { -webkit-appearance: none; height: 4px; background: #e2e8f0; border-radius: 999px; outline: none; }
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: #7c3aed;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

/* ── Quantity Input ───────────────────────────────────────── */
.qty-input::-webkit-inner-spin-button,
.qty-input::-webkit-outer-spin-button { -webkit-appearance: none; }

/* ── Image Gallery ────────────────────────────────────────── */
.gallery-thumb { cursor: pointer; transition: opacity 0.2s, border-color 0.2s; }
.gallery-thumb:hover, .gallery-thumb.active { opacity: 1; border-color: #7c3aed; }
.gallery-thumb:not(.active) { opacity: 0.6; }

/* ── Review Stars Interactive ─────────────────────────────── */
.star-rating input { display: none; }
.star-rating label { font-size: 24px; color: #d1d5db; cursor: pointer; transition: color 0.15s; }
.star-rating input:checked ~ label,
.star-rating label:hover,
.star-rating label:hover ~ label { color: #f59e0b; }

/* ── QR Code Box ──────────────────────────────────────────── */
.qr-box {
    border: 3px dashed #7c3aed;
    padding: 16px;
    border-radius: 16px;
    display: inline-block;
    background: white;
}

/* ── Fade in on scroll ────────────────────────────────────── */
.fade-in-view {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}
.fade-in-view.visible { opacity: 1; transform: translateY(0); }

/* ── Smooth global transitions ────────────────────────────── */
a, button { transition: color 0.2s, background-color 0.2s, border-color 0.2s, box-shadow 0.2s; }

/* ── Auth form card ───────────────────────────────────────── */
.auth-card {
    background: white;
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.15);
}
.dark .auth-card {
    background: #1f2937;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.4);
}

/* ── Coupon Input ─────────────────────────────────────────── */
.coupon-applied {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    border: 1px dashed #059669;
    border-radius: 10px;
    padding: 10px 16px;
    color: #065f46;
    font-weight: 600;
}

/* ── Admin Form Inputs ─────────────────────────────────────── */
.admin-input {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 10px 16px;
    font-size: 14px;
    background: #f9fafb;
    color: #111827;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.admin-input:focus { border-color: #7c3aed; box-shadow: 0 0 0 3px rgba(124,58,237,0.12); }
.dark .admin-input { background: #111827; color: #f9fafb; border-color: #374151; }
.dark .admin-input:focus { border-color: #a78bfa; }

/* ── Visibility Toggle ────────────────────────────────────── */
.toggle-switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-track {
    width: 42px;
    height: 24px;
    background: #d1d5db;
    border-radius: 12px;
    position: relative;
    transition: background 0.25s;
}
.toggle-switch input:checked + .toggle-track { background: #7c3aed; }
.toggle-track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    transition: transform 0.25s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-track::after { transform: translateX(18px); }
