/* FAP Smart Tools - Admin Panel Styles */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 40px 20px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

/* Header */
.header {
  background: white;
  padding: 30px;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-content h1 {
  font-size: 28px;
  font-weight: 800;
  color: #1f2937;
  margin-bottom: 8px;
}

.header-content p {
  color: #6b7280;
  font-size: 14px;
}

.api-status {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 700;
}

/* Main Content */
.main-content {
  background: white;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.section {
  padding: 30px;
  border-bottom: 1px solid #e5e7eb;
}

.section:last-child {
  border-bottom: none;
  border-radius: 0 0 16px 16px;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-icon {
  font-size: 24px;
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
  font-family: inherit;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: 0.3s;
  border-radius: 34px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input:checked + .toggle-slider {
  background: linear-gradient(135deg, #10b981, #059669);
}

input:checked + .toggle-slider:before {
  transform: translateX(26px);
}

.toggle-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #f9fafb;
  border-radius: 10px;
  cursor: pointer;
  border: 2px solid #e5e7eb;
  transition: all 0.2s;
}

.toggle-label:hover {
  border-color: #d1d5db;
  background: #f3f4f6;
}

.toggle-label span {
  font-weight: 600;
  color: #374151;
}

/* Checkbox */
.checkbox-group {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: #f9fafb;
  border-radius: 8px;
}

.checkbox-group input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.checkbox-group label {
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  flex: 1;
}

/* Buttons */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: white;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-success:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Status Badge */
.status-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
}

.status-badge.enabled {
  background: #d1fae5;
  color: #065f46;
}

.status-badge.disabled {
  background: #fee2e2;
  color: #991b1b;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.stat-card {
  background: linear-gradient(135deg, #f9fafb, #f3f4f6);
  padding: 24px;
  border-radius: 12px;
  border: 2px solid #e5e7eb;
  text-align: center;
}

.stat-value {
  font-size: 36px;
  font-weight: 800;
  color: #1f2937;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 14px;
  color: #6b7280;
  font-weight: 600;
}

/* Version List */
.version-list {
  margin-top: 24px;
}

.version-item {
  background: #f9fafb;
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 2px solid #e5e7eb;
  transition: all 0.2s;
}

.version-item:hover {
  border-color: #d1d5db;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.version-item.latest {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  border-color: #3b82f6;
}

.version-info {
  flex: 1;
}

.version-number {
  font-size: 20px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 6px;
}

.version-date {
  font-size: 13px;
  color: #6b7280;
}

.version-badges {
  display: flex;
  gap: 8px;
  align-items: center;
}

.badge {
  padding: 6px 14px;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-latest {
  background: #3b82f6;
  color: white;
}

.badge-force {
  background: #ef4444;
  color: white;
}

/* Alerts */
.alert {
  padding: 16px 20px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert-success {
  background: #d1fae5;
  color: #065f46;
  border: 2px solid #10b981;
}

.alert-error {
  background: #fee2e2;
  color: #991b1b;
  border: 2px solid #ef4444;
}

.alert-warning {
  background: #fef3c7;
  color: #92400e;
  border: 2px solid #f59e0b;
}

/* Loading */
.loading {
  text-align: center;
  padding: 40px;
  color: #6b7280;
}

.loading-spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px solid #e5e7eb;
  border-radius: 50%;
  border-top-color: #6366f1;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Help Box */
.help-box {
  background: #f9fafb;
  padding: 20px;
  border-radius: 10px;
  border: 2px solid #e5e7eb;
}

.help-box h3 {
  font-size: 16px;
  color: #1f2937;
  margin-bottom: 12px;
}

.help-box ul {
  margin-left: 20px;
  color: #4b5563;
  line-height: 1.8;
}

.help-box code {
  background: #e5e7eb;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  color: #ef4444;
}

.help-box p {
  color: #4b5563;
  line-height: 1.6;
}

/* Version Chart */
.version-distribution {
  margin-top: 24px;
}

.version-bar {
  margin-bottom: 12px;
}

.version-bar-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 13px;
}

.version-bar-label {
  font-weight: 600;
  color: #374151;
}

.version-bar-value {
  font-weight: 700;
  color: #6b7280;
}

.version-bar-track {
  background: #e5e7eb;
  height: 24px;
  border-radius: 12px;
  overflow: hidden;
}

.version-bar-fill {
  background: linear-gradient(90deg, #6366f1, #4f46e5);
  height: 100%;
  border-radius: 12px;
  transition: width 0.5s ease;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 12px;
  color: white;
  font-weight: 700;
  font-size: 12px;
}

/* Footer */
.footer {
  text-align: center;
  padding: 24px;
  color: white;
  font-size: 14px;
}

.footer p {
  margin: 4px 0;
  opacity: 0.9;
}

/* Responsive */
@media (max-width: 768px) {
  body {
    padding: 20px 10px;
  }
  
  .header {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .version-item {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
}

