/**
 * admin.css - Admin panel styles for Quick Add feature
 */

:root {
  --primary-color: #8B4513;
  --secondary-color: #D4AF37;
  --dark-bg: #1a1a1a;
  --light-bg: #f5f5f5;
  --text-dark: #333;
  --text-light: #666;
  --border-color: #ddd;
  --success-color: #4caf50;
  --error-color: #f44336;
  --warning-color: #ff9800;
}

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

html {
  font-size: 16px;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--dark-bg);
  color: var(--text-dark);
  line-height: 1.6;
}

/* Admin Header */
header {
  background: linear-gradient(135deg, #5a2e0f 0%, var(--primary-color) 100%);
  color: white;
  padding: 1.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

header h1 {
  font-size: 2rem;
  margin-bottom: 0.25rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

header p {
  font-size: 0.95rem;
  opacity: 0.9;
}

header .admin-badge {
  display: inline-block;
  background: var(--secondary-color);
  color: var(--text-dark);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.8rem;
  margin-left: 0.5rem;
}

/* Navigation Tabs */
.admin-nav {
  background: white;
  border-bottom: 2px solid var(--border-color);
  padding: 0;
  display: flex;
  gap: 0;
}

.nav-tab {
  padding: 1rem 1.5rem;
  border: none;
  background: white;
  color: var(--text-light);
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  border-bottom: 3px solid transparent;
}

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

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

/* Main Container */
main {
  max-width: 1400px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* Section Styles */
.admin-section {
  background: white;
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  display: none;
}

.admin-section.active {
  display: block;
}

.admin-section h2 {
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  font-size: 1.8rem;
  border-bottom: 2px solid var(--secondary-color);
  padding-bottom: 0.5rem;
}

.admin-section h3 {
  color: var(--primary-color);
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

/* Form Layout */
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  padding: 0.75rem;
  border: 2px solid var(--border-color);
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 5px rgba(139, 69, 19, 0.2);
}

.form-group textarea {
  min-height: 150px;
  resize: vertical;
  font-family: monospace;
}

/* Button Group */
.button-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

button {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

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

.btn-primary:hover {
  background: #a0522d;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(139, 69, 19, 0.3);
}

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

.btn-secondary:hover {
  background: #e6c200;
  transform: translateY(-2px);
}

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

.btn-danger:hover {
  background: #da190b;
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

/* Data Display Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5rem;
}

.data-table thead {
  background: var(--light-bg);
  border-bottom: 2px solid var(--primary-color);
}

.data-table th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--primary-color);
}

.data-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.data-table tbody tr:hover {
  background: rgba(139, 69, 19, 0.05);
}

/* Token Preview */
.token-preview {
  background: var(--light-bg);
  border-radius: 6px;
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.token-preview h4 {
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.token-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}

.token-item {
  padding: 1rem;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  text-align: center;
  transition: all 0.3s ease;
}

.token-item:hover {
  border-color: var(--primary-color);
  box-shadow: 0 2px 6px rgba(139, 69, 19, 0.2);
}

.token-item .token-text {
  font-family: monospace;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.25rem;
}

.token-item .token-type {
  font-size: 0.75rem;
  color: var(--text-light);
  text-transform: uppercase;
}

/* Auto-Detection Results */
.detection-results {
  background: white;
  border: 2px solid var(--secondary-color);
  border-radius: 6px;
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.detection-results h4 {
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.result-item {
  padding: 1rem;
  background: var(--light-bg);
  border-left: 3px solid var(--secondary-color);
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.result-item .legend {
  font-family: monospace;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.result-item .tokens {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.result-item .token-tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: white;
  border-radius: 20px;
  font-size: 0.85rem;
  border: 1px solid var(--border-color);
}

/* JSON Output */
.json-output {
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 1.5rem;
  border-radius: 6px;
  overflow-x: auto;
  margin-top: 1.5rem;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  line-height: 1.5;
}

.json-output .json-key {
  color: #9cdcfe;
}

.json-output .json-string {
  color: #ce9178;
}

.json-output .json-number {
  color: #b5cea8;
}

.json-output .json-boolean {
  color: #569cd6;
}

/* Status Messages */
.alert {
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.alert-success {
  background: rgba(76, 175, 80, 0.1);
  border-left: 4px solid var(--success-color);
  color: var(--success-color);
}

.alert-error {
  background: rgba(244, 67, 54, 0.1);
  border-left: 4px solid var(--error-color);
  color: var(--error-color);
}

.alert-warning {
  background: rgba(255, 152, 0, 0.1);
  border-left: 4px solid var(--warning-color);
  color: var(--warning-color);
}

.alert-info {
  background: rgba(33, 150, 243, 0.1);
  border-left: 4px solid #2196f3;
  color: #2196f3;
}

.alert-icon {
  flex-shrink: 0;
  font-weight: bold;
}

/* Progress Indicator */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--light-bg);
  border-radius: 4px;
  overflow: hidden;
  margin: 1rem 0;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* Footer */
footer {
  background: rgba(0, 0, 0, 0.7);
  color: #ccc;
  text-align: center;
  padding: 2rem;
  margin-top: 3rem;
  border-top: 2px solid var(--primary-color);
}

/* Responsive Design */
@media (max-width: 768px) {
  header h1 {
    font-size: 1.5rem;
  }

  main {
    padding: 0 0.5rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .admin-nav {
    flex-direction: column;
  }

  .nav-tab {
    border-bottom: 2px solid transparent;
    border-right: 3px solid transparent;
    padding: 0.75rem 1rem;
  }

  .nav-tab.active {
    border-bottom: none;
    border-right-color: var(--primary-color);
  }

  .button-group {
    flex-direction: column;
  }

  button {
    width: 100%;
  }

  .data-table {
    font-size: 0.9rem;
  }

  .data-table th,
  .data-table td {
    padding: 0.75rem;
  }
}
