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

:root {
  --primary-color: hsl(220, 72%, 56%);
  --primary-light: hsl(220, 72%, 95%);
  --secondary-color: hsl(160, 55%, 45%);
  --bg-color: #f8f9fc;
  --surface-color: #ffffff;
  --text-primary: hsl(220, 25%, 15%);
  --text-secondary: hsl(220, 15%, 50%);
  --border-color: hsl(220, 20%, 92%);
  --danger-color: hsl(0, 72%, 56%);
  --warning-color: hsl(38, 92%, 55%);
  --success-color: hsl(145, 63%, 42%);
  --border-radius-card: 12px;
  --border-radius-btn: 8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', 'Noto Sans SC', system-ui, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; outline: none; background: transparent; }

/* Utilities */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.flex { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: 0.5rem; } .gap-2 { gap: 1rem; } .gap-3 { gap: 1.5rem; }
.mt-1 { margin-top: 0.5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; } .mb-4 { margin-bottom: 2rem; }

/* Layout */
.header {
  background: var(--surface-color);
  box-shadow: var(--shadow-sm);
  position: sticky; top: 0; z-index: 100;
  padding: 15px 0;
}
.header .logo { font-size: 1.25rem; font-weight: 700; color: var(--primary-color); display: flex; align-items: center; gap: 8px; }
.nav { display: flex; gap: 20px; }
.nav-item { font-weight: 500; color: var(--text-secondary); transition: var(--transition); cursor: pointer; }
.nav-item:hover, .nav-item.active { color: var(--primary-color); }
.main-content { min-height: calc(100vh - 200px); padding-bottom: 40px; }
.footer { background: var(--surface-color); padding: 30px 0; text-align: center; color: var(--text-secondary); border-top: 1px solid var(--border-color); margin-top: 40px; }
.footer a { color: var(--primary-color); transition: var(--transition); }
.footer a:hover { text-decoration: underline; }

/* Hero */
.hero { text-align: center; padding: 60px 20px; background: linear-gradient(135deg, var(--primary-light) 0%, rgba(255,255,255,1) 100%); border-radius: var(--border-radius-card); margin: 30px 0; box-shadow: var(--shadow-sm); }
.hero h1 { font-size: 2.5rem; font-weight: 700; color: var(--text-primary); margin-bottom: 15px; }
.hero p { font-size: 1.1rem; color: var(--text-secondary); }

/* Announcement Bar */
.announcement-bar {
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  color: white; padding: 10px 0; overflow: hidden; white-space: nowrap; box-shadow: inset 0 -1px 0 rgba(0,0,0,0.1);
}
.announcement-content { display: inline-block; animation: scrollLeft 25s linear infinite; font-size: 0.9rem; font-weight: 500; }
@keyframes scrollLeft { 0% { transform: translateX(100%); } 100% { transform: translateX(-100%); } }

/* Cards */
.card { background: var(--surface-color); border-radius: var(--border-radius-card); padding: 20px; box-shadow: var(--shadow-sm); transition: var(--transition); border: 1px solid var(--border-color); }
.product-card { 
  display: flex; flex-direction: row; gap: 15px; padding: 15px; cursor: pointer; position: relative; overflow: hidden;
  background: var(--surface-color); border-radius: var(--border-radius-card); 
  box-shadow: var(--shadow-sm); border: 1px solid var(--border-color); transition: var(--transition);
}
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--primary-color); }
.product-icon { 
  width: 90px; height: 90px; flex-shrink: 0; background: var(--bg-color); border-radius: 10px; 
  display: flex; align-items: center; justify-content: center; font-size: 2.5rem; overflow: hidden;
}
.product-info { display: flex; flex-direction: column; flex-grow: 1; min-width: 0; }
.product-title { font-size: 1.05rem; font-weight: 600; margin: 0 0 4px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.product-desc { font-size: 0.85rem; color: var(--text-secondary); margin: 0 0 10px 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4; min-height: 2.8em; }
.product-meta { display: flex; justify-content: space-between; align-items: center; }
.product-price { font-size: 1.25rem; font-weight: 700; color: var(--primary-color); }
.product-cloud-url { margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--border-color); font-size: 0.85rem; }
.product-cloud-url a { color: var(--primary-color); text-decoration: none; font-weight: 500; display: inline-block; transition: var(--transition); }
.product-cloud-url a:hover { color: hsl(220, 72%, 45%); text-decoration: underline; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 20px; border-radius: var(--border-radius-btn); font-weight: 600; transition: var(--transition); gap: 8px; cursor: pointer; font-size: 0.95rem; }
.btn-primary { background: var(--primary-color); color: white; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.btn-primary:hover { background: hsl(220, 72%, 50%); box-shadow: 0 4px 8px rgba(0,0,0,0.15); transform: translateY(-1px); }
.btn-secondary { background: var(--primary-light); color: var(--primary-color); }
.btn-secondary:hover { background: hsl(220, 72%, 90%); }
.btn-danger { background: rgba(255, 71, 87, 0.1); color: var(--danger-color); }
.btn-danger:hover { background: var(--danger-color); color: white; }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }
.btn-lg { padding: 12px 24px; font-size: 1.1rem; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }

