@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #7c3aed;
    --primary-hover: #6d28d9;
    --primary-light: #ede9fe;
    --secondary: #059669;
    --secondary-light: #d1fae5;
    --accent: #f59e0b;
    --bg-main: #f8fafc;
    --bg-white: #ffffff;
    --bg-card: #ffffff;
    --bg-subtle: #f1f5f9;
    --text-dark: #0f172a;
    --text-body: #334155;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --border: #e2e8f0;
    --border-focus: #7c3aed;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.10), 0 4px 12px rgba(0,0,0,0.06);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.12);
    --shadow-purple: 0 8px 25px rgba(124, 58, 237, 0.25);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --font-main: 'Inter', sans-serif;
    /* Legacy dark mode compat */
    --glass-border: #e2e8f0;
    --glass-bg: rgba(255,255,255,0.9);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-main);
    background-color: var(--bg-main);
    color: var(--text-body);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ============================================================
   PARTICLE CANVAS BACKGROUND
   ============================================================ */
#particles-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
}

.bg-glow { display: none; } /* legacy - hidden */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

/* ============================================================
   NAVIGATION
   ============================================================ */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 8px;
    align-items: center;
}

.nav-links a {
    color: var(--text-body);
    text-decoration: none;
    font-weight: 500;
    transition: 0.2s;
    font-size: 0.9rem;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
}

.nav-links a:hover { color: var(--primary); background: var(--primary-light); }

.mobile-menu-btn {
    display: none;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    color: var(--text-dark);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), #a855f7);
    color: white;
    padding: 11px 24px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    transition: 0.2s;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: var(--shadow-purple);
    font-size: 0.9rem;
    cursor: pointer;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(124, 58, 237, 0.35);
    opacity: 0.95;
}

.btn-secondary {
    background: var(--bg-white);
    border: 1.5px solid var(--border);
    color: var(--text-body);
    padding: 11px 20px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.9rem;
    cursor: pointer;
}

.btn-secondary:hover {
    background: var(--bg-subtle);
    border-color: var(--text-muted);
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
    padding: 100px 0 70px;
    text-align: center;
    position: relative;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-light);
    color: var(--primary);
    padding: 8px 18px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 28px;
}

.hero h1 {
    font-size: clamp(2.2rem, 5vw, 4rem);
    font-weight: 800;
    margin-bottom: 20px;
    color: var(--text-dark);
    line-height: 1.15;
    letter-spacing: -1.5px;
}

.hero h1 span {
    background: linear-gradient(135deg, #7c3aed, #a855f7, #ec4899);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: var(--text-muted);
    max-width: 650px;
    margin: 0 auto 42px;
    line-height: 1.7;
}

/* ============================================================
   STATS / FEATURES CARDS
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 60px;
}

.stat-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    padding: 36px 28px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: 0.3s;
    text-align: left;
}

.stat-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.stat-card h3 { color: var(--text-dark); font-size: 1.1rem; margin-bottom: 10px; font-weight: 700; }
.stat-card p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.7; }

/* ============================================================
   PRODUCT CARDS
   ============================================================ */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 24px;
    width: 100%;
}

.product-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: 0.3s;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
}

.product-img {
    width: 100%;
    height: 200px;
    background: var(--bg-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}

.product-img img {
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    transition: transform 0.4s ease;
}

.product-card:hover .product-img img { transform: scale(1.04); }

.badge {
    position: absolute;
    top: 12px; right: 12px;
    background: var(--primary);
    color: white;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-info { padding: 22px; flex: 1; display: flex; flex-direction: column; }
.product-info h3 { font-size: 1.15rem; margin-bottom: 8px; color: var(--text-dark); font-weight: 700; }

.price-row { border-top: 1px solid var(--border); padding-top: 18px; margin-top: auto; }
.price { font-size: 1.5rem; font-weight: 800; color: var(--text-dark); margin-bottom: 14px; }
.price span { font-size: 0.85rem; color: var(--text-muted); font-weight: 400; }

.btn-group { display: flex; gap: 10px; }
.btn-group a { flex: 1; text-align: center; padding: 10px; font-size: 0.85rem; }

/* Section titles */
.section-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 14px;
    letter-spacing: -0.5px;
}

.section-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 44px;
}

