/* =============================================================================
   COMPONENT STYLES - Buttons, Forms, UI Elements
   ============================================================================= */

/* Labels and Form Elements */
label {
  display: block;
  font-weight: 600;
  color: #4a5568;
  margin-bottom: 8px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Select Dropdowns */
select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 16px; /* Prevents zoom on iOS */
  color: #2d3748;
  background: white;
  cursor: pointer;
  transition: all 0.3s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234a5568' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
  min-height: 44px; /* Touch-friendly */
  touch-action: manipulation;
}

select:hover {
  border-color: #667eea;
}

select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Textarea */
textarea {
  width: 100%;
  height: 450px;
  padding: 16px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-family: 'Courier New', Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  color: #2d3748;
  background: #1e293b;
  color: #e2e8f0;
  resize: vertical;
  transition: all 0.3s ease;
}

textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Button Groups */
.button-group {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

/* Base Button Styles */
button {
  flex: 1;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-height: 44px; /* Touch-friendly minimum */
  touch-action: manipulation; /* Prevent zoom on double-tap */
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* Specific Button Types */
#btnApply {
  background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(72, 187, 120, 0.4);
}

#btnApply:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(72, 187, 120, 0.5);
}

#btnApply:active {
  transform: translateY(0);
}

#btnApply::before {
  content: "▶️";
}

#btnDestroy {
  background: linear-gradient(135deg, #f56565 0%, #c53030 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(245, 101, 101, 0.4);
}

#btnDestroy:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 101, 101, 0.5);
}

#btnDestroy:active {
  transform: translateY(0);
}

#btnDestroy::before {
  content: "⏹️";
}

/* Admin Badge */
.admin-badge {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Admin Toggle Button */
.admin-toggle {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.admin-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* Logout Button */
.logout-btn {
  background: #e53e3e;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.logout-btn:hover {
  background: #c53030;
}

/* Admin Tab Buttons */
.admin-tab {
  padding: 12px 24px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  color: #718096;
  border-bottom: 3px solid transparent;
  transition: all 0.3s ease;
}

.admin-tab.active {
  color: #667eea;
  border-bottom-color: #667eea;
}

/* Info Button */
.info-btn {
  background: none;
  color: #94a3b8;
  border: none;
  font-size: 16px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  vertical-align: middle;
  padding: 0;
  line-height: 1;
}

.info-btn:hover {
  color: #64748b;
  transform: scale(1.1);
}

.info-btn:active {
  transform: scale(0.95);
}

/* URL Link */
.url-link {
  display: inline-block;
  padding: 12px 24px;
  background: white;
  color: #667eea;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 16px;
  transition: all 0.3s ease;
  margin-top: 8px;
}

.url-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.url-link.disabled {
  background: #e5e7eb;
  color: #9ca3af;
  cursor: not-allowed;
  pointer-events: none;
}

.url-link::before {
  content: "🌐 ";
}

/* Status Badges */
.status {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.status.running {
  background: #fef5e7;
  color: #f59e0b;
  animation: pulse 2s infinite;
}

.status.success {
  background: #d1fae5;
  color: #10b981;
}

.status.error {
  background: #fee;
  color: #ef4444;
}

.status.idle {
  background: #e2e8f0;
  color: #64748b;
}

.status.queued {
  background: #dbeafe;
  color: #3b82f6;
  animation: pulse 2s infinite;
}

.queue-position {
  font-size: 11px;
  opacity: 0.9;
  margin-left: 5px;
}

/* Loading Spinner */
.loading-spinner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 14px;
  color: #667eea;
  background: #f0f4ff;
  border: 1px solid #c7d2fe;
  border-radius: 6px;
  margin-top: 8px;
}

.loading-spinner::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid #e2e8f0;
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Error Message */
.error-message {
  padding: 8px 12px;
  font-size: 14px;
  color: #dc2626;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  margin-top: 8px;
}

/* Credentials Warning */
.credentials-warning {
  background: #fef3c7;
  border: 2px solid #f59e0b;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #92400e;
}

.credentials-warning::before {
  content: "⚠️";
  font-size: 20px;
}

/* IP Check Status */
.ip-check-status {
  background: #fef3c7;
  border: 2px solid #f59e0b;
  border-radius: 8px;
  padding: 16px;
  margin: 16px 0;
  display: none;
  animation: slideIn 0.3s ease-out;
}

.ip-check-status.active {
  display: block;
}

.ip-check-status.success {
  background: #d1fae5;
  border-color: #10b981;
}

.ip-check-status.checking {
  background: #dbeafe;
  border-color: #3b82f6;
}

.ip-check-progress {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: #4a5568;
}

.ip-check-spinner {
  width: 20px;
  height: 20px;
  border: 3px solid #e2e8f0;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Projects Table */
.projects-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.projects-table th,
.projects-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}

.projects-table th {
  background: #f7fafc;
  font-weight: 600;
  color: #4a5568;
}

.projects-table tr:hover {
  background: #f7fafc;
}