/* Filter Tabs */
.filter-tabs { display: flex; gap: 10px; margin-bottom: 25px; overflow-x: auto; padding-bottom: 5px; scrollbar-width: none; }
.filter-tabs::-webkit-scrollbar { display: none; }
.filter-tab { padding: 8px 16px; border-radius: 20px; background: var(--surface-color); color: var(--text-secondary); font-weight: 500; border: 1px solid var(--border-color); transition: var(--transition); white-space: nowrap; }
.filter-tab:hover { background: var(--primary-light); color: var(--primary-color); }
.filter-tab.active { background: var(--primary-color); color: white; border-color: var(--primary-color); }

/* Product Grid */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 24px; }

/* Badges */
.badge { padding: 4px 8px; border-radius: 6px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.badge-success { background: rgba(46, 213, 115, 0.1); color: var(--success-color); }
.badge-warning { background: rgba(255, 165, 2, 0.1); color: var(--warning-color); }
.badge-danger { background: rgba(255, 71, 87, 0.1); color: var(--danger-color); }
.badge-info { background: var(--primary-light); color: var(--primary-color); }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-weight: 500; margin-bottom: 8px; color: var(--text-primary); font-size: 0.95rem; }
.form-input, .form-select, .form-textarea { width: 100%; padding: 12px 16px; border: 1px solid var(--border-color); border-radius: var(--border-radius-btn); font-family: inherit; font-size: 1rem; color: var(--text-primary); transition: var(--transition); background: var(--surface-color); }
.form-input:focus, .form-select:focus, .form-textarea:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px var(--primary-light); }

/* Modals */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.4); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 1000; opacity: 0; visibility: hidden; transition: var(--transition); }
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal { background: var(--surface-color); border-radius: 16px; width: 100%; max-width: 500px; box-shadow: var(--shadow-lg); transform: translateY(-20px); transition: var(--transition); display: flex; flex-direction: column; max-height: 90vh; overflow: hidden; }
.modal-overlay.active .modal { transform: translateY(0); }
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.modal-header h2 { font-size: 1.25rem; font-weight: 600; }
.modal-close { font-size: 1.5rem; color: var(--text-secondary); cursor: pointer; transition: var(--transition); }
.modal-close:hover { color: var(--danger-color); }
.modal-body { padding: 24px; overflow-y: auto; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border-color); display: flex; justify-content: flex-end; gap: 12px; background: var(--bg-color); }

/* Search Box */
.search-box { display: flex; gap: 10px; margin-bottom: 20px; }
.search-input { flex-grow: 1; }

