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

:root, html[data-theme="blue"] {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: rgba(37, 99, 235, 0.15);
    --secondary: #e2e8f0;
    --accent: #f59e0b;
    --success: #10b981;
    --danger: #f43f5e;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --bg-main: rgba(255, 255, 255, 0.7);
    --bg-solid: #ffffff;
    --bg-off: #f8fafc;
    --border: rgba(255, 255, 255, 0.5);
    --border-dark: rgba(15, 23, 42, 0.08);
    --radius: 20px;
    --shadow: 0 8px 32px rgba(15, 23, 42, 0.06);
    --shadow-hover: 0 16px 48px rgba(37, 99, 235, 0.15);
    --transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    
    --orb-1: rgba(59, 130, 246, 0.25);
    --orb-2: rgba(168, 85, 247, 0.2);
}

html[data-theme="light"] {
    --primary: #18181b;
    --primary-dark: #000000;
    --primary-light: rgba(24, 24, 27, 0.1);
    --secondary: #f4f4f5;
    --accent: #a1a1aa;
    --success: #22c55e;
    --danger: #ef4444;
    --text-main: #18181b;
    --text-muted: #71717a;
    --bg-main: rgba(255, 255, 255, 0.75);
    --bg-solid: #ffffff;
    --bg-off: #fafafa;
    --border: rgba(255, 255, 255, 0.8);
    --border-dark: rgba(0, 0, 0, 0.05);
    --radius: 20px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.04);
    --shadow-hover: 0 16px 48px rgba(0, 0, 0, 0.1);
    --transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    --orb-1: rgba(200, 200, 200, 0.3);
    --orb-2: rgba(230, 230, 230, 0.4);
}

html[data-theme="dark"] {
    --primary: #c084fc;
    --primary-dark: #a855f7;
    --primary-light: rgba(192, 132, 252, 0.15);
    --secondary: #27272a;
    --accent: #2dd4bf;
    --success: #10b981;
    --danger: #fb7185;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --bg-main: rgba(24, 24, 27, 0.55);
    --bg-solid: #18181b;
    --bg-off: #09090b;
    --border: rgba(255, 255, 255, 0.05);
    --border-dark: rgba(255, 255, 255, 0.1);
    --radius: 20px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 16px 48px rgba(192, 132, 252, 0.2);
    --transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    --orb-1: rgba(168, 85, 247, 0.15);
    --orb-2: rgba(45, 212, 191, 0.1);
}

html[data-theme="green"] {
    --primary: #059669;
    --primary-dark: #047857;
    --primary-light: rgba(5, 150, 105, 0.15);
    --secondary: #d1fae5;
    --accent: #fbbf24;
    --success: #10b981;
    --danger: #ef4444;
    --text-main: #022c22;
    --text-muted: #047857;
    --bg-main: rgba(255, 255, 255, 0.7);
    --bg-solid: #ffffff;
    --bg-off: #ecfdf5;
    --border: rgba(255, 255, 255, 0.6);
    --border-dark: rgba(5, 150, 105, 0.1);
    --radius: 20px;
    --shadow: 0 8px 32px rgba(4, 120, 87, 0.08);
    --shadow-hover: 0 16px 48px rgba(5, 150, 105, 0.15);
    --transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    --orb-1: rgba(16, 185, 129, 0.2);
    --orb-2: rgba(245, 158, 11, 0.15);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-off);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* -------------------------------------
   Animated Mesh Background (Glassmorphism)
   -------------------------------------*/
body::before, body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.8;
    animation: floatingOrbs 20s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}
body::before {
    width: 60vw;
    height: 60vw;
    background: var(--orb-1);
    top: -20%;
    left: -10%;
}
body::after {
    width: 50vw;
    height: 50vw;
    background: var(--orb-2);
    bottom: -15%;
    right: -10%;
    animation-delay: -5s;
    animation-duration: 25s;
}

@keyframes floatingOrbs {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(10%, 5%) scale(1.1); }
    66% { transform: translate(-5%, 15%) scale(0.95); }
    100% { transform: translate(-10%, -10%) scale(1.05); }
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: var(--transition);
}
a:hover { color: var(--primary-dark); }

img { max-width: 100%; display: block; }

/* -------------------------------------
   Navbar
   -------------------------------------*/
.navbar {
    background: var(--bg-main);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 1.2rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03);
}

.brand {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.5px;
}
.brand span { color: var(--text-main); }