/* ============================================================
   DASHBOARD
   ============================================================ */
.dashboard-container {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: var(--bg-white);
    border-right: 1px solid var(--border);
    padding: 28px 20px;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 100;
    overflow-y: auto;
    box-shadow: var(--shadow-sm);
}

.main-content { padding: 36px 40px; overflow-y: auto; }

.sidebar-nav { list-style: none; margin-top: 36px; }
.sidebar-nav a {
    color: var(--text-muted);
    text-decoration: none;
    display: flex;
    align-items: center; gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    transition: 0.2s;
    font-size: 0.92rem;
    font-weight: 500;
}

.sidebar-nav a:hover, .sidebar-nav a.active {
    background: var(--primary-light);
    color: var(--primary);
}

.welcome-card {
    background: linear-gradient(135deg, var(--primary) 0%, #a855f7 100%);
    padding: 32px 36px;
    border-radius: var(--radius-lg);
    margin-bottom: 36px;
    color: white;
    position: relative;
    overflow: hidden;
}

.welcome-card::before {
    content: '';
    position: absolute;
    top: -40px; right: -40px;
    width: 180px; height: 180px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
}

.welcome-card h2 { font-size: 1.6rem; font-weight: 700; margin-bottom: 6px; }
.welcome-card p { font-size: 0.9rem; opacity: 0.85; }

.mobile-header {
    display: none;
    padding: 14px 20px;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1100;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.4);
    z-index: 999;
    backdrop-filter: blur(4px);
}
.sidebar-overlay.active { display: block; }

.script-card-mini {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    gap: 15px;
    box-shadow: var(--shadow-sm);
    transition: 0.2s;
}

.script-card-mini:hover { box-shadow: var(--shadow-md); border-color: var(--primary); }
.script-card-mini img { width: 60px; height: 60px; border-radius: 10px; object-fit: cover; }

/* Status badges */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-completed { background: #dcfce7; color: #15803d; }
.status-pending { background: #fef9c3; color: #a16207; }
.status-paid { background: #dbeafe; color: #1d4ed8; }
.status-rejected { background: #fee2e2; color: #b91c1c; }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 20px; }
.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-body);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    background: var(--bg-white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    color: var(--text-dark);
    font-family: var(--font-main);
    font-size: 0.9rem;
    transition: 0.2s;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

/* ============================================================
   MODAL / OVERLAY
   ============================================================ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.6);
    backdrop-filter: blur(8px);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-body {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 520px;
    padding: 40px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
}

.modal-body::-webkit-scrollbar { display: none; }

/* ============================================================
   ALERTS / TOAST
   ============================================================ */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.alert-warning { background: #fef9c3; color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.alert-error { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }

/* ============================================================
   ADMIN PANEL
   ============================================================ */
.admin-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
    background: var(--bg-main);
}

.content-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-sm);
}

table { width: 100%; border-collapse: collapse; margin-top: 16px; }
th {
    text-align: left;
    padding: 12px 16px;
    color: var(--text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border);
    font-weight: 700;
}

td {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--text-body);
    vertical-align: middle;
}

tr:hover td { background: var(--bg-subtle); }

.btn-approve {
    background: #dcfce7;
    color: #15803d;
    padding: 7px 14px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 700;
    transition: 0.2s;
    border: 1px solid #bbf7d0;
}

.btn-reject {
    background: #fee2e2;
    color: #b91c1c;
    padding: 7px 14px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 700;
    transition: 0.2s;
    border: 1px solid #fecaca;
}

.btn-approve:hover, .btn-reject:hover { opacity: 0.8; transform: scale(0.97); }

/* Admin sidebar */
.admin-sidebar {
    background: var(--bg-white);
    border-right: 1px solid var(--border);
    padding: 28px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    box-shadow: var(--shadow-sm);
}

.nav-list { list-style: none; margin-top: 40px; }
.nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    text-decoration: none;
    transition: 0.2s;
    font-weight: 500;
    font-size: 0.9rem;
}

