/* Roblox Fisch Market - Theme & Styles */
:root {
  --bg-main: #070b13;
  --bg-card: rgba(14, 22, 38, 0.85);
  --bg-card-hover: rgba(20, 32, 56, 0.95);
  --bg-glass: rgba(16, 26, 46, 0.6);
  --border-color: rgba(0, 242, 254, 0.15);
  --border-glow: rgba(0, 242, 254, 0.4);
  
  --primary-cyan: #00f2fe;
  --primary-blue: #4facfe;
  --accent-gold: #f5af19;
  --accent-red: #ff4757;
  --accent-green: #2ed573;
  --accent-purple: #a855f7;

  /* Rarity Colors */
  --rarity-common: #94a3b8;
  --rarity-rare: #38bdf8;
  --rarity-legendary: #f59e0b;
  --rarity-mythic: #ec4899;
  --rarity-exotic: #8b5cf6;
  --rarity-secret: #10b981;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
}

body {
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(circle at 15% 20%, rgba(0, 242, 254, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(168, 85, 247, 0.08) 0%, transparent 40%),
    linear-gradient(180deg, #070b13 0%, #03060a 100%);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #05080e;
}
::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary-cyan);
}

/* Header & Nav */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 11, 19, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-main);
}

.brand-icon {
  font-size: 28px;
  filter: drop-shadow(0 0 10px rgba(0, 242, 254, 0.6));
}

.brand-text h1 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff, var(--primary-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-badge {
  font-size: 10px;
  text-transform: uppercase;
  background: rgba(0, 242, 254, 0.15);
  color: var(--primary-cyan);
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid var(--border-glow);
  font-weight: 700;
  display: inline-block;
  margin-top: 2px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
  color: #070b13;
  box-shadow: 0 4px 15px rgba(0, 242, 254, 0.3);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 242, 254, 0.5);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glow);
}

.btn-admin {
  background: linear-gradient(135deg, #f5af19 0%, #e65c00 100%);
  color: #000;
  font-weight: 700;
}
.btn-admin:hover {
  box-shadow: 0 4px 15px rgba(245, 175, 25, 0.4);
}

.btn-danger {
  background: var(--accent-red);
  color: white;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* Hero Section */
.hero {
  padding: 50px 24px 30px;
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(0, 242, 254, 0.1);
  border: 1px solid rgba(0, 242, 254, 0.25);
  color: var(--primary-cyan);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 18px;
}

.hero h2 {
  font-size: 42px;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 16px;
}

.hero h2 span {
  background: linear-gradient(135deg, var(--primary-cyan), #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  color: var(--text-muted);
  font-size: 16px;
  margin-bottom: 28px;
}

/* Controls / Filters */
.controls-bar {
  max-width: 1200px;
  margin: 0 auto 32px;
  padding: 0 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 260px;
}

.search-box input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
}

.search-box input:focus {
  border-color: var(--primary-cyan);
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.2);
}

.search-box .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
}

.filter-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.pill {
  padding: 8px 16px;
  border-radius: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.pill:hover, .pill.active {
  background: rgba(0, 242, 254, 0.15);
  border-color: var(--primary-cyan);
  color: var(--primary-cyan);
}

/* Product Grid */
.market-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 60px;
}

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

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  backdrop-filter: blur(8px);
}

.product-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-glow);
  box-shadow: 0 12px 30px rgba(0, 242, 254, 0.15);
}

.product-image-wrap {
  position: relative;
  width: 100%;
  height: 190px;
  overflow: hidden;
  background: #0d1525;
}

.product-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.product-card:hover .product-image-wrap img {
  transform: scale(1.06);
}

.rarity-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.rarity-Common { background: var(--rarity-common); }
.rarity-Rare { background: var(--rarity-rare); }
.rarity-Legendary { background: var(--rarity-legendary); }
.rarity-Mythic { background: var(--rarity-mythic); box-shadow: 0 0 10px rgba(236, 72, 153, 0.6); }
.rarity-Exotic { background: var(--rarity-exotic); box-shadow: 0 0 10px rgba(139, 92, 246, 0.6); }
.rarity-Secret { background: var(--rarity-secret); box-shadow: 0 0 10px rgba(16, 185, 129, 0.6); }