.nav-links { display: flex; gap: 2.5rem; align-items: center; }
.nav-links a {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    position: relative;
    padding: 0.5rem 0;
}
.nav-links a:hover, .nav-links a.active { color: var(--primary); }
.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    bottom: 0;
    left: 0;
    background-color: var(--primary);
    transition: width 0.3s ease;
    border-radius: 5px;
}
.nav-links a:hover::after { width: 100%; }

/* -------------------------------------
   Buttons
   -------------------------------------*/
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.8rem;
    border-radius: 50px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    gap: 8px;
    font-size: 0.95rem;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white !important;
    box-shadow: 0 4px 15px var(--primary-light);
}
.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 25px var(--primary-light);
}
.btn-primary::before {
    content: ''; position: absolute; top:0; left:-100%; width:100%; height:100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: 0.4s; z-index: -1;
}
.btn-primary:hover::before { left: 100%; }

.btn-outline {
    background: var(--bg-main);
    backdrop-filter: blur(10px);
    border: 2px solid var(--primary);
    color: var(--primary) !important;
}
.btn-outline:hover {
    background: var(--primary-light);
    transform: translateY(-3px);
}

.btn-success { background: var(--success); color: white !important; }
.btn-danger { background: var(--danger); color: white !important; }

/* -------------------------------------
   Hero Section
   -------------------------------------*/
.hero {
    background: transparent;
    padding: 8rem 5% 6rem 5%;
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.hero h1 {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.1;
    letter-spacing: -1.5px;
    background: linear-gradient(135deg, var(--text-main) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    max-width: 900px;
    animation: fadeInDown 0.8s ease-out forwards;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    font-weight: 500;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
    animation: fadeInUp 0.8s 0.2s ease-out forwards;
    opacity: 0;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* -------------------------------------
   Products Card (Glass & Hover)
   -------------------------------------*/
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 5rem;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2.5rem;
    margin-top: 2rem;
}

.product-card {
    background: var(--bg-main);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
}

.product-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-8px) scale(1.02);
    border-color: var(--border-dark);
}

.product-media {
    height: 240px;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    margin: 15px 15px 0 15px;
    border-radius: calc(var(--radius) - 5px);
}

.product-media img, .product-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

.video-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    color: white;
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 3;
    border: 1px solid rgba(255,255,255,0.1);
}

.product-info {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 1.35rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    line-height: 1.3;
}

.product-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;  
    overflow: hidden;
    line-height: 1.6;
}

.product-price {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.product-price::before {
    content: 'Rp';
    font-size: 1rem;
    font-weight: 700;
    margin-top: 6px;
}

/* -------------------------------------
   Forms & Controls
   -------------------------------------*/
.form-group { margin-bottom: 1.5rem; }
.form-label {
    display: block;
    font-weight: 700;
    margin-bottom: 0.8rem;
    color: var(--text-main);
    font-size: 0.95rem;
}
.form-control {
    width: 100%;
    padding: 1rem 1.5rem;
    border: 1px solid var(--border-dark);
    border-radius: 12px;
    font-size: 1rem;
    transition: var(--transition);
    background: var(--bg-solid);
    color: var(--text-main);
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
    background: var(--bg-main);
}

/* -------------------------------------
   Tables
   -------------------------------------*/
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 1.5rem;
    background: var(--bg-main);
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
th, td {
    padding: 1.2rem;
    text-align: left;
    border-bottom: 1px solid var(--border-dark);
}
th {
    background-color: var(--primary-light);
    font-weight: 800;
    color: var(--primary-dark);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background-color: var(--primary-light); }

/* -------------------------------------
   Badges
   -------------------------------------*/
.badge {
    padding: 8px 14px;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-block;
}
.badge-pending { background: rgba(245, 158, 11, 0.15); color: #d97706; }
.badge-paid { background: rgba(16, 185, 129, 0.15); color: #059669; }
.badge-installment { background: var(--primary-light); color: var(--primary-dark); }

/* -------------------------------------
   Admin Layout Grid 
   -------------------------------------*/
.admin-layout { display: flex; min-height: 100vh; }
.sidebar {
    width: 280px;
    background: var(--bg-main);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border);
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    z-index: 10;
    box-shadow: 4px 0 24px rgba(0,0,0,0.02);
}
.main-content {
    flex-grow: 1;
    padding: 3rem;
    background: transparent;
    overflow-x: auto;
    z-index: 1;
}

@media (max-width: 768px) {
    .admin-layout { flex-direction: column; }
    .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border-dark); padding: 1.5rem; }
    .hero { padding: 4rem 5%; }
    .hero h1 { font-size: 2.5rem; }
    .products-grid { grid-template-columns: 1fr; }
}