.nav-link:hover, .nav-link.active {
    background: var(--primary-light);
    color: var(--primary);
}

.nav-info { display: flex; align-items: center; gap: 12px; }
.nav-badge {
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 50px;
    font-size: 0.68rem;
    font-weight: 700;
}

.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.mobile-order-card { display: none; }

/* ============================================================
   CHECKOUT PAGE
   ============================================================ */
.checkout-wrapper {
    max-width: 1000px;
    margin: 60px auto;
    padding: 0 20px;
    animation: fadeIn 0.5s ease-out;
    position: relative;
    z-index: 1;
}

.checkout-container {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 36px;
    align-items: start;
}

.product-section, .payment-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
}

.product-section { padding: 36px; position: sticky; top: 80px; }
.payment-section { display: flex; flex-direction: column; gap: 20px; }

.payment-card {
    padding: 28px;
    transition: 0.3s;
    cursor: pointer;
}

.payment-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-purple);
    transform: translateY(-3px);
}

.payment-card.active {
    border-color: var(--primary);
    box-shadow: var(--shadow-purple);
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes popIn {
    from { opacity: 0; transform: scale(0.85); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .admin-layout { display: block !important; }
    .sidebar, .admin-sidebar { display: none !important; }
    .main-content { padding: 24px 20px !important; width: 100% !important; }
    .content-card { padding: 20px; border-radius: 16px; }
    .table-wrapper { display: none; }
    .mobile-order-card { display: block; }
}

@media (max-width: 900px) {
    .checkout-container { grid-template-columns: 1fr; }
    .product-section { position: static; }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(255,255,255,0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 24px 20px;
        gap: 6px;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-lg);
    }
    .nav-links.active { display: flex; }
    .mobile-menu-btn { display: block; }
    .product-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
    .btn-group { flex-direction: column; }
    .dashboard-container { grid-template-columns: 1fr; }
    .mobile-header { display: flex !important; }
    .welcome-card { padding: 24px 22px; border-radius: 18px; }
    .main-content { padding: 24px 18px; }
    .sidebar {
        position: fixed;
        left: -280px;
        width: 270px;
        transition: left 0.3s ease;
    }
    .sidebar.active { left: 0; }
    .modal-overlay { align-items: flex-end; padding: 0; }
    .modal-body {
        max-width: 100%;
        border-radius: 24px 24px 0 0;
        padding: 32px 22px 44px;
        animation: slideUp 0.4s cubic-bezier(0.4,0,0.2,1);
    }
}

@media (max-width: 600px) {
    .product-grid { grid-template-columns: 1fr; }
    .hero { padding: 70px 0 50px; }
    .hero h1 { letter-spacing: -1px; }
    .script-card-mini { flex-direction: column; align-items: flex-start; }
    .script-card-mini .btn-primary { width: 100%; }
    .checkout-wrapper { margin-top: 16px; }
}

/* ============================================================
   SUPPORT WIDGET
   ============================================================ */
@media (max-width: 768px) {
    .support-widget { bottom: 15px !important; right: 15px !important; }
    .support-bubble { width: 50px !important; height: 50px !important; }
    .chat-window {
        position: fixed !important;
        left: 0 !important; right: 0 !important; bottom: 0 !important;
        width: 100% !important; height: 88vh !important;
        max-height: 88vh !important;
        border-radius: 20px 20px 0 0 !important;
        z-index: 10001 !important;
    }
}

@media (min-width: 769px) {
    .chat-window { width: 360px !important; height: 500px !important; }
}
