/* =============================================
   assets/css/style.css - Warung USKI
   ============================================= */

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

/* ---- CSS Variables ---- */
:root {
  --primary:       #1a56db;
  --primary-dark:  #1141a3;
  --primary-light: #e8f0fe;
  --accent:        #ef4444;
  --accent-hover:  #dc2626;
  --success:       #10b981;
  --warning:       #f59e0b;
  --info:          #3b82f6;
  --white:         #ffffff;
  --bg:            #f4f7fe;
  --bg-card:       #ffffff;
  --text:          #1e2432;
  --text-muted:    #6b7280;
  --border:        #e5e7eb;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.08);
  --shadow:        0 4px 16px rgba(26,86,219,.10);
  --shadow-lg:     0 12px 40px rgba(26,86,219,.15);
  --radius:        12px;
  --radius-lg:     20px;
  --radius-full:   9999px;
  --transition:    .2s cubic-bezier(.4,0,.2,1);
  --font:          'Plus Jakarta Sans', sans-serif;
  --font-display:  'Sora', sans-serif;
}

/* Dark mode */
[data-theme="dark"] {
  --primary:       #3b7dff;
  --primary-dark:  #1a56db;
  --primary-light: #1e2d4a;
  --white:         #1a1f2e;
  --bg:            #0f1623;
  --bg-card:       #1a2235;
  --text:          #e8ecf4;
  --text-muted:    #8d97b0;
  --border:        #2a3349;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.3);
  --shadow:        0 4px 16px rgba(0,0,0,.4);
  --shadow-lg:     0 12px 40px rgba(0,0,0,.5);
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
  transition: background var(--transition), color var(--transition);
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; }