/* Payment Methods */
.payment-methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.payment-option { border: 2px solid var(--border-color); border-radius: var(--border-radius-btn); padding: 15px; text-align: center; cursor: pointer; transition: var(--transition); font-weight: 500; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.payment-option:hover { border-color: var(--primary-light); background: var(--bg-color); }
.payment-option.selected { border-color: var(--primary-color); background: var(--primary-light); }
.payment-icon { font-size: 1.8rem; }

/* Processing Animation */
.loading-spinner { width: 40px; height: 40px; border: 4px solid var(--border-color); border-top-color: var(--primary-color); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.processing-view { text-align: center; padding: 40px 0; }
.processing-text { margin-top: 20px; font-weight: 500; color: var(--text-secondary); }

/* Success Animation */
.payment-success { text-align: center; padding: 20px 0; }
.success-icon { width: 60px; height: 60px; background: var(--success-color); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-size: 30px; margin: 0 auto 20px; animation: bounceIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
@keyframes bounceIn { 0% { transform: scale(0); } 50% { transform: scale(1.2); } 100% { transform: scale(1); } }

/* Keys Display */
.keys-list { background: var(--bg-color); border: 1px solid var(--border-color); border-radius: var(--border-radius-btn); padding: 15px; margin: 20px 0; text-align: left; max-height: 200px; overflow-y: auto; }
.key-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--border-color); }
.key-item:last-child { border-bottom: none; }
.key-value { font-family: monospace; font-size: 1.1rem; font-weight: 600; color: var(--text-primary); letter-spacing: 1px; }

/* Toast */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--surface-color); border-left: 4px solid var(--primary-color); box-shadow: var(--shadow-md); padding: 15px 20px; border-radius: 8px; display: flex; align-items: center; gap: 12px; min-width: 280px; transform: translateX(120%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.toast.show { transform: translateX(0); }
.toast-success { border-left-color: var(--success-color); }
.toast-error { border-left-color: var(--danger-color); }

/* Admin Layout */
.admin-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 260px; min-width: 260px; background: var(--surface-color); border-right: 1px solid var(--border-color);
  display: flex; flex-direction: column; padding: 0; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar-header { padding: 24px 20px 16px; border-bottom: 1px solid var(--border-color); }
.sidebar-header h3 { font-size: 1.2rem; color: var(--primary-color); margin: 0 0 4px; }
.sidebar-header p { color: var(--text-secondary); font-size: 0.85rem; margin: 0; }
.sidebar-nav { flex: 1; padding: 12px 0; }
.sidebar-item {
  display: block; padding: 12px 20px; color: var(--text-secondary); font-weight: 500; cursor: pointer;
  transition: var(--transition); border-left: 3px solid transparent; text-decoration: none;
}
.sidebar-item:hover { background: var(--bg-color); color: var(--text-primary); }
.sidebar-item.active { background: var(--primary-light); color: var(--primary-color); border-left-color: var(--primary-color); }
.sidebar-footer { padding: 16px 20px; border-top: 1px solid var(--border-color); }
.main-panel { flex: 1; padding: 2rem; background: var(--bg-color); overflow-y: auto; }

/* Stat Cards */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; }
.stat-card { background: var(--surface-color); border-radius: var(--border-radius-card); padding: 1.5rem; box-shadow: var(--shadow-sm); border: 1px solid var(--border-color); }
.stat-card h4 { color: var(--text-secondary); font-size: 0.9rem; margin: 0 0 0.5rem; font-weight: 500; }
.stat-card .stat-value { font-size: 2rem; font-weight: 700; color: var(--primary-color); margin: 0; }

/* Tables */
.table-container { background: var(--surface-color); border-radius: var(--border-radius-card); border: 1px solid var(--border-color); overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 1rem; text-align: left; border-bottom: 1px solid var(--border-color); }
.data-table th { font-weight: 600; color: var(--text-secondary); font-size: 0.9rem; background: var(--bg-color); white-space: nowrap; }
.data-table tbody tr:hover { background: var(--bg-color); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* Responsive */
@media (max-width: 768px) {
  .nav { display: none; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  .hero h1 { font-size: 2rem; }
  .admin-layout { flex-direction: column; }
  .sidebar { position: fixed; left: -100%; top: 0; bottom: 0; z-index: 1000; transition: left 0.3s ease; box-shadow: 2px 0 12px rgba(0,0,0,0.1); }
  .sidebar.open { left: 0; }
  .main-panel { margin-left: 0; width: 100%; padding: 1.5rem; }
  .table-container { overflow-x: auto; }
  .data-table { min-width: 600px; }
}
@media (max-width: 480px) {
  .product-grid { grid-template-columns: 1fr; }
  .payment-methods { grid-template-columns: 1fr; }
  .modal-overlay { align-items: flex-end; }
  .modal { border-radius: 20px 20px 0 0; max-height: 85vh; }
}