.stock-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.stock-in { color: var(--accent-green); }
.stock-low { color: var(--accent-gold); }
.stock-out { color: var(--accent-red); background: rgba(255, 71, 87, 0.2); }

.product-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-category {
  font-size: 12px;
  color: var(--primary-cyan);
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.product-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-main);
}

.product-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 16px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 14px;
  margin-top: auto;
}

.product-price {
  display: flex;
  flex-direction: column;
}

.price-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.price-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: #0f172a;
  border: 1px solid var(--border-glow);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 242, 254, 0.2);
  border-radius: var(--radius-lg);
  max-width: 500px;
  width: 100%;
  overflow: hidden;
  transform: translateY(20px);
  transition: transform 0.2s ease;
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

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

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 24px;
  cursor: pointer;
}
.modal-close:hover {
  color: var(--text-main);
}

.modal-body {
  padding: 24px;
}

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

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 12px 14px;
  background: #070b13;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 14px;
  outline: none;
  transition: border 0.2s;
}

.form-control:focus {
  border-color: var(--primary-cyan);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.2);
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

/* Chat & Ticket Styles */
.ticket-wrapper {
  max-width: 850px;
  margin: 30px auto;
  padding: 0 20px;
}

.ticket-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 680px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
}

.ticket-header {
  padding: 18px 24px;
  background: rgba(15, 23, 42, 0.9);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ticket-info h2 {
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ticket-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  gap: 14px;
}

.chat-messages {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: radial-gradient(circle at center, rgba(14, 22, 38, 0.4) 0%, rgba(7, 11, 19, 0.8) 100%);
}

.chat-bubble {
  max-width: 80%;
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  line-height: 1.5;
  position: relative;
  word-break: break-word;
}

.chat-bubble.buyer {
  align-self: flex-end;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: white;
  border-bottom-right-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.chat-bubble.admin {
  align-self: flex-start;
  background: #1e293b;
  border: 1px solid var(--border-glow);
  color: var(--text-main);
  border-bottom-left-radius: 4px;
  box-shadow: 0 4px 15px rgba(0, 242, 254, 0.1);
}

.chat-sender {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sender-admin {
  color: var(--accent-gold);
}

.sender-buyer {
  color: #bae6fd;
}

.chat-time {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 6px;
  text-align: right;
}

.chat-input-bar {
  padding: 16px 20px;
  background: rgba(15, 23, 42, 0.95);
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 12px;
}

.chat-input-bar input {
  flex: 1;
  background: #070b13;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--text-main);
  font-size: 14px;
  outline: none;
}
.chat-input-bar input:focus {
  border-color: var(--primary-cyan);
}

/* Admin Dashboard Specific */
.admin-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  max-width: 1300px;
  margin: 30px auto;
  padding: 0 20px;
}

@media (max-width: 900px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }
}

.admin-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  height: fit-content;
}

.admin-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.admin-tabs {
  display: flex;
  gap: 10px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 14px;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn.active {
  background: rgba(0, 242, 254, 0.15);
  color: var(--primary-cyan);
}

.table-wrap {
  overflow-x: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th, td {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 14px;
}

th {
  background: rgba(15, 23, 42, 0.7);
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 12px;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.badge-status {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.status-pending { background: rgba(245, 175, 25, 0.2); color: var(--accent-gold); }
.status-completed, .status-delivered { background: rgba(46, 213, 115, 0.2); color: var(--accent-green); }
.status-open { background: rgba(0, 242, 254, 0.2); color: var(--primary-cyan); }
.status-closed { background: rgba(148, 163, 184, 0.2); color: var(--text-muted); }

.stock-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stock-btn {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  background: #1e293b;
  border: 1px solid var(--border-color);
  color: white;
  cursor: pointer;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stock-btn:hover {
  background: var(--primary-cyan);
  color: black;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius-md);
  background: #1e293b;
  color: white;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  border-left: 4px solid var(--primary-cyan);
  animation: slideIn 0.3s ease;
}
.toast-success { border-color: var(--accent-green); }
.toast-error { border-color: var(--accent-red); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
