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

:root {
  --bg-primary: #0a0a0c;
  --bg-secondary: #121216;
  --bg-card: rgba(22, 22, 29, 0.7);
  --border-color: rgba(255, 255, 255, 0.08);
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --tiktok-red: #fe2c55;
  --tiktok-cyan: #ff7a00;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  padding: 20px;
}

/* Background mesh highlights (Subtle, no grid patterns) */
body::before {
  content: '';
  position: absolute;
  top: -10%;
  left: -10%;
  width: 50%;
  height: 50%;
  background: radial-gradient(circle, rgba(254, 44, 85, 0.08) 0%, rgba(0,0,0,0) 70%);
  z-index: -1;
  pointer-events: none;
}

body::after {
  content: '';
  position: absolute;
  bottom: -10%;
  right: -10%;
  width: 50%;
  height: 50%;
  background: radial-gradient(circle, rgba(255, 122, 0, 0.06) 0%, rgba(0,0,0,0) 70%);
  z-index: -1;
  pointer-events: none;
}

.container {
  width: 100%;
  max-width: 480px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 40px 30px;
  box-shadow: var(--shadow);
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}

.container:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.5);
}

.logo-container {
  margin-bottom: 30px;
  position: relative;
  display: inline-block;
}

.logo {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--text-primary);
  position: relative;
  display: inline-block;
  user-select: none;
}

/* TikTok split color text effect */
.logo::before, .logo::after {
  content: 'ShopLink';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.logo::before {
  color: var(--tiktok-cyan);
  left: -2px;
  text-shadow: 0 0 10px rgba(37, 244, 238, 0.5);
  clip-path: rect(0 400px 100px 0);
}

.logo::after {
  color: var(--tiktok-red);
  left: 2px;
  text-shadow: 0 0 10px rgba(254, 44, 85, 0.5);
  clip-path: rect(0 400px 100px 0);
}

.title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.description {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 30px;
}

/* Status Badges */
.status-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.authorized {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-badge.unauthorized {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.device-id-container {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  width: 100%;
  padding: 4px 4px 4px 12px;
  margin-top: 8px;
}

.device-id {
  font-family: monospace;
  font-size: 13px;
  color: var(--text-secondary);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-grow: 1;
  user-select: all;
}

.copy-btn {
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: var(--text-primary);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.copy-btn:active {
  transform: scale(0.96);
}

/* Action Buttons */
.action-btn {
  display: block;
  width: 100%;
  padding: 16px 24px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  text-decoration: none;
}

.action-btn.open-btn {
  background: linear-gradient(90deg, var(--tiktok-red) 0%, #d62246 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(254, 44, 85, 0.3);
}

.action-btn.open-btn:hover {
  box-shadow: 0 6px 20px rgba(254, 44, 85, 0.5);
  transform: translateY(-1px);
}

.action-btn.open-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 10px rgba(254, 44, 85, 0.3);
}

/* Admin Dashboard Specifics */
.admin-container {
  max-width: 1000px;
  width: 100%;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 40px;
  box-shadow: var(--shadow);
}

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

.admin-title-group h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
}

@media (min-width: 768px) {
  .admin-grid {
    grid-template-columns: 1.2fr 1.8fr;
  }
}

.card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 24px;
  height: fit-content;
}

.card h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--tiktok-cyan);
}

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

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

.form-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px 16px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus {
  border-color: var(--tiktok-cyan);
}

.btn-submit {
  width: 100%;
  padding: 12px;
  background: #f3f4f6;
  color: #111827;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}

.btn-submit:hover {
  opacity: 0.9;
}

.btn-submit:active {
  transform: scale(0.98);
}

/* Lists and Tables */
.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.list-item:last-child {
  border-bottom: none;
}

.list-item-text {
  text-align: left;
}

.list-item-title {
  font-weight: 600;
  font-size: 14px;
}

.list-item-sub {
  font-size: 12px;
  color: var(--text-secondary);
  font-family: monospace;
}

.btn-icon {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.btn-icon.btn-auth {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Table Style */
.table-container {
  overflow-x: auto;
}

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

th {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
  padding: 12px 8px;
  border-bottom: 1px solid var(--border-color);
}

td {
  padding: 14px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 13px;
}

tr:last-child td {
  border-bottom: none;
}

.mono {
  font-family: monospace;
}

/* Animations */
@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.8; }
  100% { transform: scale(1); opacity: 1; }
}

.animate-pulse-slow {
  animation: pulse 3s infinite ease-in-out;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1f2937;
  color: #fff;
  border: 1px solid var(--border-color);
  padding: 12px 24px;
  border-radius: 8px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1000;
}

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

/* Mobile responsive styles */
@media (max-width: 600px) {
  body {
    padding: 12px 8px;
  }
  .container {
    padding: 24px 16px;
    border-radius: 16px;
  }
  .admin-container {
    padding: 20px 12px;
    border-radius: 16px;
  }
  .admin-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 12px;
  }
  .admin-header .copy-btn, .admin-header a.copy-btn {
    align-self: stretch;
    text-align: center;
    padding: 10px;
  }
  .admin-header h1 {
    font-size: 20px;
  }
  .search-box {
    margin-bottom: 15px;
  }
}