/* ---- Loading Screen ---- */
#loading-screen {
  position: fixed; inset: 0;
  background: var(--white);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 9999;
  transition: opacity .4s, visibility .4s;
}
#loading-screen.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loading-logo { width: 80px; margin-bottom: 20px; }
.loading-spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Toast Notifications ---- */
#toast-container {
  position: fixed; top: 80px; right: 20px;
  z-index: 9000; display: flex; flex-direction: column; gap: 10px;
}
.toast {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--primary);
  min-width: 280px; max-width: 360px;
  animation: slideInRight .3s ease forwards;
  font-size: 14px;
}
.toast.success { border-left-color: var(--success); }
.toast.error   { border-left-color: var(--accent); }
.toast.warning { border-left-color: var(--warning); }
.toast-icon { font-size: 18px; flex-shrink: 0; }
.toast-close {
  margin-left: auto; background: none; border: none;
  cursor: pointer; color: var(--text-muted); font-size: 16px;
  padding: 2px 6px; border-radius: 4px;
}
.toast-close:hover { color: var(--text); background: var(--bg); }
@keyframes slideInRight {
  from { transform: translateX(110%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
@keyframes slideOutRight {
  from { transform: translateX(0);    opacity: 1; }
  to   { transform: translateX(110%); opacity: 0; }
}

/* ---- Navbar ---- */
.navbar-uski {
  background: var(--white);
  box-shadow: var(--shadow-sm);
  border-bottom: 1px solid var(--border);
  padding: 0 !important;
  position: sticky; top: 0; z-index: 1000;
  transition: background var(--transition);
}
.navbar-uski .container-fluid { padding: 0 24px; }
.navbar-brand { font-family: var(--font-display); font-weight: 700; font-size: 20px; color: var(--primary) !important; display: flex; align-items: center; gap: 10px; }
.navbar-brand img { height: 36px; width: auto; border-radius: 6px; }
.navbar-uski .nav-link { color: var(--text) !important; font-weight: 500; font-size: 14px; padding: 8px 14px !important; border-radius: 8px; transition: all var(--transition); }
.navbar-uski .nav-link:hover, .navbar-uski .nav-link.active { color: var(--primary) !important; background: var(--primary-light); }
.navbar-cart-btn {
  position: relative; background: none; border: none;
  color: var(--text); font-size: 20px; padding: 8px 12px;
  border-radius: 8px; transition: all var(--transition); cursor: pointer;
}
.navbar-cart-btn:hover { color: var(--primary); background: var(--primary-light); }
.cart-badge {
  position: absolute; top: 2px; right: 2px;
  background: var(--accent); color: white; font-size: 10px;
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.btn-login-nav {
  background: var(--primary); color: white !important;
  border-radius: var(--radius-full) !important;
  padding: 7px 20px !important; font-weight: 600 !important;
  transition: all var(--transition) !important;
}
.btn-login-nav:hover { background: var(--primary-dark) !important; transform: translateY(-1px); }
.dark-toggle-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 18px; padding: 8px;
  border-radius: 8px; transition: all var(--transition);
}
.dark-toggle-btn:hover { color: var(--primary); background: var(--primary-light); }

/* ---- Hero Section ---- */
.hero-section {
  background: linear-gradient(135deg, var(--primary) 0%, #0d3a8e 100%);
  color: white; padding: 80px 0;
  position: relative; overflow: hidden;
}
.hero-section::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.04'%3E%3Ccircle cx='30' cy='30' r='20'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-section .container { position: relative; z-index: 1; }
.hero-title { font-family: var(--font-display); font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 700; line-height: 1.2; }
.hero-subtitle { font-size: 1.1rem; opacity: .85; margin: 16px 0 32px; }
.hero-image-placeholder {
  background: rgba(255,255,255,.1);
  border: 2px dashed rgba(255,255,255,.3);
  border-radius: var(--radius-lg);
  height: 320px; display: flex;
  flex-direction: column; align-items: center; justify-content: center;
  color: rgba(255,255,255,.6); font-size: 14px;
}

/* ---- Cards ---- */
.card-uski {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  overflow: hidden;
}
.card-uski:hover { box-shadow: var(--shadow); transform: translateY(-3px); }

/* ---- Product Card ---- */
.product-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: all var(--transition);
  height: 100%;
}
.product-card:hover { box-shadow: var(--shadow); transform: translateY(-4px); }
.product-card-img {
  width: 100%; height: 180px; object-fit: cover;
  background: var(--primary-light);
}
.product-card-img-placeholder {
  width: 100%; height: 180px;
  background: linear-gradient(135deg, var(--primary-light), #dbeafe);
  display: flex; align-items: center; justify-content: center;
  font-size: 48px; color: var(--primary);
}
.product-card-body { padding: 16px; }
.product-card-title { font-weight: 600; font-size: 15px; margin-bottom: 4px; color: var(--text); line-height: 1.3; }
.product-card-category { font-size: 12px; color: var(--primary); background: var(--primary-light); padding: 2px 8px; border-radius: var(--radius-full); display: inline-block; margin-bottom: 8px; }
.product-card-price { font-family: var(--font-display); font-weight: 700; font-size: 18px; color: var(--primary); }
.product-card-stock { font-size: 12px; color: var(--text-muted); }
.product-card-stock.low { color: var(--warning); }
.product-card-stock.empty { color: var(--accent); }
.badge-habis { background: var(--accent); color: white; font-size: 11px; padding: 3px 8px; border-radius: var(--radius-full); }

/* ---- Buttons ---- */
.btn-primary-uski {
  background: var(--primary); color: white;
  border: none; border-radius: var(--radius);
  padding: 10px 24px; font-weight: 600; font-size: 14px;
  cursor: pointer; transition: all var(--transition);
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-primary-uski:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(26,86,219,.3); color: white; }

.btn-danger-uski {
  background: var(--accent); color: white;
  border: none; border-radius: var(--radius);
  padding: 10px 24px; font-weight: 600; font-size: 14px;
  cursor: pointer; transition: all var(--transition);
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-danger-uski:hover { background: var(--accent-hover); color: white; }

.btn-outline-uski {
  background: transparent; color: var(--primary);
  border: 2px solid var(--primary); border-radius: var(--radius);
  padding: 9px 24px; font-weight: 600; font-size: 14px;
  cursor: pointer; transition: all var(--transition);
}
.btn-outline-uski:hover { background: var(--primary); color: white; }

/* ---- Forms ---- */
.form-group { margin-bottom: 20px; }
.form-label { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 6px; display: block; }
.form-control-uski {
  width: 100%; padding: 11px 16px;
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: var(--radius); font-family: var(--font);
  font-size: 14px; color: var(--text);
  transition: all var(--transition); outline: none;
}
.form-control-uski:focus { border-color: var(--primary); background: var(--white); box-shadow: 0 0 0 3px rgba(26,86,219,.12); }
.form-control-uski::placeholder { color: var(--text-muted); }
.input-group-uski { position: relative; }
.input-group-uski .form-control-uski { padding-right: 46px; }
.input-group-uski .input-icon {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); cursor: pointer; font-size: 16px;
  background: none; border: none;
}
.input-group-uski .input-icon:hover { color: var(--primary); }

/* ---- Stats Cards ---- */
.stat-card {
  background: var(--bg-card); border-radius: var(--radius-lg);
  border: 1px solid var(--border); padding: 24px;
  display: flex; align-items: center; gap: 16px;
  transition: all var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.stat-icon {
  width: 56px; height: 56px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; flex-shrink: 0;
}
.stat-icon.blue   { background: var(--primary-light); color: var(--primary); }
.stat-icon.green  { background: #d1fae5; color: var(--success); }
.stat-icon.orange { background: #fef3c7; color: var(--warning); }
.stat-icon.red    { background: #fee2e2; color: var(--accent); }
.stat-value { font-family: var(--font-display); font-size: clamp(14px, 3vw, 26px); font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* ---- Empty State ---- */
.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state-icon { font-size: 64px; margin-bottom: 16px; opacity: .4; }
.empty-state h3 { font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.empty-state p { font-size: 14px; margin-bottom: 24px; }

/* ---- Section Headers ---- */
.section-title {
  font-family: var(--font-display);
  font-size: 1.8rem; font-weight: 700; color: var(--text);
  margin-bottom: 8px;
}
.section-subtitle { color: var(--text-muted); font-size: 15px; margin-bottom: 32px; }
.section-divider {
  width: 50px; height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 2px; margin-bottom: 12px;
}

/* ---- Status Badges ---- */
.status-badge {
  padding: 4px 12px; border-radius: var(--radius-full);
  font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px;
}
.status-badge.pending    { background: #fef3c7; color: #92400e; }
.status-badge.diproses   { background: #dbeafe; color: #1e40af; }
.status-badge.selesai    { background: #d1fae5; color: #065f46; }
.status-badge.dibatalkan { background: #fee2e2; color: #991b1b; }

/* ---- Table ---- */
.table-uski { width: 100%; border-collapse: separate; border-spacing: 0; }
.table-uski thead th {
  background: var(--primary-light); color: var(--primary);
  font-weight: 600; font-size: 13px; text-transform: uppercase;
  letter-spacing: .5px; padding: 12px 16px; border-bottom: 2px solid var(--border);
}
.table-uski tbody tr { transition: background var(--transition); }
.table-uski tbody tr:hover { background: var(--primary-light); }
.table-uski tbody td { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 14px; color: var(--text); vertical-align: middle; }

/* ---- Footer ---- */
.footer-uski {
  background: #0f1c3f; color: rgba(255,255,255,.75);
  padding: 48px 0 24px;
}
.footer-brand { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: white; margin-bottom: 12px; }
.footer-link { color: rgba(255,255,255,.65); font-size: 14px; transition: color var(--transition); display: block; margin-bottom: 8px; }
.footer-link:hover { color: white; }
.footer-divider { border-color: rgba(255,255,255,.1); margin: 32px 0 24px; }
.footer-bottom { font-size: 13px; color: rgba(255,255,255,.45); }

/* ---- Quantity Selector ---- */
.qty-selector { display: flex; align-items: center; gap: 0; border: 1.5px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.qty-btn { background: var(--bg); border: none; padding: 8px 14px; cursor: pointer; font-size: 16px; font-weight: 700; color: var(--text); transition: all var(--transition); }
.qty-btn:hover { background: var(--primary); color: white; }
.qty-input { border: none; width: 48px; text-align: center; font-size: 14px; font-weight: 600; background: var(--white); color: var(--text); padding: 8px 0; }
.qty-input:focus { outline: none; }

/* ---- Search Bar ---- */
.search-bar {
  display: flex; align-items: center;
  background: var(--bg-card); border: 1.5px solid var(--border);
  border-radius: var(--radius-full); overflow: hidden;
  transition: all var(--transition);
}
.search-bar:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,86,219,.1); }
.search-bar input {
  flex: 1; border: none; background: none; padding: 10px 18px;
  font-family: var(--font); font-size: 14px; color: var(--text); outline: none;
}
.search-bar button {
  background: var(--primary); border: none; color: white;
  padding: 10px 18px; cursor: pointer; font-size: 16px; transition: background var(--transition);
}
.search-bar button:hover { background: var(--primary-dark); }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .hero-section { padding: 48px 0; }
  .hero-title { font-size: 2rem; }
  .stat-value { font-size: 20px; }
  .section-title { font-size: 1.4rem; }
}

@media (max-width: 576px) {
  body { font-size: 14px; }
  .navbar-uski .container-fluid { padding: 0 16px; }
}

/* ---- Utility ---- */
.text-primary-uski { color: var(--primary); }
.bg-primary-uski   { background: var(--primary); }
.rounded-uski      { border-radius: var(--radius); }
.shadow-uski       { box-shadow: var(--shadow); }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
