/* ==============================
   Digital Shop — Website Styles
   ============================== */

:root {
  --primary: #00b894;
  --primary-dark: #00a381;
  --secondary: #0984e3;
  --accent: #fdcb6e;
  --danger: #d63031;
  --warning: #e17055;
  --success: #00b894;
  --bg: #f5f6fa;
  --bg-card: #ffffff;
  --bg-dark: #1e272e;
  --text: #2d3436;
  --text-light: #636e72;
  --text-muted: #b2bec3;
  --border: #dfe6e9;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --max-width: 1200px;
  --header-height: 64px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

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

img { max-width: 100%; height: auto; }

/* ==============================
   Header / Navbar
   ============================== */

.navbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.navbar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.navbar-brand:hover { text-decoration: none; }

.navbar-brand .brand-icon {
  font-size: 1.5rem;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.navbar-nav a {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-light);
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.navbar-nav a:hover {
  background: var(--bg);
  color: var(--text);
  text-decoration: none;
}

.navbar-nav a.active {
  background: var(--primary);
  color: white;
}

/* Mobile menu */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px;
  color: var(--text);
}

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .navbar-nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--bg-card);
    flex-direction: column;
    padding: 12px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }
  .navbar-nav.open { display: flex; }
  .navbar-nav a { width: 100%; padding: 12px 16px; }
}

/* ==============================
   Layout
   ============================== */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px;
}

.page-header {
  padding: 40px 0 20px;
  text-align: center;
}

.page-header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.page-header p {
  color: var(--text-light);
  font-size: 1.05rem;
}

/* ==============================
   Cards
   ============================== */

.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card-body { padding: 20px; }
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ==============================
   Hero Section (Landing)
   ============================== */

.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  padding: 80px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 500px;
  height: 500px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 16px;
  position: relative;
}

.hero p {
  font-size: 1.15rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto 32px;
  position: relative;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
}

/* ==============================
   Buttons
   ============================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn:hover { text-decoration: none; transform: translateY(-1px); }

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover { background: var(--primary-dark); }

.btn-secondary {
  background: var(--secondary);
  color: white;
}
.btn-secondary:hover { background: #0770c2; }

.btn-outline {
  background: rgba(255,255,255,0.15);
  color: white;
  border: 2px solid rgba(255,255,255,0.4);
}
.btn-outline:hover { background: rgba(255,255,255,0.25); }

.btn-white {
  background: white;
  color: var(--primary);
}
.btn-white:hover { background: #f0f0f0; }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #c0392b; }

.btn-sm { padding: 6px 12px; font-size: 0.85rem; }
.btn-lg { padding: 14px 28px; font-size: 1.1rem; }

.btn-icon {
  background: none;
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-light);
}
.btn-icon:hover { background: var(--bg); color: var(--text); }

/* ==============================
   Features Grid (Landing)
   ============================== */

.features {
  padding: 60px 20px;
}

.features-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.feature-card {
  text-align: center;
  padding: 32px 24px;
}

.feature-card .icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.feature-card h3 {
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.feature-card p {
  color: var(--text-light);
  font-size: 0.95rem;
}

/* ==============================
   Product Grid (Catalog)
   ============================== */

.category-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  justify-content: center;
}

.category-tab {
  padding: 8px 18px;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: var(--bg-card);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  color: var(--text-light);
}

.category-tab:hover { border-color: var(--primary); color: var(--primary); }
.category-tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.product-card {
  cursor: default;
}

