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

:root {
  --color-primary: #FDB913;
  --color-primary-hover: #e5a711;
  --color-secondary: #7C3AED;
  --color-secondary-hover: #6d28d9;
  --color-bg: #FFFFFF;
  --color-bg-light: #F5F5F5;
  --color-text: #1A1A1A;
  --color-text-secondary: #555555;
  --color-danger: #EF4444;
  --color-success: #10B981;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--color-bg-light);
  color: var(--color-text);
  line-height: 1.5;
}

/* Buttons */
.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-text);
  font-weight: 600;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
  font-size: 16px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

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

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

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  background-color: var(--color-secondary);
  color: white;
  font-weight: 600;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
  font-size: 16px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-secondary:hover {
  background-color: var(--color-secondary-hover);
}

.btn-danger {
  background-color: var(--color-danger);
  color: white;
  font-weight: 600;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
  font-size: 14px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-danger:hover {
  background-color: #dc2626;
}

/* Header */
.header {
  background: white;
  border-bottom: 1px solid #e5e5e5;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-logo {
  height: 40px;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--color-secondary) 0%, #9333ea 100%);
  color: white;
  padding: 40px 24px;
  text-align: center;
}

.hero h1 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 8px;
}

.hero p {
  font-size: 16px;
  opacity: 0.9;
}

/* Cards */
.card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Form elements */
input[type="text"],
input[type="password"],
input[type="tel"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e5e5e5;
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  transition: border-color 0.2s;
  min-height: 48px;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-secondary);
}

label {
  display: block;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--color-text);
}

/* Upload zone */
.dropzone {
  border: 2px dashed #ccc;
  border-radius: 12px;
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
  background: #fafafa;
}

.dropzone:hover,
.dropzone.active {
  border-color: var(--color-secondary);
  background-color: #f3f0ff;
}

.dropzone-icon {
  font-size: 48px;
  color: var(--color-secondary);
  margin-bottom: 12px;
}

/* Identifier display */
.identifier-display {
  font-size: 48px;
  font-weight: 800;
  letter-spacing: 4px;
  color: var(--color-secondary);
  text-align: center;
  padding: 24px;
}

@media (max-width: 768px) {
  .identifier-display {
    font-size: 36px;
  }
}

/* Tabs */
.tabs {
  display: flex;
  border-bottom: 2px solid #e5e5e5;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab {
  padding: 12px 20px;
  cursor: pointer;
  font-weight: 500;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s, border-color 0.2s;
  min-height: 48px;
  display: flex;
  align-items: center;
}

.tab:hover {
  color: var(--color-secondary);
}

.tab.active {
  color: var(--color-secondary);
  border-bottom-color: var(--color-secondary);
}

/* Progress bar */
.progress-bar {
  width: 100%;
  height: 8px;
  background: #e5e5e5;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: 4px;
  transition: width 0.3s;
}

/* Modal overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 16px;
}

.modal {
  background: white;
  border-radius: 12px;
  padding: 24px;
  max-width: 480px;
  width: 100%;
}

/* Stats card */
.stat-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.stat-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--color-secondary);
}

.stat-label {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-top: 4px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  padding: 12px 16px;
  background: var(--color-bg-light);
  font-weight: 600;
  font-size: 14px;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid #e5e5e5;
  font-size: 14px;
}

tr:hover {
  background-color: #fafafa;
}

/* Badge */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
}

.badge-active {
  background: #d1fae5;
  color: #065f46;
}

.badge-inactive {
  background: #fee2e2;
  color: #991b1b;
}

/* File list */
.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--color-bg-light);
  border-radius: 8px;
  margin-bottom: 8px;
}

.file-item-name {
  font-weight: 500;
  word-break: break-all;
  flex: 1;
  margin-right: 12px;
}

.file-item-size {
  color: var(--color-text-secondary);
  font-size: 13px;
  white-space: nowrap;
}

/* Alert */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}

.alert-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.container-sm {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Spacing utilities */
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.p-4 { padding: 16px; }
.p-6 { padding: 24px; }
.gap-4 { gap: 16px; }

/* Flex utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }

/* Grid */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

@media (max-width: 768px) {
  .grid-2, .grid-4 {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 22px;
  }

  .hero {
    padding: 24px 16px;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Text utilities */
.text-center { text-align: center; }
.text-sm { font-size: 14px; }
.text-lg { font-size: 18px; }
.text-xl { font-size: 24px; }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.text-muted { color: var(--color-text-secondary); }
.text-danger { color: var(--color-danger); }
.text-success { color: var(--color-success); }

/* Width */
.w-full { width: 100%; }

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #e5e5e5;
  border-top-color: var(--color-secondary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* Hidden */
[x-cloak] { display: none !important; }
