/* =============================================================================
   ADMIN STYLES - Management Buttons, Admin Panel Components
   ============================================================================= */

/* Management Action Buttons */
#mgmtTab button,
#mgmtProjects button,
.mgmt-action-btn {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-transform: none;
  letter-spacing: 0.3px;
  margin: 2px 4px;
  min-width: auto;
  flex: none;
  position: relative;
  overflow: hidden;
}

/* Button Variants */
.mgmt-action-btn.primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
  border: 1px solid rgba(102, 126, 234, 0.4);
}

.mgmt-action-btn.success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.mgmt-action-btn.danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.mgmt-action-btn.warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.mgmt-action-btn.secondary {
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(107, 114, 128, 0.3);
  border: 1px solid rgba(107, 114, 128, 0.4);
}

/* Hover Effects */
.mgmt-action-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.mgmt-action-btn.primary:hover:not(:disabled) {
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.mgmt-action-btn.success:hover:not(:disabled) {
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.mgmt-action-btn.danger:hover:not(:disabled) {
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.mgmt-action-btn.warning:hover:not(:disabled) {
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

/* Active State */
.mgmt-action-btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Disabled State */
.mgmt-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Specific Button Styles */
#mgmtTab button[onclick*="addProject"],
#mgmtTab button[onclick*="addEnv"],
#mgmtTab button[onclick*="newFile"] {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

#mgmtTab button[onclick*="delProject"],
#mgmtTab button[onclick*="delEnv"] {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
  border: 1px solid rgba(239, 68, 68, 0.4);
}

#mgmtTab button[onclick*="editFile"],
#mgmtTab button[onclick*="viewFiles"] {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
  border: 1px solid rgba(59, 130, 246, 0.4);
}

#mgmtTab button[onclick*="markImportant"] {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

/* Save Button for Root Terragrunt */
#mgmtTab button[onclick*="saveRootTgHcl"] {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
  border: 1px solid rgba(139, 92, 246, 0.4);
  padding: 12px 24px;
  font-size: 14px;
  margin-top: 10px;
}

/* Button Icons */
.mgmt-action-btn::before {
  font-size: 14px;
}

button[onclick*="addProject"]::before,
button[onclick*="addEnv"]::before,
button[onclick*="newFile"]::before {
  content: "➕";
}

button[onclick*="delProject"]::before,
button[onclick*="delEnv"]::before {
  content: "🗑️";
}

button[onclick*="editFile"]::before {
  content: "✏️";
}

button[onclick*="viewFiles"]::before {
  content: "📁";
}

button[onclick*="markImportant"]::before {
  content: "⭐";
}

button[onclick*="saveRootTgHcl"]::before {
  content: "💾";
}

/* Loading State for Buttons */
.mgmt-action-btn.loading {
  position: relative;
  color: transparent;
}

.mgmt-action-btn.loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}