.product-card .product-img {
  height: 160px;
  background: linear-gradient(135deg, #dfe6e9, #b2bec3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.product-card .product-info {
  padding: 16px;
}

.product-card .product-name {
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.product-card .product-desc {
  color: var(--text-light);
  font-size: 0.85rem;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card .product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.product-card .product-price {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary);
}

.product-card .product-stock {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.product-card .product-stock.in-stock { color: var(--success); }
.product-card .product-stock.out-of-stock { color: var(--danger); }

/* Order buttons in product card */
.product-order-btns {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.product-order-btns .btn {
  flex: 1;
  justify-content: center;
  font-size: 0.8rem;
  padding: 8px 10px;
  text-align: center;
}

.btn-wa {
  background: #25d366;
  color: white !important;
}
.btn-wa:hover { background: #1ebe57; text-decoration: none; }

.btn-tg {
  background: #0088cc;
  color: white !important;
}
.btn-tg:hover { background: #0077b5; text-decoration: none; }

/* ==============================
   Order Status
   ============================== */

.order-search {
  max-width: 500px;
  margin: 0 auto 32px;
  display: flex;
  gap: 8px;
}

.order-search input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.order-search input:focus { border-color: var(--primary); }

.order-result {
  max-width: 600px;
  margin: 0 auto;
}

.order-detail-card .status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.status-pending   { background: #ffeaa7; color: #d68910; }
.status-paid      { background: #81ecec; color: #00878a; }
.status-completed { background: #55efc4; color: #00724d; }
.status-cancelled { background: #fab1a0; color: #c0392b; }
.status-expired   { background: #dfe6e9; color: #636e72; }

.order-items {
  margin-top: 16px;
}

.order-items table {
  width: 100%;
  border-collapse: collapse;
}

.order-items th,
.order-items td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.order-items th {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}

/* ==============================
   Admin Dashboard
   ============================== */

.admin-login {
  max-width: 400px;
  margin: 60px auto;
}

.admin-login input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  margin-bottom: 12px;
  outline: none;
}
.admin-login input:focus { border-color: var(--primary); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  padding: 20px;
  text-align: center;
}

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
}

.stat-card .stat-label {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 4px;
}

.stat-card.revenue .stat-value { color: var(--success); }
.stat-card.warning .stat-value { color: var(--warning); }

.admin-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border);
  overflow-x: auto;
}

.admin-tab {
  padding: 10px 20px;
  cursor: pointer;
  font-weight: 500;
  color: var(--text-light);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-size: 0.95rem;
  transition: all 0.2s;
}

.admin-tab:hover { color: var(--text); }
.admin-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Admin tables */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.admin-table th {
  background: var(--bg);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--text-muted);
}

.admin-table tr:hover td {
  background: rgba(0,184,148,0.03);
}

/* Forms */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--primary);
}

.form-group textarea { min-height: 100px; resize: vertical; }

/* Modal */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.modal-backdrop.open { display: flex; }

.modal {
  background: var(--bg-card);
  border-radius: var(--radius);
  max-width: 500px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
}

.modal-body { padding: 20px; }

.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-light);
  padding: 0;
  line-height: 1;
}

/* ==============================
   Footer
   ============================== */

.site-footer {
  background: var(--bg-dark);
  color: rgba(255,255,255,0.7);
  padding: 40px 20px;
  margin-top: 60px;
  text-align: center;
}

.site-footer a {
  color: var(--accent);
}

.footer-links {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  color: white;
  font-size: 0.9rem;
}

.footer-links a:hover {
  background: rgba(255,255,255,0.2);
  text-decoration: none;
}

/* ==============================
   Utilities
   ============================== */

.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--text-light); }
.text-sm     { font-size: 0.85rem; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.hidden { display: none !important; }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}

.empty-state .icon { font-size: 3rem; margin-bottom: 12px; }

.loading-spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  background: var(--bg-dark);
  color: white;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 300;
  font-size: 0.9rem;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

/* Responsive */
@media (max-width: 768px) {
  .hero { padding: 50px 20px; }
  .hero h1 { font-size: 1.8rem; }
  .page-header h1 { font-size: 1.5rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .products-grid { grid-template-columns: 1fr; }
  .admin-table { font-size: 0.8rem; }
  .admin-table th, .admin-table td { padding: 8px 10px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .order-search { flex-direction: column; }
}
